[Commits] [SCM] claws branch, master, updated. 3.15.0-188-gde5c37e

mones at claws-mail.org mones at claws-mail.org
Fri Dec 8 18:44:08 CET 2017


The branch, master has been updated
       via  de5c37e2dd35bd5e93b37e57231a034341e2f3a3 (commit)
      from  bdb48c81cffc553513636b06f1609b2508ab1c0d (commit)

Summary of changes:
 src/gtk/gtkutils.h     |    8 +++++---
 src/prefs_msg_colors.c |   41 ++++++++++++++---------------------------
 src/prefs_spelling.c   |    8 +++-----
 3 files changed, 22 insertions(+), 35 deletions(-)


- Log -----------------------------------------------------------------
commit de5c37e2dd35bd5e93b37e57231a034341e2f3a3
Author: Ricardo Mones <ricardo at mones.org>
Date:   Tue Dec 5 01:27:06 2017 +0100

    Color buttons proportional to font size
    
    Instead of hardcoding a size which doesn't look the same on different
    resolutions, use a space;m-space;space label and let GTK+ to compute
    the appropriate button size for current font.

diff --git a/src/gtk/gtkutils.h b/src/gtk/gtkutils.h
index 568e334..57680c4 100644
--- a/src/gtk/gtkutils.h
+++ b/src/gtk/gtkutils.h
@@ -1,6 +1,6 @@
 /*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2013 Hiroyuki Yamamoto and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2017 Hiroyuki Yamamoto and the Claws Mail team
  *
  * 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
@@ -14,7 +14,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
  */
 
 #ifndef __GTKUTILS_H__
@@ -57,6 +56,9 @@
 #define GTKUT_CTREE_REFRESH(clist) \
 	GTK_CMCLIST_GET_CLASS(clist)->refresh(clist)
 
+#define GTKUT_COLOR_BUTTON() \
+	gtk_button_new_with_label("\x20\xE2\x80\x83\x20")
+
 gboolean gtkut_get_font_size		(GtkWidget	*widget,
 					 gint		*width,
 					 gint		*height);
diff --git a/src/prefs_msg_colors.c b/src/prefs_msg_colors.c
index 13ba614..4b56eb0 100644
--- a/src/prefs_msg_colors.c
+++ b/src/prefs_msg_colors.c
@@ -1,6 +1,6 @@
 /*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2004-2012 Hiroyuki Yamamoto & The Claws Mail Team
+ * Claws-Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2004-2017 Hiroyuki Yamamoto & The Claws Mail Team
  *
  * 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
@@ -14,7 +14,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
  */
 
 #ifdef HAVE_CONFIG_H
@@ -193,9 +192,8 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 			    FALSE, FALSE, 0);
 	SET_TOGGLE_SENSITIVITY(checkbtn_enable_colors, label_quote_color1);
 		
-	color_buttons.btn_quote_level1 = gtk_button_new();
+	color_buttons.btn_quote_level1 = GTKUT_COLOR_BUTTON();
 	gtk_widget_show(color_buttons.btn_quote_level1);
-	gtk_widget_set_size_request (color_buttons.btn_quote_level1, 30, 20);
   	gtk_box_pack_end (GTK_BOX(hbox), color_buttons.btn_quote_level1, 
 			    FALSE, FALSE, 0);
 	SET_TOGGLE_SENSITIVITY(checkbtn_enable_colors, color_buttons.btn_quote_level1);
@@ -219,9 +217,8 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 			    FALSE, FALSE, 0);
 	SET_TOGGLE_SENSITIVITY(checkbtn_enable_colors, label_quote_color2);
 
-	color_buttons.btn_quote_level2 = gtk_button_new();
+	color_buttons.btn_quote_level2 = GTKUT_COLOR_BUTTON();
 	gtk_widget_show(color_buttons.btn_quote_level2);
-	gtk_widget_set_size_request (color_buttons.btn_quote_level2, 30, 20);
   	gtk_box_pack_end (GTK_BOX(hbox), color_buttons.btn_quote_level2, 
 			    FALSE, FALSE, 0);
 	SET_TOGGLE_SENSITIVITY(checkbtn_enable_colors, color_buttons.btn_quote_level2);
@@ -245,9 +242,8 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 			    FALSE, FALSE, 0);
 	SET_TOGGLE_SENSITIVITY(checkbtn_enable_colors, label_quote_color3);
 
-	color_buttons.btn_quote_level3 = gtk_button_new();
+	color_buttons.btn_quote_level3 = GTKUT_COLOR_BUTTON();
 	gtk_widget_show(color_buttons.btn_quote_level3);
-	gtk_widget_set_size_request (color_buttons.btn_quote_level3, 30, 20);
   	gtk_box_pack_end (GTK_BOX(hbox), color_buttons.btn_quote_level3, 
 			    FALSE, FALSE, 0);
 	SET_TOGGLE_SENSITIVITY(checkbtn_enable_colors, color_buttons.btn_quote_level3);
@@ -268,9 +264,8 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 	SET_TOGGLE_SENSITIVITY(checkbtn_enable_colors, hbox);
 	gtk_box_pack_start (GTK_BOX (vbox_quotebg), hbox, FALSE, TRUE, 0);
 	
-	color_buttons.btn_quote_level1_bg = gtk_button_new();
+	color_buttons.btn_quote_level1_bg = GTKUT_COLOR_BUTTON();
 	gtk_widget_show(color_buttons.btn_quote_level1_bg);
-	gtk_widget_set_size_request (color_buttons.btn_quote_level1_bg, 30, 20);
   	gtk_box_pack_start (GTK_BOX(hbox), color_buttons.btn_quote_level1_bg, 
 			    FALSE, FALSE, 0);
 	SET_TOGGLE_SENSITIVITY(checkbtn_enable_bgcolors, color_buttons.btn_quote_level1_bg);
@@ -289,9 +284,8 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 	SET_TOGGLE_SENSITIVITY(checkbtn_enable_colors, hbox);
 	gtk_box_pack_start (GTK_BOX (vbox_quotebg), hbox, FALSE, TRUE, 0);
 	
-	color_buttons.btn_quote_level2_bg = gtk_button_new();
+	color_buttons.btn_quote_level2_bg = GTKUT_COLOR_BUTTON();
 	gtk_widget_show(color_buttons.btn_quote_level2_bg);
-	gtk_widget_set_size_request (color_buttons.btn_quote_level2_bg, 30, 20);
   	gtk_box_pack_start (GTK_BOX(hbox), color_buttons.btn_quote_level2_bg, 
 			    FALSE, FALSE, 0);
 	SET_TOGGLE_SENSITIVITY(checkbtn_enable_bgcolors, color_buttons.btn_quote_level2_bg);
@@ -310,9 +304,8 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 	SET_TOGGLE_SENSITIVITY(checkbtn_enable_colors, hbox);
 	gtk_box_pack_start (GTK_BOX (vbox_quotebg), hbox, FALSE, TRUE, 0);
 	
-	color_buttons.btn_quote_level3_bg = gtk_button_new();
+	color_buttons.btn_quote_level3_bg = GTKUT_COLOR_BUTTON();
 	gtk_widget_show(color_buttons.btn_quote_level3_bg);
-	gtk_widget_set_size_request (color_buttons.btn_quote_level3_bg, 30, 20);
   	gtk_box_pack_start (GTK_BOX(hbox), color_buttons.btn_quote_level3_bg, 
 			    FALSE, FALSE, 0);
 	SET_TOGGLE_SENSITIVITY(checkbtn_enable_bgcolors, color_buttons.btn_quote_level3_bg);
@@ -330,9 +323,8 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 	gtk_widget_show (hbox);
 	gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
 
-	color_buttons.btn_uri = gtk_button_new();
+	color_buttons.btn_uri = GTKUT_COLOR_BUTTON();
 	gtk_widget_show(color_buttons.btn_uri);
-	gtk_widget_set_size_request (color_buttons.btn_uri, 30, 20);
   	gtk_box_pack_start (GTK_BOX(hbox), color_buttons.btn_uri, 
 			    FALSE, FALSE, 0);
 	SET_TOGGLE_SENSITIVITY(checkbtn_enable_colors, color_buttons.btn_uri);
@@ -349,9 +341,8 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 	gtk_widget_show (hbox);
 	gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
 
-	color_buttons.btn_signature = gtk_button_new();
+	color_buttons.btn_signature = GTKUT_COLOR_BUTTON();
 	gtk_widget_show(color_buttons.btn_signature);
-	gtk_widget_set_size_request (color_buttons.btn_signature, 30, 20);
   	gtk_box_pack_start (GTK_BOX(hbox), color_buttons.btn_signature, 
 			    FALSE, FALSE, 0);
 	SET_TOGGLE_SENSITIVITY(checkbtn_enable_colors, color_buttons.btn_signature);
@@ -370,9 +361,8 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 	gtk_widget_show (hbox);
 	gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
 
-	color_buttons.btn_tgt_folder = gtk_button_new();
+	color_buttons.btn_tgt_folder = GTKUT_COLOR_BUTTON();
 	gtk_widget_show(color_buttons.btn_tgt_folder);
-	gtk_widget_set_size_request (color_buttons.btn_tgt_folder, 30, 20);
   	gtk_box_pack_start (GTK_BOX(hbox), color_buttons.btn_tgt_folder, 
 			    FALSE, FALSE, 0);
 
@@ -389,9 +379,8 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 	gtk_widget_show (hbox);
 	gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
 
-	color_buttons.btn_color_new = gtk_button_new();
+	color_buttons.btn_color_new = GTKUT_COLOR_BUTTON();
 	gtk_widget_show (color_buttons.btn_color_new);
-	gtk_widget_set_size_request (color_buttons.btn_color_new, 30, 20);
   	gtk_box_pack_start (GTK_BOX(hbox), color_buttons.btn_color_new,
 			    FALSE, FALSE, 0);
 
@@ -436,9 +425,8 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 		gtk_box_pack_start(GTK_BOX (vbox_custom_colors1), hbox_custom_color[c],
 				   FALSE, TRUE, 0);
 
-		color_buttons.custom_color[c] = gtk_button_new();
+		color_buttons.custom_color[c] = GTKUT_COLOR_BUTTON();
 		gtk_widget_show(color_buttons.custom_color[c]);
-		gtk_widget_set_size_request(color_buttons.custom_color[c], 30, 20);
   		gtk_box_pack_start(GTK_BOX (hbox_custom_color[c]), color_buttons.custom_color[c],
 				   FALSE, FALSE, 0);
 
@@ -469,9 +457,8 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 		gtk_box_pack_start(GTK_BOX (vbox_custom_colors2), hbox_custom_color[c],
 				   FALSE, TRUE, 0);
 
-		color_buttons.custom_color[c] = gtk_button_new();
+		color_buttons.custom_color[c] = GTKUT_COLOR_BUTTON();
 		gtk_widget_show(color_buttons.custom_color[c]);
-		gtk_widget_set_size_request(color_buttons.custom_color[c], 30, 20);
   		gtk_box_pack_start(GTK_BOX (hbox_custom_color[c]), color_buttons.custom_color[c],
 				   FALSE, FALSE, 0);
 		CLAWS_SET_TIP(color_buttons.custom_color[c],
diff --git a/src/prefs_spelling.c b/src/prefs_spelling.c
index 3ad02b4..09cc94c 100644
--- a/src/prefs_spelling.c
+++ b/src/prefs_spelling.c
@@ -1,6 +1,6 @@
 /*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2002-2012 Hiroyuki Yamamoto & the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2002-2017 Hiroyuki Yamamoto & the Claws Mail team
  *
  * 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
@@ -14,7 +14,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
  */
 
 #ifdef HAVE_CONFIG_H
@@ -209,11 +208,10 @@ static void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gp
 	gtk_label_set_justify(GTK_LABEL(misspelled_label), GTK_JUSTIFY_RIGHT);
 	gtk_misc_set_alignment(GTK_MISC(misspelled_label), 1, 0.5);
 
-	misspelled_colorbtn = gtk_button_new_with_label("");
+	misspelled_colorbtn = GTKUT_COLOR_BUTTON();
 	gtk_widget_show(misspelled_colorbtn);
 	gtk_box_pack_start(GTK_BOX(misspelled_hbox), misspelled_colorbtn,
 		FALSE, FALSE, 0);
-	gtk_widget_set_size_request(misspelled_colorbtn, 30, 20);
 	CLAWS_SET_TIP(misspelled_colorbtn,
 			     _("Pick color for misspelled word. "
 			       "Use black to underline"));

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list