2008-07-05 [colin] 3.5.0cvs12
[claws.git] / src / mainwindow.c
index 99c5604040a5b0141523a013d9c96398f6ec0a5e..953fe3525e4c047c99c747a8cb99d4ed75fd5cd4 100644 (file)
@@ -1399,6 +1399,54 @@ static gboolean mainwindow_key_pressed (GtkWidget *widget, GdkEventKey *event,
                        gtk_window_fullscreen(GTK_WINDOW(widget));
                 }
                break;
+       case GDK_F7:
+               {
+                       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_F8:
+               {
+                       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_Escape:
                if (mainwin->summaryview && 
                    mainwin->summaryview->ext_messageview && 
@@ -2061,6 +2109,7 @@ static gboolean reflect_prefs_timeout_cb(gpointer data)
                        gtk_widget_show(pixmap);
                        mainwin->offline_pixmap = pixmap;
 #endif
+                       hooks_invoke(THEME_CHANGED_HOOKLIST, NULL);
                }
                
                headerview_set_font(mainwin->messageview->headerview);
@@ -2144,7 +2193,7 @@ void main_window_reflect_tags_changes(MainWindow *mainwin)
 void main_window_reflect_prefs_all_real(gboolean pixmap_theme_changed)
 {
        if (prefs_tag == 0) {
-               prefs_tag = g_timeout_add(500, reflect_prefs_timeout_cb, 
+               prefs_tag = g_timeout_add(100, reflect_prefs_timeout_cb, 
                                                GINT_TO_POINTER(pixmap_theme_changed));
        }
 }
@@ -2751,6 +2800,9 @@ SensitiveCond main_window_get_current_state(MainWindow *mainwin)
        if (summary_is_list(mainwin->summaryview))
                state |= M_SUMMARY_ISLIST;
 
+       if (prefs_common.layout_mode != SMALL_LAYOUT || mainwin->in_folder)
+               state |= M_IN_MSGLIST;
+
        return state;
 }
 
@@ -2780,6 +2832,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                {"/Edit/Select thread"             , M_TARGET_EXIST|M_SUMMARY_ISLIST},
                {"/Edit/Delete thread"             , M_TARGET_EXIST|M_SUMMARY_ISLIST},
                {"/Edit/Find in current message...", M_SINGLE_TARGET_EXIST},
+               {"/Edit/Quick search",               M_IN_MSGLIST},
 
                {"/View/Set displayed columns/in Folder list..."
                                                   , M_UNLOCKED|M_SUMMARY_ISLIST}, 
@@ -4712,6 +4765,7 @@ void mainwindow_exit_folder(MainWindow *mainwin) {
                gtk_widget_grab_focus(mainwin->folderview->ctree);
        }
        mainwin->in_folder = FALSE;
+       main_window_set_menu_sensitive(mainwin);
 }
 
 void mainwindow_enter_folder(MainWindow *mainwin) {
@@ -4719,6 +4773,7 @@ void mainwindow_enter_folder(MainWindow *mainwin) {
                mainwin_paned_show_last(GTK_PANED(mainwin->hpaned));
        }
        mainwin->in_folder = TRUE;
+       main_window_set_menu_sensitive(mainwin);
 }
 
 #ifdef MAEMO