From 9d573dc9d9f047d1ec4bbb0776f3c7bc5e83768e Mon Sep 17 00:00:00 2001 From: David Bordoley Date: Wed, 14 May 2003 13:41:46 +0000 Subject: Add some flags so that we can choose to save position or size or both. 2003-05-14 David Bordoley * lib/ephy-state.c: (ephy_state_add_window): * lib/ephy-state.h: (EphyStateWindowFlags): Add some flags so that we can choose to save position or size or both. * lib/ephy-dialog.c: (setup_default_size): * src/ephy-window.c: (ephy_window_show): * src/window-commands.c: (window_cmd_edit_toolbar): * src/bookmarks/ephy-bookmark-properties.c: (build_ui): * src/bookmarks/ephy-new-bookmark.c: (ephy_new_bookmark_construct): Only save size for dialogs and main windows. * src/ephy-history-window.c: (ephy_history_window_construct): * src/bookmarks/ephy-bookmarks-editor.c: (ephy_bookmarks_editor_construct): Save size and position. --- lib/ephy-dialog.c | 3 ++- lib/ephy-state.c | 14 +++++++++++--- lib/ephy-state.h | 9 ++++++++- 3 files changed, 21 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c index 7262bc59c..8bdfc5330 100644 --- a/lib/ephy-dialog.c +++ b/lib/ephy-dialog.c @@ -841,7 +841,8 @@ static void setup_default_size (EphyDialog *dialog) { ephy_state_add_window (dialog->priv->dialog, - dialog->priv->name, -1, -1); + dialog->priv->name, -1, -1, + EPHY_STATE_WINDOW_SAVE_SIZE); } static gint diff --git a/lib/ephy-state.c b/lib/ephy-state.c index bfab0e916..d6413ff76 100644 --- a/lib/ephy-state.c +++ b/lib/ephy-state.c @@ -303,7 +303,8 @@ void ephy_state_add_window (GtkWidget *window, const char *name, int default_width, - int default_height) + int default_height, + EphyStateWindowFlags flags) { EphyNode *node; @@ -358,8 +359,15 @@ ephy_state_add_window (GtkWidget *window, g_value_unset (&value); } - ephy_state_window_set_size (window, node); - ephy_state_window_set_position (window, node); + if (flags & EPHY_STATE_WINDOW_SAVE_SIZE) + { + ephy_state_window_set_size (window, node); + } + + if (flags & EPHY_STATE_WINDOW_SAVE_POSITION) + { + ephy_state_window_set_position (window, node); + } g_signal_connect_object (window, "configure_event", G_CALLBACK (window_configure_event_cb), node, 0); diff --git a/lib/ephy-state.h b/lib/ephy-state.h index 9d6388ac4..0604ea0d5 100644 --- a/lib/ephy-state.h +++ b/lib/ephy-state.h @@ -26,10 +26,17 @@ G_BEGIN_DECLS +typedef enum +{ + EPHY_STATE_WINDOW_SAVE_SIZE = 1 << 0, + EPHY_STATE_WINDOW_SAVE_POSITION = 1 << 1 +} EphyStateWindowFlags; + void ephy_state_add_window (GtkWidget *window, const char *name, int default_width, - int default_heigth); + int default_heigth, + EphyStateWindowFlags flags); void ephy_state_add_paned (GtkWidget *paned, const char *name, -- cgit v1.2.3