File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -256,8 +256,6 @@ def check_requirements():
256256
257257def setup_resources ():
258258 from gi .repository import Gio
259- from gi .repository import Gtk
260- from gi .repository import Gdk
261259 from gi .repository import GtkSource
262260
263261 resource_filename = meld .conf .APPLICATION_ID + ".gresource"
@@ -282,12 +280,6 @@ def setup_resources():
282280 if not uninstalled :
283281 raise
284282
285- provider = Gtk .CssProvider ()
286- provider .load_from_resource ('/org/gnome/meld/meld.css' )
287- Gtk .StyleContext .add_provider_for_screen (
288- Gdk .Screen .get_default (), provider ,
289- Gtk .STYLE_PROVIDER_PRIORITY_APPLICATION )
290-
291283 style_path = os .path .join (meld .conf .DATADIR , "styles" )
292284 GtkSource .StyleSchemeManager .get_default ().append_search_path (style_path )
293285
Original file line number Diff line number Diff line change @@ -49,6 +49,15 @@ def __init__(self):
4949 Gtk .Window .set_default_icon_name (meld .conf .APPLICATION_ID )
5050 self .set_resource_base_path (meld .conf .RESOURCE_BASE )
5151
52+ provider = Gtk .CssProvider ()
53+ provider .load_from_resource (self .make_resource_path ('meld.css' ))
54+ Gtk .StyleContext .add_provider_for_screen (
55+ Gdk .Screen .get_default (), provider ,
56+ Gtk .STYLE_PROVIDER_PRIORITY_APPLICATION )
57+
58+ def make_resource_path (self , resource_path : str ) -> str :
59+ return f'{ self .props .resource_base_path } /{ resource_path } '
60+
5261 def do_startup (self ):
5362 Gtk .Application .do_startup (self )
5463 meld .accelerators .register_accels (self )
You can’t perform that action at this time.
0 commit comments