Skip to content

Commit 94238c5

Browse files
committed
feat(ui): load style.css in styles.py (contributed by Aaron Dinesh)
1 parent 960d64f commit 94238c5

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

app/ui/styles.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""CSS styling for the application"""
22

3+
import os
34
import gi
45
gi.require_version("Gtk", "4.0")
56
from gi.repository import Gtk, Gdk
@@ -97,7 +98,13 @@ class StyleManager:
9798
def apply_styles(cls):
9899
"""Apply CSS styles to the application"""
99100
css_provider = Gtk.CssProvider()
100-
css_provider.load_from_data(cls.CSS_STYLES)
101+
102+
home_path = os.path.expanduser("~")
103+
104+
if os.path.exists(f"{home_path}/.config/nmgui/style.css"):
105+
css_provider.load_from_path(f"{home_path}/.config/nmgui/style.css")
106+
else:
107+
css_provider.load_from_data(cls.CSS_STYLES)
101108

102109
display = Gdk.Display.get_default()
103110
Gtk.StyleContext.add_provider_for_display(

0 commit comments

Comments
 (0)