diff --git a/examples/example-window.ui b/examples/example-window.ui index 17f17924aa195dabd4a46f29ed878496007a3919..050c07e741e2a5dbd4a575ad113362390032d88e 100644 --- a/examples/example-window.ui +++ b/examples/example-window.ui @@ -31,34 +31,25 @@ slide - + True False - False - horizontal - - - True - False - True - Handy Widget Factory - - - - - True - False - vertical - - - end - - + Handy Widget Factory sidebar + + + True + False + vertical + + + True @@ -114,6 +105,16 @@ sidebar + + + True + False + vertical + + + True @@ -612,7 +613,7 @@ horizontal - + diff --git a/examples/example.c b/examples/example.c index 54c2d0ba3ae62fdfe3f9e3de8234627bb2024a44..a7cb329337da3f787940ce6b5f26ff63aa7b6227 100644 --- a/examples/example.c +++ b/examples/example.c @@ -4,6 +4,19 @@ #include "example-window.h" +static void +startup (GtkApplication *app) +{ + GtkCssProvider *css_provider = gtk_css_provider_new (); + + gtk_css_provider_load_from_resource (css_provider, "/sm/puri/handy/example/ui/style.css"); + gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), + GTK_STYLE_PROVIDER (css_provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + + g_object_unref (css_provider); +} + static void show_window (GtkApplication *app) { @@ -22,6 +35,7 @@ main (int argc, int status; app = gtk_application_new ("sm.puri.Handy.Example", G_APPLICATION_FLAGS_NONE); + g_signal_connect (app, "startup", G_CALLBACK (startup), NULL); g_signal_connect (app, "activate", G_CALLBACK (show_window), NULL); status = g_application_run (G_APPLICATION (app), argc, argv); g_object_unref (app); diff --git a/examples/example.gresources.xml b/examples/example.gresources.xml index 017d0d771b3b11a4217e83ad072e1ccb75793115..d8517867e2be236b887001468e445caeae31335b 100644 --- a/examples/example.gresources.xml +++ b/examples/example.gresources.xml @@ -2,5 +2,6 @@ example-window.ui + style.css diff --git a/examples/style.css b/examples/style.css new file mode 100644 index 0000000000000000000000000000000000000000..6c244f39baa24706c2ab0854243f4e99542de2be --- /dev/null +++ b/examples/style.css @@ -0,0 +1,23 @@ +stacksidebar * { + border-left-width: 0px; + border-right-width: 0px; +} + +/* Needed for seaprators to look good. These have been submitted upstream here: + * https://gitlab.gnome.org/GNOME/gtk/merge_requests/323 + */ + +separator.sidebar { + background-color: @borders; + border-style: none; + margin: 0px 0px 0px 0px; +} + +separator.sidebar:backdrop { + background-color: @unfocused_borders; +} + +separator.sidebar.selection-mode, +.selection-mode separator.sidebar { + background-color: mix(@theme_selected_bg_color, #000, 0.2); +}