diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | libsylph/prefs_common.c | 3 | ||||
-rw-r--r-- | libsylph/prefs_common.h | 2 | ||||
-rw-r--r-- | src/mainwindow.c | 32 |
5 files changed, 47 insertions, 0 deletions
@@ -1,5 +1,10 @@ 2005-12-19 + * libsylph/prefs_common.[ch] + src/mainwindow.c: remember the maximized state. + +2005-12-19 + * src/summary_search.[ch] src/folderview.c src/mainwindow.c: removed SummaryView* from the argument of diff --git a/ChangeLog.ja b/ChangeLog.ja index 800c1480..20de0f2c 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,10 @@ 2005-12-19 + * libsylph/prefs_common.[ch] + src/mainwindow.c: 最大化状態を記憶するようにした。 + +2005-12-19 + * src/summary_search.[ch] src/folderview.c src/mainwindow.c: summary_search() の引数から SummaryView* を削除。 diff --git a/libsylph/prefs_common.c b/libsylph/prefs_common.c index 0ab5cb31..963f2d56 100644 --- a/libsylph/prefs_common.c +++ b/libsylph/prefs_common.c @@ -210,6 +210,9 @@ static PrefParam param[] = { {"mainwin_height", "600", &prefs_common.mainwin_height, P_INT}, {"messagewin_width", "600", &prefs_common.msgwin_width, P_INT}, {"messagewin_height", "540", &prefs_common.msgwin_height, P_INT}, + + {"mainwin_maximized", "FALSE", &prefs_common.mainwin_maximized, P_BOOL}, + {"sourcewin_width", "600", &prefs_common.sourcewin_width, P_INT}, {"sourcewin_height", "500", &prefs_common.sourcewin_height, P_INT}, {"compose_x", "32", &prefs_common.compose_x, P_INT}, diff --git a/libsylph/prefs_common.h b/libsylph/prefs_common.h index 493d5787..979ba933 100644 --- a/libsylph/prefs_common.h +++ b/libsylph/prefs_common.h @@ -147,6 +147,8 @@ struct _PrefsCommon gint msgwin_width; gint msgwin_height; + gboolean mainwin_maximized; + gint sourcewin_width; gint sourcewin_height; diff --git a/src/mainwindow.c b/src/mainwindow.c index 60e6fa3c..36c5abd1 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -183,6 +183,10 @@ static void message_window_size_allocate_cb (GtkWidget *widget, GtkAllocation *allocation, gpointer data); +static gboolean main_window_window_state_cb (GtkWidget *widget, + GdkEventWindowState *event, + gpointer data); + static void new_folder_cb (MainWindow *mainwin, guint action, GtkWidget *widget); @@ -994,8 +998,13 @@ MainWindow *main_window_create(SeparateType type) main_window_set_widgets(mainwin, type); + if (prefs_common.mainwin_maximized) + gtk_window_maximize(GTK_WINDOW(window)); + g_signal_connect(G_OBJECT(window), "size_allocate", G_CALLBACK(main_window_size_allocate_cb), mainwin); + g_signal_connect(G_OBJECT(window), "window_state_event", + G_CALLBACK(main_window_window_state_cb), mainwin); /* set menu items */ menuitem = gtk_item_factory_get_item @@ -1438,6 +1447,9 @@ void main_window_get_size(MainWindow *mainwin) { GtkAllocation *allocation; + if (prefs_common.mainwin_maximized) + return; + allocation = &(GTK_WIDGET_PTR(mainwin->summaryview)->allocation); if (allocation->width > 1 && allocation->height > 1) { @@ -1474,6 +1486,9 @@ void main_window_get_size(MainWindow *mainwin) debug_print("summaryview size: %d x %d\n", prefs_common.summaryview_width, prefs_common.summaryview_height); + debug_print("mainwin size: %d x %d\n", + prefs_common.mainwin_width, + prefs_common.mainwin_height); debug_print("folderview size: %d x %d\n", prefs_common.folderview_width, prefs_common.folderview_height); @@ -1488,6 +1503,9 @@ void main_window_get_position(MainWindow *mainwin) gint x, y; GtkWidget *window; + if (prefs_common.mainwin_maximized) + return; + gtkut_widget_get_uposition(mainwin->window, &x, &y); prefs_common.mainview_x = x; @@ -2652,6 +2670,20 @@ static void message_window_size_allocate_cb(GtkWidget *widget, main_window_get_size(mainwin); } +static gboolean main_window_window_state_cb(GtkWidget *widget, + GdkEventWindowState *event, + gpointer data) +{ + if ((event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) != 0) { + if ((event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0) + prefs_common.mainwin_maximized = TRUE; + else + prefs_common.mainwin_maximized = FALSE; + } + + return FALSE; +} + static void new_folder_cb(MainWindow *mainwin, guint action, GtkWidget *widget) { |