From c5fb0d6dce7731e040e5c6f8ae811b0a77c2f0cd Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Wed, 1 Nov 2017 12:14:51 +0000 Subject: [PATCH] Change the look of the toggle button With these changes the button image is removed and you are left with the arrow and frame on the yellow background. This can be dropped or adjusted if it was deemed a good idea. --- gnucash/gnucash-310.css | 2 +- gnucash/gnucash-320.css | 2 +- gnucash/register/register-gnome/gnucash-item-edit.c | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gnucash/gnucash-310.css b/gnucash/gnucash-310.css index e6b218dc5e..76b7232c94 100644 --- a/gnucash/gnucash-310.css +++ b/gnucash/gnucash-310.css @@ -27,7 +27,7 @@ padding: 2px 2px 2px 2px; /* all work with different values, around the text blue area */ } -.cursor .button { +.cursor .toggle-button { margin: 1px 1px 1px 1px; /* does not work, not used, here for completeness */ } diff --git a/gnucash/gnucash-320.css b/gnucash/gnucash-320.css index 4f4ea0942a..51f197c978 100644 --- a/gnucash/gnucash-320.css +++ b/gnucash/gnucash-320.css @@ -18,7 +18,7 @@ cursor entry { padding: 0px 2px 0px 2px; } -cursor button { +cursor toggle-button { margin: 1px 1px 1px 1px; } diff --git a/gnucash/register/register-gnome/gnucash-item-edit.c b/gnucash/register/register-gnome/gnucash-item-edit.c index 41625322cb..acbc32325e 100644 --- a/gnucash/register/register-gnome/gnucash-item-edit.c +++ b/gnucash/register/register-gnome/gnucash-item-edit.c @@ -138,7 +138,8 @@ gnc_item_edit_tb_class_init (GncItemEditTbClass *gnc_item_edit_tb_class) GtkWidgetClass *widget_class; #if GTK_CHECK_VERSION(3,20,0) - gtk_widget_class_set_css_name (GTK_WIDGET_CLASS(gnc_item_edit_tb_class), "button"); +// gtk_widget_class_set_css_name (GTK_WIDGET_CLASS(gnc_item_edit_tb_class), "button"); + gtk_widget_class_set_css_name (GTK_WIDGET_CLASS(gnc_item_edit_tb_class), "toggle-button"); #endif gnc_item_edit_tb_parent_class = g_type_class_peek_parent (gnc_item_edit_tb_class); @@ -200,7 +201,8 @@ gnc_item_edit_tb_new (GnucashSheet *sheet) NULL); // This sets a style class for when Gtk+ version is less than 3.20 - gnc_widget_set_css_name (GTK_WIDGET(item_edit_tb), "button"); +// gnc_widget_set_css_name (GTK_WIDGET(item_edit_tb), "button"); + gnc_widget_set_css_name (GTK_WIDGET(item_edit_tb), "toggle-button"); context = gtk_widget_get_style_context (GTK_WIDGET(item_edit_tb)); gtk_style_context_add_class (context, GTK_STYLE_CLASS_BUTTON); @@ -569,6 +571,9 @@ draw_arrow_cb (GtkWidget *widget, cairo_t *cr, gpointer data) gtk_render_background (context, cr, 0, 0, width, height); + gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME); + gtk_render_frame (context, cr, 1, 1, width - 2, height - 2); + gtk_style_context_add_class (context, GTK_STYLE_CLASS_ARROW); size = MIN(width / 2, height / 2);