aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.ja5
-rw-r--r--libsylph/prefs_common.c4
-rw-r--r--libsylph/prefs_common.h2
-rw-r--r--src/compose.c42
-rw-r--r--src/compose.h2
6 files changed, 56 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 583c036f..783466bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-05-08
+
+ * libsylph/prefs_common.[ch]
+ src/compose.[ch]: remember the maximized state.
+
2008-04-30
* sylpheed.desktop: fixed warnings and added German translation
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 08f7d293..9ca67d51 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,3 +1,8 @@
+2008-05-08
+
+ * libsylph/prefs_common.[ch]
+ src/compose.[ch]: 最大化の状態を記憶するようにした。
+
2008-04-30
* sylpheed.desktop: 警告の修正とドイツ語の翻訳を追加(Enrico Troger
diff --git a/libsylph/prefs_common.c b/libsylph/prefs_common.c
index 8a24b258..5c3103af 100644
--- a/libsylph/prefs_common.c
+++ b/libsylph/prefs_common.c
@@ -282,10 +282,14 @@ static PrefParam param[] = {
{"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},
{"compose_y", "32", &prefs_common.compose_y, P_INT},
{"compose_width", "600", &prefs_common.compose_width, P_INT},
{"compose_height", "560", &prefs_common.compose_height, P_INT},
+
+ {"compose_maximized", "FALSE", &prefs_common.compose_maximized, P_BOOL},
+
{"addressbook_x", "32", &prefs_common.addressbook_x, P_INT},
{"addressbook_y", "32", &prefs_common.addressbook_y, P_INT},
{"addressbook_width", "620", &prefs_common.addressbook_width, P_INT},
diff --git a/libsylph/prefs_common.h b/libsylph/prefs_common.h
index 37a230bd..f072e97e 100644
--- a/libsylph/prefs_common.h
+++ b/libsylph/prefs_common.h
@@ -184,6 +184,8 @@ struct _PrefsCommon
gint compose_width;
gint compose_height;
+ gboolean compose_maximized;
+
gint addressbook_x;
gint addressbook_y;
gint addressbook_width;
diff --git a/src/compose.c b/src/compose.c
index b6b496ce..69f75e05 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -420,6 +420,10 @@ static gint compose_delete_cb (GtkWidget *widget,
GdkEventAny *event,
gpointer data);
+static gint compose_window_state_cb (GtkWidget *widget,
+ GdkEventWindowState *event,
+ gpointer data);
+
static void compose_undo_cb (Compose *compose);
static void compose_redo_cb (Compose *compose);
static void compose_cut_cb (Compose *compose);
@@ -5335,10 +5339,18 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
compose->autosave_tag = 0;
+ compose->window_maximized = prefs_common.compose_maximized;
+
compose_set_toolbar_button_visibility(compose);
compose_select_account(compose, account, TRUE);
+ if (prefs_common.compose_maximized)
+ gtk_window_maximize(GTK_WINDOW(window));
+
+ g_signal_connect(G_OBJECT(window), "window_state_event",
+ G_CALLBACK(compose_window_state_cb), compose);
+
menu_set_active(ifactory, "/Edit/Auto wrapping", prefs_common.autowrap);
menu_set_active(ifactory, "/View/Ruler", prefs_common.show_ruler);
@@ -5937,10 +5949,16 @@ static void compose_destroy(Compose *compose)
if (addressbook_get_target_compose() == compose)
addressbook_set_target_compose(NULL);
- gtkut_widget_get_uposition(compose->window, &prefs_common.compose_x,
- &prefs_common.compose_y);
- prefs_common.compose_width = compose->scrolledwin->allocation.width;
- prefs_common.compose_height = compose->window->allocation.height;
+ prefs_common.compose_maximized = compose->window_maximized;
+ if (!prefs_common.compose_maximized) {
+ gtkut_widget_get_uposition(compose->window,
+ &prefs_common.compose_x,
+ &prefs_common.compose_y);
+ prefs_common.compose_width =
+ compose->scrolledwin->allocation.width;
+ prefs_common.compose_height =
+ compose->window->allocation.height;
+ }
if (!gtk_widget_get_parent(compose->paned))
gtk_widget_destroy(compose->paned);
@@ -6962,6 +6980,22 @@ static gint compose_delete_cb(GtkWidget *widget, GdkEventAny *event,
return TRUE;
}
+static gint compose_window_state_cb(GtkWidget *widget,
+ GdkEventWindowState *event,
+ gpointer data)
+{
+ Compose *compose = (Compose *)data;
+
+ if ((event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) != 0) {
+ if ((event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0)
+ compose->window_maximized = TRUE;
+ else
+ compose->window_maximized = FALSE;
+ }
+
+ return FALSE;
+}
+
static void compose_close_cb(gpointer data, guint action, GtkWidget *widget)
{
Compose *compose = (Compose *)data;
diff --git a/src/compose.h b/src/compose.h
index 4c6f063d..f805b834 100644
--- a/src/compose.h
+++ b/src/compose.h
@@ -192,6 +192,8 @@ struct _Compose
guint autosave_tag;
guint lock_count;
+
+ gboolean window_maximized;
};
struct _AttachInfo