fixed style path problem
This commit is contained in:
+24
-23
@@ -1,24 +1,25 @@
|
||||
{
|
||||
"default_locale": "en",
|
||||
"autostart_path": "~/.config/autostart/manjaro-hello.desktop",
|
||||
"data_path": "/usr/share/manjaro-hello/data/",
|
||||
"desktop_path": "/usr/share/applications/manjaro-hello.desktop",
|
||||
"installer_path": "/usr/bin/calamares",
|
||||
"live_path": "/run/miso/bootmnt/manjaro",
|
||||
"locale_path": "/usr/share/locale/",
|
||||
"logo_path": "/usr/share/icons/hicolor/64x64/apps/manjaro.png",
|
||||
"save_path": "~/.config/manjaro-hello.json",
|
||||
"ui_path": "/usr/share/manjaro-hello/ui/manjaro-hello.glade",
|
||||
"urls": {
|
||||
"development": "https://gitlab.manjaro.org",
|
||||
"discover": "https://discover.manjaro.org/",
|
||||
"donate": "https://manjaro.org/donate",
|
||||
"facebook": "https://www.facebook.com/ManjaroLinux",
|
||||
"forum": "https://forum.manjaro.org",
|
||||
"telegram": "https://t.me/manjaro_official",
|
||||
"mailling": "https://lists.manjaro.org/cgi-bin/mailman/listinfo",
|
||||
"reddit": "https://www.reddit.com/r/ManjaroLinux",
|
||||
"twitter": "https://twitter.com/ManjaroLinux",
|
||||
"wiki": "https://wiki.manjaro.org"
|
||||
}
|
||||
}
|
||||
"default_locale": "en",
|
||||
"autostart_path": "~/.config/autostart/manjaro-hello.desktop",
|
||||
"data_path": "/usr/share/manjaro-hello/data/",
|
||||
"desktop_path": "/usr/share/applications/manjaro-hello.desktop",
|
||||
"installer_path": "/usr/bin/calamares",
|
||||
"live_path": "/run/miso/bootmnt/manjaro",
|
||||
"locale_path": "/usr/share/locale/",
|
||||
"logo_path": "/usr/share/icons/hicolor/64x64/apps/manjaro.png",
|
||||
"save_path": "~/.config/manjaro-hello.json",
|
||||
"ui_path": "/usr/share/manjaro-hello/ui/manjaro-hello.glade",
|
||||
"style_path": "/usr/share/manjaro-hello/ui/style.css",
|
||||
"urls": {
|
||||
"development": "https://gitlab.manjaro.org",
|
||||
"discover": "https://discover.manjaro.org/",
|
||||
"donate": "https://manjaro.org/donate",
|
||||
"facebook": "https://www.facebook.com/ManjaroLinux",
|
||||
"forum": "https://forum.manjaro.org",
|
||||
"telegram": "https://t.me/manjaro_official",
|
||||
"mailling": "https://lists.manjaro.org/cgi-bin/mailman/listinfo",
|
||||
"reddit": "https://www.reddit.com/r/ManjaroLinux",
|
||||
"twitter": "https://twitter.com/ManjaroLinux",
|
||||
"wiki": "https://wiki.manjaro.org"
|
||||
}
|
||||
}
|
||||
@@ -99,9 +99,6 @@ class Hello(Gtk.Window):
|
||||
self.app = "manjaro-hello"
|
||||
self.dev = "--dev" in sys.argv # Dev mode activated ?
|
||||
screen = Gdk.Screen.get_default()
|
||||
provider = Gtk.CssProvider()
|
||||
provider.load_from_path(os.path.abspath("src/style.css"))
|
||||
Gtk.StyleContext.add_provider_for_screen(screen, provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
|
||||
|
||||
# Load preferences
|
||||
if self.dev:
|
||||
@@ -110,6 +107,7 @@ class Hello(Gtk.Window):
|
||||
self.preferences["desktop_path"] = os.getcwd() + f"/{self.app}.desktop"
|
||||
self.preferences["locale_path"] = "locale/"
|
||||
self.preferences["ui_path"] = f"ui/{self.app}.glade"
|
||||
self.preferences["style_path"] = f"ui/style.css"
|
||||
else:
|
||||
self.preferences = read_json(f"/usr/share/{self.app}/data/preferences.json")
|
||||
# Get saved infos
|
||||
@@ -117,6 +115,11 @@ class Hello(Gtk.Window):
|
||||
if not self.save:
|
||||
self.save = {"locale": None}
|
||||
|
||||
# Import Css
|
||||
provider = Gtk.CssProvider()
|
||||
provider.load_from_path(self.preferences["style_path"])
|
||||
Gtk.StyleContext.add_provider_for_screen(screen, provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
|
||||
|
||||
# Init window
|
||||
self.builder = Gtk.Builder.new_from_file(self.preferences["ui_path"])
|
||||
self.builder.connect_signals(self)
|
||||
|
||||
Reference in New Issue
Block a user