diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index b0e4b1045..6680d8ef9 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -1649,22 +1649,26 @@ void FileCatalog::tbRightPanel_1_visible (bool visible){ void FileCatalog::tbLeftPanel_1_toggled () { removeIfThere (filepanel->dirpaned, filepanel->placespaned, false); if (tbLeftPanel_1->get_active()){ - filepanel->dirpaned->pack1 (*filepanel->placespaned, false, true); + filepanel->dirpaned->pack1 (*filepanel->placespaned, false, true); tbLeftPanel_1->set_image (*iLeftPanel_1_Hide); + options.browserDirPanelOpened = true; } else { - tbLeftPanel_1->set_image (*iLeftPanel_1_Show); + tbLeftPanel_1->set_image (*iLeftPanel_1_Show); + options.browserDirPanelOpened = false; } } void FileCatalog::tbRightPanel_1_toggled () { if (tbRightPanel_1->get_active()){ - filepanel->rightBox->show(); - tbRightPanel_1->set_image (*iRightPanel_1_Hide); + filepanel->rightBox->show(); + tbRightPanel_1->set_image (*iRightPanel_1_Hide); + options.browserToolPanelOpened = true; } else{ - filepanel->rightBox->hide(); - tbRightPanel_1->set_image (*iRightPanel_1_Show); + filepanel->rightBox->hide(); + tbRightPanel_1->set_image (*iRightPanel_1_Show); + options.browserToolPanelOpened = false; } } @@ -1684,6 +1688,15 @@ void FileCatalog::toggleSidePanels(){ tbRightPanel_1->set_active (!bAllSidePanelsVisible); } +void FileCatalog::toggleLeftPanel() { + tbLeftPanel_1->set_active (!tbLeftPanel_1->get_active()); +} + +void FileCatalog::toggleRightPanel() { + tbRightPanel_1->set_active (!tbRightPanel_1->get_active()); +} + + void FileCatalog::selectImage (Glib::ustring fname, bool clearFilters) { Glib::ustring dirname = Glib::path_get_dirname(fname); diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index 37dfdfaf6..04ca95a4d 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -247,6 +247,8 @@ class FileCatalog : public Gtk::VBox, bool CheckSidePanelsVisibility(); void toggleSidePanels(); + void toggleLeftPanel(); + void toggleRightPanel(); #ifndef _WIN32 void on_dir_changed (const Glib::RefPtr& file, const Glib::RefPtr& other_file, Gio::FileMonitorEvent event_type, bool internal); diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 55851941e..68b70ee31 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -132,6 +132,10 @@ void FilePanel::setAspect () { dirpaned->set_position(options.dirBrowserWidth); tpcPaned->set_position(options.browserToolPanelHeight); set_position(winW - options.browserToolPanelWidth); + if (!options.browserDirPanelOpened) + fileCatalog->toggleLeftPanel(); + if (!options.browserToolPanelOpened) + fileCatalog->toggleRightPanel(); } void FilePanel::init () { diff --git a/rtgui/options.cc b/rtgui/options.cc index 21be54704..0bb72a387 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -265,6 +265,8 @@ void Options::setDefaults () { toolPanelWidth = 390; browserToolPanelWidth = 430; browserToolPanelHeight = 600; + browserToolPanelOpened = true;; + browserDirPanelOpened = true; historyPanelWidth = 330; lastScale = 5; panAccelFactor = 5; @@ -686,8 +688,10 @@ if (keyFile.has_group ("GUI")) { 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", "BrowserToolPanelHeight"))browserToolPanelHeight = keyFile.get_integer ("GUI", "BrowserToolPanelHeight"); + if (keyFile.has_key ("GUI", "BrowserToolPanelWidth")) browserToolPanelWidth = keyFile.get_integer ("GUI", "BrowserToolPanelWidth"); + if (keyFile.has_key ("GUI", "BrowserToolPanelHeight")) browserToolPanelHeight = keyFile.get_integer ("GUI", "BrowserToolPanelHeight"); + if (keyFile.has_key ("GUI", "BrowserToolPanelOpened")) browserToolPanelOpened = keyFile.get_boolean ("GUI", "BrowserToolPanelOpened"); + if (keyFile.has_key ("GUI", "BrowserDirPanelOpened")) browserDirPanelOpened = keyFile.get_boolean ("GUI", "BrowserDirPanelOpened"); 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", "PanAccelFactor")) panAccelFactor = keyFile.get_integer ("GUI", "PanAccelFactor"); @@ -969,6 +973,8 @@ int Options::saveToFile (Glib::ustring fname) { keyFile.set_integer ("GUI", "ToolPanelWidth", toolPanelWidth); keyFile.set_integer ("GUI", "BrowserToolPanelWidth", browserToolPanelWidth); keyFile.set_integer ("GUI", "BrowserToolPanelHeight", browserToolPanelHeight); + keyFile.set_boolean ("GUI", "BrowserToolPanelOpened", browserToolPanelOpened); + keyFile.set_boolean ("GUI", "BrowserDirPanelOpened", browserDirPanelOpened); keyFile.set_integer ("GUI", "HistoryPanelWidth", historyPanelWidth); keyFile.set_integer ("GUI", "LastPreviewScale", lastScale); keyFile.set_integer ("GUI", "PanAccelFactor", panAccelFactor); diff --git a/rtgui/options.h b/rtgui/options.h index 070b726a9..4500c6b85 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -106,6 +106,8 @@ class Options { int toolPanelWidth; int browserToolPanelWidth; int browserToolPanelHeight; + bool browserToolPanelOpened; + bool browserDirPanelOpened; int historyPanelWidth; Glib::ustring font; int windowWidth;