From b30a93116ec321dc46f85eff836ce249b7c58f79 Mon Sep 17 00:00:00 2001 From: Hombre Date: Wed, 15 Sep 2010 16:46:56 +0200 Subject: [PATCH] Fix bug #59, at least on Windows --- rtgui/filepanel.cc | 6 +++--- rtgui/options.cc | 19 +++++++++++-------- rtgui/options.h | 1 + rtgui/rtwindow.cc | 14 ++++++++++++-- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 00368f811..860175863 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -47,11 +47,11 @@ FilePanel::FilePanel () : parent(NULL) { placespaned->pack1 (*placesBrowser, false, true); placespaned->pack2 (*obox, true, true); - dirpaned->pack1 (*placespaned, Gtk::SHRINK); + dirpaned->pack1 (*placespaned, true, true); tpc = new BatchToolPanelCoordinator (this); fileCatalog = new FileCatalog (tpc->coarse, tpc->getToolBar()); - dirpaned->pack2 (*fileCatalog, Gtk::EXPAND|Gtk::SHRINK); + dirpaned->pack2 (*fileCatalog, true, true); placesBrowser->setDirBrowserRemoteInterface (dirBrowser); recentBrowser->setDirBrowserRemoteInterface (dirBrowser); @@ -99,7 +99,7 @@ FilePanel::FilePanel () : parent(NULL) { rightBox->pack_start (*rightNotebook); pack1(*dirpaned, true, true); - pack2(*rightBox, false, true); + pack2(*rightBox, true, true); fileCatalog->setFileSelectionChangeListener (tpc); diff --git a/rtgui/options.cc b/rtgui/options.cc index e290a16e4..5d9506ca0 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -40,6 +40,7 @@ void Options::setDefaults () { windowWidth = 1000; windowHeight = 600; + windowMaximized = false; firstRun = true; savesParamsAtExit = true; saveFormat.format = "jpg"; @@ -242,14 +243,15 @@ if (keyFile.has_group ("Clipping Indication")) { } if (keyFile.has_group ("GUI")) { - if (keyFile.has_key ("GUI", "WindowWidth")) windowWidth = keyFile.get_integer ("GUI", "WindowWidth"); - if (keyFile.has_key ("GUI", "WindowHeight")) windowHeight = keyFile.get_integer ("GUI", "WindowHeight"); - if (keyFile.has_key ("GUI", "DirBrowserWidth")) dirBrowserWidth = keyFile.get_integer ("GUI", "DirBrowserWidth"); - if (keyFile.has_key ("GUI", "DirBrowserHeight")) dirBrowserHeight = keyFile.get_integer ("GUI", "DirBrowserHeight"); - if (keyFile.has_key ("GUI", "SaveAsDialogWidth")) saveAsDialogWidth = keyFile.get_integer ("GUI", "SaveAsDialogWidth"); - if (keyFile.has_key ("GUI", "SaveAsDialogHeight")) saveAsDialogHeight = keyFile.get_integer ("GUI", "SaveAsDialogHeight"); - if (keyFile.has_key ("GUI", "ToolPanelWidth")) toolPanelWidth = keyFile.get_integer ("GUI", "ToolPanelWidth"); - if (keyFile.has_key ("GUI", "BrowserToolPanelWidth"))browserToolPanelWidth = keyFile.get_integer ("GUI", "BrowserToolPanelWidth"); + if (keyFile.has_key ("GUI", "WindowWidth")) windowWidth = keyFile.get_integer ("GUI", "WindowWidth"); + if (keyFile.has_key ("GUI", "WindowHeight")) windowHeight = keyFile.get_integer ("GUI", "WindowHeight"); + if (keyFile.has_key ("GUI", "WindowMaximized")) windowMaximized = keyFile.get_boolean ("GUI", "WindowMaximized"); + if (keyFile.has_key ("GUI", "DirBrowserWidth")) dirBrowserWidth = keyFile.get_integer ("GUI", "DirBrowserWidth"); + if (keyFile.has_key ("GUI", "DirBrowserHeight")) dirBrowserHeight = keyFile.get_integer ("GUI", "DirBrowserHeight"); + if (keyFile.has_key ("GUI", "SaveAsDialogWidth")) saveAsDialogWidth = keyFile.get_integer ("GUI", "SaveAsDialogWidth"); + if (keyFile.has_key ("GUI", "SaveAsDialogHeight")) saveAsDialogHeight = keyFile.get_integer ("GUI", "SaveAsDialogHeight"); + if (keyFile.has_key ("GUI", "ToolPanelWidth")) toolPanelWidth = keyFile.get_integer ("GUI", "ToolPanelWidth"); + if (keyFile.has_key ("GUI", "BrowserToolPanelWidth"))browserToolPanelWidth = keyFile.get_integer ("GUI", "BrowserToolPanelWidth"); if (keyFile.has_key ("GUI", "HistoryPanelWidth")) historyPanelWidth = keyFile.get_integer ("GUI", "HistoryPanelWidth"); if (keyFile.has_key ("GUI", "LastPreviewScale")) lastScale = keyFile.get_integer ("GUI", "LastPreviewScale"); if (keyFile.has_key ("GUI", "LastCropSize")) lastCropSize = keyFile.get_integer ("GUI", "LastCropSize"); @@ -372,6 +374,7 @@ int Options::saveToFile (Glib::ustring fname) { keyFile.set_integer ("GUI", "WindowWidth", windowWidth); keyFile.set_integer ("GUI", "WindowHeight", windowHeight); + keyFile.set_boolean ("GUI", "WindowMaximized", windowMaximized); keyFile.set_integer ("GUI", "DirBrowserWidth", dirBrowserWidth); keyFile.set_integer ("GUI", "DirBrowserHeight", dirBrowserHeight); keyFile.set_integer ("GUI", "SaveAsDialogWidth", saveAsDialogWidth); diff --git a/rtgui/options.h b/rtgui/options.h index 75ff029fb..b0a929adc 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -69,6 +69,7 @@ class Options { int historyPanelWidth; int windowWidth; int windowHeight; + bool windowMaximized; int dirBrowserWidth; int dirBrowserHeight; int lastScale; diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index a3166889d..53685fc49 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -39,6 +39,10 @@ RTWindow::RTWindow () { set_default_size(options.windowWidth, options.windowHeight); set_modal(false); set_resizable(true); + if (options.windowMaximized) + maximize(); + else + unmaximize(); property_destroy_with_parent().set_value(false); mainNB = Gtk::manage (new Gtk::Notebook ()); @@ -220,8 +224,14 @@ bool RTWindow::on_delete_event(GdkEventAny* event) { options.fbArrangement = fileBrowser->getFileCatalog()->getArrangement (); options.firstRun = false; */ - //options.windowWidth = get_width(); - //options.windowHeight = get_height(); + Gdk::WindowState state = get_window()->get_state(); + if (!(state & (Gdk::WINDOW_STATE_MAXIMIZED | Gdk::WINDOW_STATE_FULLSCREEN))) { + options.windowWidth = get_width(); + options.windowHeight = get_height(); + options.windowMaximized = false; + } + else + options.windowMaximized = true; Options::save ();