From 860d7dd7866cf2bd29297a366352a6afc4fd65d9 Mon Sep 17 00:00:00 2001
From: Mason Hock <mason@masonhock.com>
Date: Wed, 11 Sep 2019 19:02:34 -0700
Subject: [PATCH] customize brisk menu for trisquel

---
 .../trisquel-style-session-buttons.patch      | 101 ++++++++++++++++++
 helpers/make-mate-applet-brisk-menu           |  34 ++++++
 2 files changed, 135 insertions(+)
 create mode 100644 helpers/DATA/mate-applet-brisk-menu/trisquel-style-session-buttons.patch
 create mode 100644 helpers/make-mate-applet-brisk-menu

diff --git a/helpers/DATA/mate-applet-brisk-menu/trisquel-style-session-buttons.patch b/helpers/DATA/mate-applet-brisk-menu/trisquel-style-session-buttons.patch
new file mode 100644
index 00000000..e961ab4d
--- /dev/null
+++ b/helpers/DATA/mate-applet-brisk-menu/trisquel-style-session-buttons.patch
@@ -0,0 +1,101 @@
+diff --git a/src/frontend/classic/classic-window.c b/src/frontend/classic/classic-window.c
+index 9fd6b2b..3c316c0 100644
+--- a/src/frontend/classic/classic-window.c
++++ b/src/frontend/classic/classic-window.c
+@@ -640,52 +640,63 @@ static void brisk_classic_window_setup_session_controls(BriskClassicWindow *self
+ {
+         GtkWidget *widget = NULL;
+         GtkWidget *box = NULL;
+-        GtkStyleContext *style = NULL;
++        GtkWidget *button = NULL;
++        GtkWidget *image = NULL;
++        GtkWidget *label = NULL;
+ 
+-        box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++        box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+         gtk_widget_set_margin_bottom(box, 4);
+ 
+-        gtk_box_pack_end(GTK_BOX(self->sidebar_wrap), box, FALSE, FALSE, 0);
+-        gtk_widget_set_halign(box, GTK_ALIGN_CENTER);
++        gtk_box_pack_end(GTK_BOX(self->sidebar_wrap), box, TRUE, TRUE, 0);
+ 
+         /* Add a separator for visual consistency */
+         widget = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
+         gtk_box_pack_end(GTK_BOX(self->sidebar_wrap), widget, FALSE, FALSE, 3);
+ 
+-        /* Logout */
+-        widget = gtk_button_new_from_icon_name("brisk_system-log-out-symbolic", GTK_ICON_SIZE_MENU);
+-        self->button_logout = widget;
+-        g_signal_connect_swapped(widget, "clicked", G_CALLBACK(brisk_menu_window_logout), self);
+-        gtk_widget_set_tooltip_text(widget, _("End the current session"));
+-        gtk_widget_set_can_focus(widget, FALSE);
+-        gtk_container_add(GTK_CONTAINER(box), widget);
+-        style = gtk_widget_get_style_context(widget);
+-        gtk_style_context_add_class(style, GTK_STYLE_CLASS_FLAT);
+-        gtk_style_context_add_class (style, "session-button");
+-
+         /* Lock */
+-        widget = gtk_button_new_from_icon_name("system-lock-screen-symbolic",
+-                                               GTK_ICON_SIZE_SMALL_TOOLBAR);
+-        self->button_lock = widget;
+-        g_signal_connect_swapped(widget, "clicked", G_CALLBACK(brisk_menu_window_lock), self);
++	button = gtk_button_new();
++	widget = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++	image = gtk_image_new_from_icon_name("system-lock-screen", GTK_ICON_SIZE_MENU);
++	gtk_box_pack_start(GTK_BOX(widget), image, FALSE, FALSE, 0);
++	label = gtk_label_new("Log Out");
++	gtk_box_pack_start(GTK_BOX(widget), label, FALSE, FALSE, 0);
++        gtk_container_add(GTK_CONTAINER(button), widget);
++        self->button_logout = button;
++        g_signal_connect_swapped(button, "clicked", G_CALLBACK(brisk_menu_window_lock), self);
+         gtk_widget_set_tooltip_text(widget, _("Lock the screen"));
+-        gtk_widget_set_can_focus(widget, FALSE);
+-        gtk_container_add(GTK_CONTAINER(box), widget);
+-        style = gtk_widget_get_style_context(widget);
+-        gtk_style_context_add_class(style, GTK_STYLE_CLASS_FLAT);
+-        gtk_style_context_add_class (style, "session-button");
++        gtk_container_add(GTK_CONTAINER(box), button);
++	gtk_button_set_relief(button, GTK_RELIEF_NONE);
++	gtk_widget_set_margin_end(image, 7);
++
++        /* Logout */
++	button = gtk_button_new();
++	widget = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++	image = gtk_image_new_from_icon_name("application-exit", GTK_ICON_SIZE_MENU);
++	gtk_box_pack_start(GTK_BOX(widget), image, FALSE, FALSE, 0);
++	label = gtk_label_new("Lock Screen");
++	gtk_box_pack_start(GTK_BOX(widget), label, FALSE, FALSE, 0);
++        gtk_container_add(GTK_CONTAINER(button), widget);
++        self->button_logout = button;
++        g_signal_connect_swapped(button, "clicked", G_CALLBACK(brisk_menu_window_logout), self);
++        gtk_widget_set_tooltip_text(widget, _("End the current session"));
++        gtk_container_add(GTK_CONTAINER(box), button);
++	gtk_button_set_relief(button, GTK_RELIEF_NONE);
++	gtk_widget_set_margin_end(image, 7);
+ 
+         /* Shutdown */
+-        widget =
+-            gtk_button_new_from_icon_name("system-shutdown-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR);
+-        self->button_shutdown = widget;
+-        g_signal_connect_swapped(widget, "clicked", G_CALLBACK(brisk_menu_window_shutdown), self);
++	button = gtk_button_new();
++	widget = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++	image = gtk_image_new_from_icon_name("system-shutdown", GTK_ICON_SIZE_MENU);
++	gtk_box_pack_start(GTK_BOX(widget), image, FALSE, FALSE, 0);
++	label = gtk_label_new("Power Off");
++	gtk_box_pack_start(GTK_BOX(widget), label, FALSE, FALSE, 0);
++        gtk_container_add(GTK_CONTAINER(button), widget);
++        self->button_logout = button;
++        g_signal_connect_swapped(button, "clicked", G_CALLBACK(brisk_menu_window_shutdown), self);
+         gtk_widget_set_tooltip_text(widget, _("Turn off the device"));
+-        gtk_widget_set_can_focus(widget, FALSE);
+-        gtk_container_add(GTK_CONTAINER(box), widget);
+-        style = gtk_widget_get_style_context(widget);
+-        gtk_style_context_add_class(style, GTK_STYLE_CLASS_FLAT);
+-        gtk_style_context_add_class (style, "session-button");
++        gtk_container_add(GTK_CONTAINER(box), button);
++	gtk_button_set_relief(button, GTK_RELIEF_NONE);
++	gtk_widget_set_margin_end(image, 7);
+ }
+ 
+ /**
diff --git a/helpers/make-mate-applet-brisk-menu b/helpers/make-mate-applet-brisk-menu
new file mode 100644
index 00000000..ffc60c46
--- /dev/null
+++ b/helpers/make-mate-applet-brisk-menu
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+#    Copyright (C) 2019 Mason Hock <mason@masonhock.com>
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program; if not, write to the Free Software
+#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+
+VERSION=1
+
+. ./config
+
+cp $DATA/trisquel-style-session-buttons.patch debian/patches/
+echo "trisquel-style-session-buttons.patch" >> debian/patches/series
+
+sed '/dark-theme/{N;s/false/true/}' -i data/com.solus-project.brisk-menu.gschema.xml
+sed '/label-visible/{N;s/true/false/}' -i data/com.solus-project.brisk-menu.gschema.xml
+sed "/pinned-shortcuts/{N;s/'matecc.desktop'/'gnome-app-install.desktop', 'matecc.desktop'/}" -i data/com.solus-project.brisk-menu.gschema.xml
+sed '/search-position/{N;s/top/bottom/}' -i data/com.solus-project.brisk-menu.gschema.xml
+
+changelog "Customized for Trisquel"
+
+compile
-- 
GitLab