diff options
author | David Bordoley <bordoley@msu.edu> | 2003-05-01 00:58:56 +0800 |
---|---|---|
committer | Dave Bordoley <Bordoley@src.gnome.org> | 2003-05-01 00:58:56 +0800 |
commit | a2cc71e51c55bd11d65facb13c8915f774ef3bac (patch) | |
tree | dcaca2998a73778b434bc2102894fe623d496cb6 | |
parent | 6a6479ca2b2c1fd5aa78c860299d1a96ef51f199 (diff) | |
download | gsoc2013-epiphany-a2cc71e51c55bd11d65facb13c8915f774ef3bac.tar.gz gsoc2013-epiphany-a2cc71e51c55bd11d65facb13c8915f774ef3bac.tar.zst gsoc2013-epiphany-a2cc71e51c55bd11d65facb13c8915f774ef3bac.zip |
Don't set/save window position if it is maximized.
2003-04-30 David Bordoley <bordoley@msu.edu>
* lib/ephy-state.c: (ephy_state_window_set_position),
(ephy_state_window_save_position):
Don't set/save window position if it is maximized.
* src/ephy-history-window.c: (ephy_history_window_construct):
* src/bookmarks/ephy-bookmarks-editor.c:
(ephy_bookmarks_editor_construct):
Don't set the shadow_type to GTK_SHADOW_IN
the ScrolledWindows. It breaks some fitts law considerations,
and really amounts to just visual noise.
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | lib/ephy-state.c | 64 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmarks-editor.c | 2 | ||||
-rw-r--r-- | src/ephy-history-window.c | 3 |
4 files changed, 56 insertions, 28 deletions
@@ -1,4 +1,19 @@ 2003-04-30 David Bordoley <bordoley@msu.edu> + + * lib/ephy-state.c: (ephy_state_window_set_position), + (ephy_state_window_save_position): + + Don't set/save window position if it is maximized. + + * src/ephy-history-window.c: (ephy_history_window_construct): + * src/bookmarks/ephy-bookmarks-editor.c: + (ephy_bookmarks_editor_construct): + + Don't set the shadow_type to GTK_SHADOW_IN + the ScrolledWindows. It breaks some fitts law considerations, + and really amounts to just visual noise. + +2003-04-30 David Bordoley <bordoley@msu.edu> * src/ephy-window.c * data/epiphany.schemas.in diff --git a/lib/ephy-state.c b/lib/ephy-state.c index 746554562..55a109d1a 100644 --- a/lib/ephy-state.c +++ b/lib/ephy-state.c @@ -177,28 +177,36 @@ ephy_state_window_set_position (GtkWidget *window, EphyNode *node) GdkScreen *screen; int x, y; int screen_width, screen_height; + gboolean maximize; g_return_if_fail (GTK_IS_WINDOW (window)); /* Setting the default size doesn't work when the window is already showing. */ g_return_if_fail (!GTK_WIDGET_VISIBLE (window)); - x = ephy_node_get_property_int (node, EPHY_NODE_STATE_PROP_POSITION_X); - y = ephy_node_get_property_int (node, EPHY_NODE_STATE_PROP_POSITION_Y); + maximize = ephy_node_get_property_boolean (node, EPHY_NODE_STATE_PROP_MAXIMIZE); - screen = gtk_window_get_screen (GTK_WINDOW (window)); - screen_width = gdk_screen_get_width (screen); - screen_height = gdk_screen_get_height (screen); + /* Don't set the position of the window if it is maximized */ - if ((x >= screen_width) || (y >= screen_height)) + if (!maximize) { - x = y = WINDOW_POSITION_UNSET; - } + x = ephy_node_get_property_int (node, EPHY_NODE_STATE_PROP_POSITION_X); + y = ephy_node_get_property_int (node, EPHY_NODE_STATE_PROP_POSITION_Y); - /* If the window has a saved position set it, otherwise let the WM do it */ - if ((x != WINDOW_POSITION_UNSET) && (y != WINDOW_POSITION_UNSET)) - { - gtk_window_move (GTK_WINDOW (window), x, y); + screen = gtk_window_get_screen (GTK_WINDOW (window)); + screen_width = gdk_screen_get_width (screen); + screen_height = gdk_screen_get_height (screen); + + if ((x >= screen_width) || (y >= screen_height)) + { + x = y = WINDOW_POSITION_UNSET; + } + + /* If the window has a saved position set it, otherwise let the WM do it */ + if ((x != WINDOW_POSITION_UNSET) && (y != WINDOW_POSITION_UNSET)) + { + gtk_window_move (GTK_WINDOW (window), x, y); + } } } @@ -243,21 +251,31 @@ static void ephy_state_window_save_position (GtkWidget *window, EphyNode *node) { int x,y; + gboolean maximize; + GdkWindowState state; GValue value = { 0, }; + + state = gdk_window_get_state (GTK_WIDGET (window)->window); + maximize = ((state & GDK_WINDOW_STATE_MAXIMIZED) > 0); - gtk_window_get_position (GTK_WINDOW (window), &x, &y); + /* Don't save the position if maximized */ - g_value_init (&value, G_TYPE_INT); - g_value_set_int (&value, x); - ephy_node_set_property (node, EPHY_NODE_STATE_PROP_POSITION_X, - &value); - g_value_unset (&value); + if (!maximize) + { + gtk_window_get_position (GTK_WINDOW (window), &x, &y); - g_value_init (&value, G_TYPE_INT); - g_value_set_int (&value, y); - ephy_node_set_property (node, EPHY_NODE_STATE_PROP_POSITION_Y, - &value); - g_value_unset (&value); + g_value_init (&value, G_TYPE_INT); + g_value_set_int (&value, x); + ephy_node_set_property (node, EPHY_NODE_STATE_PROP_POSITION_X, + &value); + g_value_unset (&value); + + g_value_init (&value, G_TYPE_INT); + g_value_set_int (&value, y); + ephy_node_set_property (node, EPHY_NODE_STATE_PROP_POSITION_Y, + &value); + g_value_unset (&value); + } } static gboolean diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c index eca629938..60f67108a 100644 --- a/src/bookmarks/ephy-bookmarks-editor.c +++ b/src/bookmarks/ephy-bookmarks-editor.c @@ -1163,7 +1163,6 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor) "vadjustment", NULL, "hscrollbar_policy", GTK_POLICY_AUTOMATIC, "vscrollbar_policy", GTK_POLICY_AUTOMATIC, - "shadow_type", GTK_SHADOW_IN, NULL); gtk_paned_pack1 (GTK_PANED (hpaned), GTK_WIDGET (scrolled_window), TRUE, TRUE); gtk_widget_show (scrolled_window); @@ -1225,7 +1224,6 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor) "vadjustment", NULL, "hscrollbar_policy", GTK_POLICY_AUTOMATIC, "vscrollbar_policy", GTK_POLICY_AUTOMATIC, - "shadow_type", GTK_SHADOW_IN, NULL); gtk_box_pack_start (GTK_BOX (vbox), scrolled_window, TRUE, TRUE, 0); gtk_widget_show (scrolled_window); diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c index 36c9a013f..c69139bb3 100644 --- a/src/ephy-history-window.c +++ b/src/ephy-history-window.c @@ -860,7 +860,6 @@ ephy_history_window_construct (EphyHistoryWindow *editor) "vadjustment", NULL, "hscrollbar_policy", GTK_POLICY_AUTOMATIC, "vscrollbar_policy", GTK_POLICY_AUTOMATIC, - "shadow_type", GTK_SHADOW_IN, NULL); gtk_paned_add1 (GTK_PANED (hpaned), scrolled_window); gtk_widget_show (scrolled_window); @@ -895,14 +894,12 @@ ephy_history_window_construct (EphyHistoryWindow *editor) build_search_box (editor), FALSE, FALSE, 0); - /* Pages View */ scrolled_window = g_object_new (GTK_TYPE_SCROLLED_WINDOW, "hadjustment", NULL, "vadjustment", NULL, "hscrollbar_policy", GTK_POLICY_AUTOMATIC, "vscrollbar_policy", GTK_POLICY_AUTOMATIC, - "shadow_type", GTK_SHADOW_IN, NULL); gtk_box_pack_start (GTK_BOX (vbox), scrolled_window, TRUE, TRUE, 0); gtk_widget_show (scrolled_window); |