[brisk-menu] 01/02: debian/patches: Add 1004_fix_dash_styling_for_some_light_themes.patch. Fix dash styling for some light themes.
Martin Wimpress
flexiondotorg-guest at moszumanska.debian.org
Thu Mar 8 10:36:21 UTC 2018
This is an automated email from the git hooks/post-receive script.
flexiondotorg-guest pushed a commit to branch master
in repository brisk-menu.
commit 8e8dab5aebda1c864471e15249d74f63936a8ba1
Author: Martin Wimpress <martin.wimpress at ubuntu.com>
Date: Thu Mar 8 10:21:09 2018 +0100
debian/patches: Add 1004_fix_dash_styling_for_some_light_themes.patch. Fix dash styling for some light themes.
---
...04_fix_dash_styling_for_some_light_themes.patch | 149 +++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 150 insertions(+)
diff --git a/debian/patches/1004_fix_dash_styling_for_some_light_themes.patch b/debian/patches/1004_fix_dash_styling_for_some_light_themes.patch
new file mode 100644
index 0000000..e84ad50
--- /dev/null
+++ b/debian/patches/1004_fix_dash_styling_for_some_light_themes.patch
@@ -0,0 +1,149 @@
+Author: Stefan Ric <stefan at solus-project.com>
+Description: Fix dash styling for some light themes
+
+diff --git a/data/brisk.gresource.xml b/data/brisk.gresource.xml
+index 0b31f4b..3401dbd 100644
+--- a/data/brisk.gresource.xml
++++ b/data/brisk.gresource.xml
+@@ -3,5 +3,6 @@
+ <gresource prefix="/com/solus-project/brisk/menu">
+ <file>classic/styling.css</file>
+ <file>dash/styling.css</file>
++ <file>dash/styling-light.css</file>
+ </gresource>
+ </gresources>
+diff --git a/data/dash/styling-light.css b/data/dash/styling-light.css
+new file mode 100644
+index 0000000..ac967a1
+--- /dev/null
++++ b/data/dash/styling-light.css
+@@ -0,0 +1,43 @@
++.brisk-button-vertical {
++ padding: 0px;
++ margin: 0px;
++}
++
++.brisk-button {
++ padding: 0px;
++ margin: 0px;
++}
++
++.brisk-dash {
++ background-color: alpha(@dark_bg_color, 0.95);
++}
++
++.brisk-dash .dash-category-button {
++ border: 1px solid transparent;
++ background-color: transparent;
++ font-weight: bold;
++}
++
++.brisk-dash .dash-category-button:checked {
++ background-color: mix(@dark_bg_color, #000000, 0.2);
++ border: 1px solid alpha(@dark_fg_color, 0.1);
++}
++
++.brisk-dash .dash-category-button:hover {
++ background-color: mix(@dark_bg_color, #000000, 0.2);
++ border: 1px solid alpha(#000, 0.2);
++}
++
++.brisk-dash .header {
++ background-color: mix(@dark_bg_color, #000000, 0.1);
++ border-bottom: 1px solid mix(@dark_bg_color, #000000, 0.35);
++ box-shadow: 0px 1px 1px alpha(@dark_fg_color, 0.04);
++}
++
++.brisk-dash .header .section-box-holder {
++ margin: 5px;
++}
++
++scrolledwindow {
++ border: none;
++}
+\ No newline at end of file
+diff --git a/data/dash/styling.css b/data/dash/styling.css
+index 325b208..c3a95df 100644
+--- a/data/dash/styling.css
++++ b/data/dash/styling.css
+@@ -36,4 +36,8 @@
+
+ .brisk-dash .header .section-box-holder {
+ margin: 5px;
++}
++
++scrolledwindow {
++ border: none;
+ }
+\ No newline at end of file
+diff --git a/src/frontend/dash/dash-window.c b/src/frontend/dash/dash-window.c
+index 2d003e5..aa614a6 100644
+--- a/src/frontend/dash/dash-window.c
++++ b/src/frontend/dash/dash-window.c
+@@ -27,7 +27,7 @@ static void brisk_dash_window_associate_category(BriskMenuWindow *self, GtkWidge
+ static void brisk_dash_window_on_toggled(BriskMenuWindow *self, GtkWidget *button);
+ static gboolean brisk_dash_window_on_enter(BriskMenuWindow *self, GdkEventCrossing *event,
+ GtkWidget *button);
+-static void brisk_dash_window_load_css(BriskDashWindow *self);
++static void brisk_dash_window_load_css(GtkSettings *settings, const gchar *key, BriskDashWindow *self);
+ static void brisk_dash_window_key_activate(BriskDashWindow *self, gpointer v);
+ static void brisk_dash_window_activated(BriskMenuWindow *self, GtkFlowBoxChild *row, gpointer v);
+ static void brisk_dash_window_set_filters_enabled(BriskDashWindow *self, gboolean enabled);
+@@ -322,11 +322,17 @@ static void brisk_dash_window_init(BriskDashWindow *self)
+ GdkScreen *screen = NULL;
+ GtkStyleContext *style = NULL;
+ BriskMenuWindow *base = NULL;
++ GtkSettings *gtk_settings = NULL;
+ autofree(gchar) *txt_holder = NULL;
+
+ base = BRISK_MENU_WINDOW(self);
+
+- brisk_dash_window_load_css(self);
++ brisk_dash_window_load_css(gtk_settings, "gtk-theme-name", self);
++ gtk_settings = gtk_settings_get_default();
++ g_signal_connect(gtk_settings,
++ "notify::gtk-theme-name",
++ G_CALLBACK(brisk_dash_window_load_css),
++ self);
+
+ style = gtk_widget_get_style_context(GTK_WIDGET(self));
+ gtk_style_context_add_class(style, BRISK_STYLE_MAIN);
+@@ -525,21 +531,36 @@ static gboolean brisk_dash_window_on_enter(BriskMenuWindow *self,
+ /**
+ * Load up the CSS assets
+ */
+-static void brisk_dash_window_load_css(BriskDashWindow *self)
++static void brisk_dash_window_load_css(GtkSettings *settings, const gchar *key, BriskDashWindow *self)
+ {
+ GtkCssProvider *css = NULL;
++ GtkStyleContext *context = NULL;
+ autofree(GFile) *file = NULL;
+ autofree(GError) *err = NULL;
+ GdkScreen *screen = NULL;
++ GdkRGBA color;
+
+ file = g_file_new_for_uri("resource://com/solus-project/brisk/menu/dash/styling.css");
++
++ context = gtk_widget_get_style_context(GTK_WIDGET(self));
++ if (gtk_style_context_lookup_color(context, "dark_bg_color", &color)) {
++ file = g_file_new_for_uri("resource://com/solus-project/brisk/menu/dash/styling-light.css");
++ }
++
+ if (!file) {
+ return;
+ }
+
++ screen = gtk_widget_get_screen(GTK_WIDGET(self));
++
++ if (self->css) {
++ gtk_style_context_remove_provider_for_screen(screen, GTK_STYLE_PROVIDER(self->css));
++ g_clear_object(&self->css);
++ }
++
+ css = gtk_css_provider_new();
+ self->css = css;
+- screen = gtk_widget_get_screen(GTK_WIDGET(self));
++
+ gtk_style_context_add_provider_for_screen(screen,
+ GTK_STYLE_PROVIDER(css),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
diff --git a/debian/patches/series b/debian/patches/series
index b85d8fd..10daa59 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
1001_build-brisk-glue-early.patch
1002_fix-build-against-old-GLib.patch
1003_dash_launcher.patch
+1004_fix_dash_styling_for_some_light_themes.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mate/brisk-menu.git
More information about the pkg-mate-commits
mailing list