Я пытаюсь разработать расширение оболочки gnome, и я создал расширение "Hello World", которое создается автоматически с помощью gnome-shell-extension-tool --create-extension
Создает 3 файла: example.js, metadata.json, stylesheet.css.
Я перезагружаю gnome-shell и расширение работает корректно.Проблема в том, что файл стилей не работает вообще;вот код:
// Sample extension code, makes clicking on the panel show a message
const St = imports.gi.St;
const Mainloop = imports.mainloop;
const Main = imports.ui.main;
function _showHello() {
let text = new St.Label({ style_class: 'hello', text: "Hello, world!" });
let monitor = global.get_primary_monitor();
global.stage.add_actor(text);
text.set_position(Math.floor (monitor.width / 2 - text.width / 2), Math.floor(monitor.height / 2 - text.height / 2));
text.add_style_class_name("hello");
Mainloop.timeout_add(6000, function () { text.destroy(); });
}
// Put your extension initialization code here
function main() {
Main.panel.actor.reactive = true;
Main.panel.actor.connect('button-release-event', _showHello);
}
А вот stylesheet.css:
/* Example stylesheet */
.hello {
font-size: 360px;
font-weight: bold;
color: #ffffff;
background-color: rgba(10,10,10,0.7);
border-radius: 5px;
}
Я не знал, как вообще получить больше информации об этом .... Есть идеи?