[Commits] mainwindow.c 1.274.2.356 1.274.2.357 prefs_common.c 1.204.2.213 1.204.2.214 prefs_common.h 1.103.2.142 1.103.2.143
colin at claws-mail.org
colin at claws-mail.org
Tue Nov 27 11:12:14 CET 2012
Update of /home/claws-mail/claws/src
In directory srv:/tmp/cvs-serv27902/src
Modified Files:
Tag: gtk2
mainwindow.c prefs_common.c prefs_common.h
Log Message:
2012-11-27 [colin] 3.9.0cvs22
* src/mainwindow.c
* src/prefs_common.c
* src/prefs_common.h
Unsneak a work-in-progress patch that I mistakengly
commited with a cleanup
Index: mainwindow.c
===================================================================
RCS file: /home/claws-mail/claws/src/mainwindow.c,v
retrieving revision 1.274.2.356
retrieving revision 1.274.2.357
diff -u -d -r1.274.2.356 -r1.274.2.357
--- mainwindow.c 23 Nov 2012 19:29:15 -0000 1.274.2.356
+++ mainwindow.c 27 Nov 2012 10:12:11 -0000 1.274.2.357
@@ -274,10 +274,6 @@
static void attract_by_subject_cb(GtkAction *action,
gpointer data);
-static void zoom_in_cb (GtkAction *action,
- gpointer data);
-static void zoom_out_cb (GtkAction *action,
- gpointer data);
static void delete_duplicated_cb (GtkAction *action,
gpointer data);
static void delete_duplicated_all_cb (GtkAction *action,
@@ -551,9 +547,6 @@
{"View/SetColumns/Folderlist", NULL, N_("In _folder list..."), NULL, NULL, G_CALLBACK(set_folder_display_item_cb) },
{"View/SetColumns/Messagelist", NULL, N_("In _message list..."), NULL, NULL, G_CALLBACK(set_summary_display_item_cb) },
{"View/---", NULL, "---" },
- {"View/Zoom", NULL, N_("_Zoom") },
- {"View/Zoom/In", NULL, N_("_In"), "<control>plus", NULL, G_CALLBACK(zoom_in_cb) },
- {"View/Zoom/Out", NULL, N_("_Out"), "<control>minus", NULL, G_CALLBACK(zoom_out_cb) },
#ifndef GENERIC_UMPC
@@ -1357,25 +1350,6 @@
gtk_widget_show(mainwin->warning_btn);
}
-static void main_window_zoom(ZoomType type)
-{
- static gboolean zooming = FALSE;
-
- if (zooming)
- return;
- zooming = TRUE;
-
- prefs_common_zoom_font(&prefs_common.textfont, type);
- prefs_common_zoom_font(&prefs_common.printfont, type);
- prefs_common_zoom_font(&prefs_common.boldfont, type);
- prefs_common_zoom_font(&prefs_common.normalfont, type);
- prefs_common_zoom_font(&prefs_common.smallfont, type);
-
- main_window_reflect_prefs_all();
-
- zooming = FALSE;
-}
-
void mainwindow_clear_error(MainWindow *mainwin)
{
gtk_widget_hide(mainwin->warning_btn);
@@ -1433,12 +1407,50 @@
break;
case GDK_KEY_F7:
{
- main_window_zoom(ZOOM_IN);
+ PangoFontDescription *font_desc;
+ int size;
+ font_desc = pango_font_description_from_string(prefs_common.normalfont);
+ size = pango_font_description_get_size(font_desc)/PANGO_SCALE;
+ if (size < 30) {
+ size++; pango_font_description_set_size(font_desc, size*PANGO_SCALE);
+ g_free(prefs_common.normalfont);
+ prefs_common.normalfont = pango_font_description_to_string(font_desc);
+ main_window_reflect_prefs_all();
+ }
+ pango_font_description_free(font_desc);
+ font_desc = pango_font_description_from_string(prefs_common.textfont);
+ size = pango_font_description_get_size(font_desc)/PANGO_SCALE;
+ if (size < 30) {
+ size++; pango_font_description_set_size(font_desc, size*PANGO_SCALE);
+ g_free(prefs_common.textfont);
+ prefs_common.textfont = pango_font_description_to_string(font_desc);
+ main_window_reflect_prefs_all();
+ }
+ pango_font_description_free(font_desc);
}
break;
case GDK_KEY_F8:
{
- main_window_zoom(ZOOM_OUT);
+ PangoFontDescription *font_desc;
+ int size;
+ font_desc = pango_font_description_from_string(prefs_common.normalfont);
+ size = pango_font_description_get_size(font_desc)/PANGO_SCALE;
+ if (size > 5) {
+ size--; pango_font_description_set_size(font_desc, size*PANGO_SCALE);
+ g_free(prefs_common.normalfont);
+ prefs_common.normalfont = pango_font_description_to_string(font_desc);
+ main_window_reflect_prefs_all();
+ }
+ pango_font_description_free(font_desc);
+ font_desc = pango_font_description_from_string(prefs_common.textfont);
+ size = pango_font_description_get_size(font_desc)/PANGO_SCALE;
+ if (size > 5) {
+ size--; pango_font_description_set_size(font_desc, size*PANGO_SCALE);
+ g_free(prefs_common.textfont);
+ prefs_common.textfont = pango_font_description_to_string(font_desc);
+ main_window_reflect_prefs_all();
+ }
+ pango_font_description_free(font_desc);
}
break;
case GDK_KEY_Escape:
@@ -1707,11 +1719,6 @@
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "SetColumns", "View/SetColumns", GTK_UI_MANAGER_MENU)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/SetColumns", "Folderlist", "View/SetColumns/Folderlist", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/SetColumns", "Messagelist", "View/SetColumns/Messagelist", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Separator0", "View/---", GTK_UI_MANAGER_SEPARATOR)
-
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Zoom", "View/Zoom", GTK_UI_MANAGER_MENU)
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Zoom", "In", "View/Zoom/In", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Zoom", "Out", "View/Zoom/Out", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Separator1", "View/---", GTK_UI_MANAGER_SEPARATOR)
#ifndef MAEMO
@@ -4697,16 +4704,6 @@
summary_collapse_threads(mainwin->summaryview);
}
-static void zoom_in_cb(GtkAction *action, gpointer data)
-{
- main_window_zoom(ZOOM_IN);
-}
-
-static void zoom_out_cb(GtkAction *action, gpointer data)
-{
- main_window_zoom(ZOOM_OUT);
-}
-
static void set_summary_display_item_cb(GtkAction *action, gpointer data)
{
prefs_summary_column_open();
Index: prefs_common.c
===================================================================
RCS file: /home/claws-mail/claws/src/prefs_common.c,v
retrieving revision 1.204.2.213
retrieving revision 1.204.2.214
diff -u -d -r1.204.2.213 -r1.204.2.214
--- prefs_common.c 23 Nov 2012 19:29:15 -0000 1.204.2.213
+++ prefs_common.c 27 Nov 2012 10:12:11 -0000 1.204.2.214
@@ -95,6 +95,8 @@
&prefs_common.newmail_notify_cmd, P_STRING, NULL, NULL, NULL},
/* new fonts */
+ {"widget_font_gtk2", NULL,
+ &prefs_common.widgetfont, P_STRING, NULL, NULL, NULL},
{"message_font_gtk2", "Monospace 9",
&prefs_common.textfont, P_STRING, NULL, NULL, NULL},
{"print_font_gtk2", "Monospace 9",
@@ -315,6 +317,8 @@
/* Display */
/* Obsolete fonts. For coexisting with Gtk+-1.2 version */
+ {"widget_font", NULL,
+ &prefs_common.widgetfont_gtk1, P_STRING, NULL, NULL, NULL},
{"message_font", "-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*",
&prefs_common.textfont_gtk1, P_STRING, NULL, NULL, NULL},
{"small_font", "-*-helvetica-medium-r-normal--10-*-*-*-*-*-*-*",
@@ -326,6 +330,8 @@
/* new fonts */
#ifndef GENERIC_UMPC
+ {"widget_font_gtk2", NULL,
+ &SPECIFIC_PREFS.widgetfont, P_STRING, NULL, NULL, NULL},
{"message_font_gtk2", "Monospace 9",
&SPECIFIC_PREFS.textfont, P_STRING, NULL, NULL, NULL},
{"print_font_gtk2", "Monospace 9",
@@ -337,6 +343,8 @@
{"bold_font_gtk2", "Sans Bold 9",
&SPECIFIC_PREFS.boldfont, P_STRING, NULL, NULL, NULL},
#else
+ {"widget_font_gtk2", NULL,
+ &SPECIFIC_PREFS.widgetfont, P_STRING, NULL, NULL, NULL},
{"message_font_gtk2", "Monospace 8",
&SPECIFIC_PREFS.textfont, P_STRING, NULL, NULL, NULL},
{"print_font_gtk2", "Monospace 8",
@@ -1624,26 +1632,3 @@
{
return &prefs_common;
}
-
-void prefs_common_zoom_font(gchar **font, ZoomType type)
-{
- PangoFontDescription *font_desc;
- int size;
-
- if (font == NULL || *font == '\0')
- return;
-
- font_desc = pango_font_description_from_string(*font);
- size = pango_font_description_get_size(font_desc)/PANGO_SCALE;
-
- if (type == ZOOM_IN && size < 30)
- size++;
- if (type == ZOOM_OUT && size > 5)
- size--;
-
- pango_font_description_set_size(font_desc, size*PANGO_SCALE);
-
- g_free(*font);
- *font = pango_font_description_to_string(font_desc);
- pango_font_description_free(font_desc);
-}
Index: prefs_common.h
===================================================================
RCS file: /home/claws-mail/claws/src/prefs_common.h,v
retrieving revision 1.103.2.142
retrieving revision 1.103.2.143
diff -u -d -r1.103.2.142 -r1.103.2.143
--- prefs_common.h 23 Nov 2012 19:29:15 -0000 1.103.2.142
+++ prefs_common.h 27 Nov 2012 10:12:11 -0000 1.103.2.143
@@ -56,11 +56,6 @@
CTE_8BIT
} TransferEncodingMethod;
-typedef enum {
- ZOOM_IN,
- ZOOM_OUT
-} ZoomType;
-
typedef enum
{
/* U = unread, N = new, M = marked */
@@ -200,11 +195,13 @@
gchar *smallfont_gtk1;
/* new fonts */
+ gchar *widgetfont;
gchar *textfont;
gchar *printfont;
gchar *boldfont;
gchar *normalfont;
gchar *smallfont;
+ gchar *titlefont;
gboolean use_different_print_font;
gboolean derive_from_normal_font;
@@ -547,5 +544,4 @@
const gchar *prefs_common_translated_header_name(const gchar *header_name);
const gchar *prefs_common_get_uri_cmd(void);
const gchar *prefs_common_get_ext_editor_cmd(void);
-void prefs_common_zoom_font(gchar **font, ZoomType type);
#endif /* __PREFS_COMMON_H__ */
More information about the Commits
mailing list