diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 8e04a9ea6..4aa9be5d0 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -1017,8 +1017,8 @@ void Preferences::savePressed () { void Preferences::okPressed () { storePreferences (); - options.copyFrom (&moptions); workflowUpdate(); + options.copyFrom (&moptions); hide (); } @@ -1119,10 +1119,15 @@ void Preferences::switchThemeTo(Glib::ustring newTheme) { void Preferences::workflowUpdate (){ - if(moptions.tabbedUI) - parent->epanel->hide_all(); - else - parent->epanel->show_all(); + if(moptions.tabbedUI != options.tabbedUI) + { + parent->MoveFileBrowserToMain(); + parent->SetMainCurrent(); + if(moptions.tabbedUI) + parent->epanel->hide_all(); + else + parent->epanel->show_all(); + } } void Preferences::switchFontTo(Glib::ustring newFont) { diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 53333b088..1f03da590 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -324,16 +324,33 @@ void RTWindow::SetEditorCurrent() mainNB->set_current_page (mainNB->page_num (*epanel)); } +void RTWindow::SetMainCurrent() +{ + mainNB->set_current_page (mainNB->page_num (*fpanel)); +} + +void RTWindow::MoveFileBrowserToMain() +{ + FileCatalog *fCatalog = fpanel->fileCatalog; + epanel->catalogPane->remove(*fCatalog); + fpanel->ribbonPane->add(*fCatalog); + fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Vertical); + fCatalog->redrawAll(); +} + +void RTWindow::MoveFileBrowserToEditor() +{ + FileCatalog *fCatalog = fpanel->fileCatalog; + fpanel->ribbonPane->remove(*fCatalog); + epanel->catalogPane->add(*fCatalog); + fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Horizontal); + fCatalog->redrawAll(); +} + bool RTWindow::on_expose_event_epanel(GdkEventExpose* event) { - - if(!options.tabbedUI && epanel->catalogPane->get_children().size() ==0 ){ - FileCatalog *fCatalog = fpanel->fileCatalog; - fpanel->ribbonPane->remove(*fCatalog); - epanel->catalogPane->add(*fCatalog); - fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Horizontal); - fCatalog->redrawAll(); - } + if(!options.tabbedUI && epanel->catalogPane->get_children().size() ==0 ) + MoveFileBrowserToEditor(); return false; // Gtk::VBox::on_expose_event(event); } @@ -341,13 +358,7 @@ bool RTWindow::on_expose_event_epanel(GdkEventExpose* event) bool RTWindow::on_expose_event_fpanel(GdkEventExpose* event) { - if(!options.tabbedUI && fpanel->ribbonPane->get_children().size() ==0 ){ - FileCatalog *fCatalog = fpanel->fileCatalog; - epanel->catalogPane->remove(*fCatalog); - //dirpaned->pack2(*fileCatalog,true,true); - fpanel->ribbonPane->add(*fCatalog); - fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Vertical); - fCatalog->redrawAll(); - } + if(!options.tabbedUI && fpanel->ribbonPane->get_children().size() ==0 ) + MoveFileBrowserToMain(); return false; // Gtk::HPaned::on_expose_event(event); } \ No newline at end of file diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index 0e293513d..afd4af067 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -67,6 +67,9 @@ class RTWindow : public Gtk::Window, public rtengine::ProgressListener{ rtengine::ProgressListener* getProgressListener () { return pldBridge; } EditorPanel* epanel; void SetEditorCurrent(); + void SetMainCurrent(); + void MoveFileBrowserToEditor(); + void MoveFileBrowserToMain(); }; #endif