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