diff --git a/src/Application.vala b/src/Application.vala index 95b2bd9..938a4b3 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -54,19 +54,10 @@ public class MyApp : Gtk.Application { settings.bind ("window-maximized", main_window, "maximized", SettingsBindFlags.SET); - // Use Css - var provider = new Gtk.CssProvider (); - provider.load_from_resource ("/io/github/yourusername/yourrepositoryname/Application.css"); - - Gtk.StyleContext.add_provider_for_display ( - Gdk.Display.get_default (), - provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION - ); - main_window.present (); } public static int main (string[] args) { return new MyApp ().run (args); } -} \ No newline at end of file +} diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 1081aa2..5d2a9aa 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -20,6 +20,10 @@ public class MainWindow : Gtk.ApplicationWindow { } construct { + var provider = new Gtk.CssProvider (); + provider.load_from_resource ("/io/github/yourusername/yourrepositoryname/Application.css"); + add_css_class (provider.to_string()); + var start_header = new Gtk.HeaderBar () { show_title_buttons = false, title_widget = new Gtk.Label ("") @@ -64,4 +68,4 @@ public class MainWindow : Gtk.ApplicationWindow { gtk_settings.gtk_theme_name = "io.elementary.stylesheet.blueberry"; } } -} \ No newline at end of file +}