📚 docs(explain): every line explained

This commit is contained in:
Abhiraj Roy
2024-06-03 05:15:50 +05:30
parent ddbdac0529
commit c770358b93

View File

@@ -47,12 +47,17 @@ class Main(Gtk.Application):
provider = Gtk.CssProvider.new() provider = Gtk.CssProvider.new()
# creates a new Gio.File object representing the CSS file at the path base_dir + "/snigdhaos-kernel-manager.css" # creates a new Gio.File object representing the CSS file at the path base_dir + "/snigdhaos-kernel-manager.css"
css_file = Gio.file_new_for_path(base_dir + "/snigdhaos-kernel-manager.css") css_file = Gio.file_new_for_path(base_dir + "/snigdhaos-kernel-manager.css")
# loads the CSS styles from the file specified by css_file into the provider
provider.load_from_file(css_file) provider.load_from_file(css_file)
# adds the CSS provider (provider) to the display (display) with a priority of Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
# styles provided by this CSS provider will take precedence over other styles for the application
Gtk.StyleContext.add_provider_for_display( Gtk.StyleContext.add_provider_for_display(
display, display,
provider, provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION,
) )
# makes the window win visible to the user
# typically called after setting up the window and its contents to ensure it appears on the screen
win.present() win.present()
def do_startup(self): def do_startup(self):