[nautilus] window: remove max forced window size calculation
- From: Ernestas Kulik <ernestask src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] window: remove max forced window size calculation
- Date: Mon, 27 Feb 2017 12:22:25 +0000 (UTC)
commit de521ddf8bfd654c517f149c38acc1fbc8bed402
Author: Ernestas Kulik <ernestask src gnome org>
Date: Tue Jan 3 21:40:08 2017 +0200
window: remove max forced window size calculation
Currently, the default size for window is calculated by taking the
minimum value between the screen size and the hardcoded default. As
the smallest recommended screen size for GNOME today is 1024x600 and the
code has been added in 2000, it is likely no longer relevant. This
commit simply makes the code use the hardcoded values within the
recommended range as the default window size.
https://bugzilla.gnome.org/show_bug.cgi?id=779082
src/nautilus-window.c | 49 ++++---------------------------------------------
1 files changed, 4 insertions(+), 45 deletions(-)
---
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index a23325c..5404309 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -872,50 +872,6 @@ nautilus_window_get_notebook (NautilusWindow *window)
return window->priv->notebook;
}
-/* Code should never force the window taller than this size.
- * (The user can still stretch the window taller if desired).
- */
-static guint
-get_max_forced_height (GdkScreen *screen)
-{
- return (gdk_screen_get_height (screen) * 90) / 100;
-}
-
-/* Code should never force the window wider than this size.
- * (The user can still stretch the window wider if desired).
- */
-static guint
-get_max_forced_width (GdkScreen *screen)
-{
- return (gdk_screen_get_width (screen) * 90) / 100;
-}
-
-/* This must be called when construction of NautilusWindow is finished,
- * since it depends on the type of the argument, which isn't decided at
- * construction time.
- */
-static void
-nautilus_window_set_initial_window_geometry (NautilusWindow *window)
-{
- GdkScreen *screen;
- guint max_width_for_screen, max_height_for_screen;
- guint default_width, default_height;
-
- screen = gtk_window_get_screen (GTK_WINDOW (window));
-
- max_width_for_screen = get_max_forced_width (screen);
- max_height_for_screen = get_max_forced_height (screen);
-
- default_width = NAUTILUS_WINDOW_DEFAULT_WIDTH;
- default_height = NAUTILUS_WINDOW_DEFAULT_HEIGHT;
-
- gtk_window_set_default_size (GTK_WINDOW (window),
- MIN (default_width,
- max_width_for_screen),
- MIN (default_height,
- max_height_for_screen));
-}
-
static gboolean
save_sidebar_width_cb (gpointer user_data)
{
@@ -2243,7 +2199,10 @@ nautilus_window_constructed (GObject *self)
setup_toolbar (window);
- nautilus_window_set_initial_window_geometry (window);
+ gtk_window_set_default_size (GTK_WINDOW (window),
+ NAUTILUS_WINDOW_DEFAULT_WIDTH,
+ NAUTILUS_WINDOW_DEFAULT_HEIGHT);
+
setup_notebook (window);
nautilus_window_set_up_sidebar (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]