diff --git a/rtdata/images/FullScreen_exit.png b/rtdata/images/FullScreen_exit.png new file mode 100644 index 000000000..2aeab4f80 Binary files /dev/null and b/rtdata/images/FullScreen_exit.png differ diff --git a/rtdata/images/crossed_arrows_out_45_02.png b/rtdata/images/crossed_arrows_out_45_02.png new file mode 100644 index 000000000..a5f90bf30 Binary files /dev/null and b/rtdata/images/crossed_arrows_out_45_02.png differ diff --git a/rtdata/images/fullscreen.png b/rtdata/images/fullscreen.png new file mode 100644 index 000000000..6ae9c498c Binary files /dev/null and b/rtdata/images/fullscreen.png differ diff --git a/rtdata/images/panel_to_bottom.png b/rtdata/images/panel_to_bottom.png new file mode 100644 index 000000000..8397d2fac Binary files /dev/null and b/rtdata/images/panel_to_bottom.png differ diff --git a/rtdata/images/panel_to_left.png b/rtdata/images/panel_to_left.png index 5a9455fd4..3ec0dee40 100644 Binary files a/rtdata/images/panel_to_left.png and b/rtdata/images/panel_to_left.png differ diff --git a/rtdata/images/panel_to_right.png b/rtdata/images/panel_to_right.png index ea324fd13..5932ee4da 100644 Binary files a/rtdata/images/panel_to_right.png and b/rtdata/images/panel_to_right.png differ diff --git a/rtdata/images/panel_to_top.png b/rtdata/images/panel_to_top.png new file mode 100644 index 000000000..fadb526be Binary files /dev/null and b/rtdata/images/panel_to_top.png differ diff --git a/rtdata/languages/default b/rtdata/languages/default index 40e8586b2..9e3acb996 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -322,6 +322,7 @@ MAIN_BUTTON_SAVEAS;As... MAIN_BUTTON_SAVE_TOOLTIP;Save current image Ctrl+S MAIN_BUTTON_SENDTOEDITOR;Send to editor MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Edit current image in external editor Ctrl+E +MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;Show/hide all side panels m MAIN_BUTTON_UNFULLSCREEN;Exit fullscreen MAIN_FRAME_BATCHQUEUE;Batch Queue MAIN_FRAME_BATCHQUEUE_TOOLTIP; Batch Queue Ctrl-F3 @@ -360,14 +361,16 @@ MAIN_TAB_TAGGING;Tagging MAIN_TAB_TRANSFORM;Transform MAIN_TOGGLE_BEFORE_AFTER;B|A MAIN_TOOLTIP_HIDEFP;Show/hide the bottom panel (directory and file browser) F -MAIN_TOOLTIP_HIDEHP;Show/hide the left panel (including the history) H +MAIN_TOOLTIP_HIDEHP;Show/hide the left panel (including the history) l MAIN_TOOLTIP_INDCLIPPEDH;Clipped highlight indication (Key <) MAIN_TOOLTIP_INDCLIPPEDS;Clipped shadow indication (Key >) MAIN_TOOLTIP_PREFERENCES;Set preferences MAIN_TOOLTIP_QINFO;Quick info on the image I MAIN_TOOLTIP_SAVE;Save image to the default folder MAIN_TOOLTIP_SAVEAS;Save image to a selected folder -MAIN_TOOLTIP_SHOWHIDELP1;Show/hide the left panel H +MAIN_TOOLTIP_SHOWHIDELP1;Show/hide the left panel l +MAIN_TOOLTIP_SHOWHIDERP1;Show/hide the right panel Alt-l +MAIN_TOOLTIP_SHOWHIDETP1;Show/hide the top panel Shift-l MAIN_TOOLTIP_TOGGLE;Toggle before/after view B NAVIGATOR_B_NA;B = n/a NAVIGATOR_B_VALUE;B = %1 @@ -579,7 +582,7 @@ SAVEDLG_SAVESPP;Save processing parameters with image SAVEDLG_TIFFFILTER;TIFF files SAVEDLG_TIFFUNCOMPRESSED;Uncompressed TIFF TOOLBAR_TOOLTIP_CROP;Crop selection C -TOOLBAR_TOOLTIP_HAND;Hand tool N +TOOLBAR_TOOLTIP_HAND;Hand tool H TOOLBAR_TOOLTIP_STRAIGHTEN;Straight line selection S TOOLBAR_TOOLTIP_WB;Spot white balance W TP_CACORRECTION_BLUE;Blue diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 53f4e93db..588d2a81b 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -44,7 +44,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be // build GUI // build left side panel leftbox = new Gtk::VBox (); - leftbox->set_border_width (4); + leftbox->set_border_width (2); leftbox->set_size_request(100,250); histogramPanel = Gtk::manage (new HistogramPanel ()); @@ -59,7 +59,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be navigator = Gtk::manage (new Navigator ()); navigator->previewWindow->set_size_request (-1, 150); - leftbox->pack_start (*navigator, Gtk::PACK_SHRINK, 4); + leftbox->pack_start (*navigator, Gtk::PACK_SHRINK, 2); history = Gtk::manage (new History ()); leftbox->pack_start (*history); @@ -86,6 +86,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be Gtk::VSeparator* vsepz = Gtk::manage (new Gtk::VSeparator ()); Gtk::VSeparator* vsepi = Gtk::manage (new Gtk::VSeparator ()); Gtk::VSeparator* vseph = Gtk::manage (new Gtk::VSeparator ()); + Gtk::VSeparator* vsep1 = Gtk::manage (new Gtk::VSeparator ()); hidehp = Gtk::manage (new Gtk::ToggleButton ()); @@ -102,8 +103,25 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be hidehp->set_image (*iHistoryShow); } + tbTopPanel_1 = new Gtk::ToggleButton (); + iTopPanel_1_Show = new Gtk::Image(argv0+"/images/panel_to_bottom.png"); + iTopPanel_1_Hide = new Gtk::Image(argv0+"/images/panel_to_top.png"); + tbTopPanel_1->set_relief(Gtk::RELIEF_NONE); + tbTopPanel_1->set_active (true); + tbTopPanel_1->set_tooltip_markup (M("MAIN_TOOLTIP_SHOWHIDETP1")); + tbTopPanel_1->set_image (*iTopPanel_1_Hide); + + tbRightPanel_1 = new Gtk::ToggleButton (); + iRightPanel_1_Show = new Gtk::Image(argv0+"/images/panel_to_left.png"); + iRightPanel_1_Hide = new Gtk::Image(argv0+"/images/panel_to_right.png"); + tbRightPanel_1->set_relief(Gtk::RELIEF_NONE); + tbRightPanel_1->set_active (true); + tbRightPanel_1->set_tooltip_markup (M("MAIN_TOOLTIP_SHOWHIDERP1")); + tbRightPanel_1->set_image (*iRightPanel_1_Hide); + Gtk::VSeparator* vsepcl = Gtk::manage (new Gtk::VSeparator ()); Gtk::VSeparator* vsepz2 = Gtk::manage (new Gtk::VSeparator ()); + Gtk::VSeparator* vsepz3 = Gtk::manage (new Gtk::VSeparator ()); iarea = new ImageAreaPanel (); @@ -115,8 +133,11 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be toolBarPanel->pack_start (*vsepi, Gtk::PACK_SHRINK, 2); toolBarPanel->pack_start (*tpc->getToolBar(), Gtk::PACK_SHRINK, 1); toolBarPanel->pack_start (*vsept, Gtk::PACK_SHRINK, 2); - toolBarPanel->pack_end (*tpc->coarse, Gtk::PACK_SHRINK, 4); - toolBarPanel->pack_end (*vsepcl, Gtk::PACK_SHRINK, 4); + + toolBarPanel->pack_end (*tbTopPanel_1, Gtk::PACK_SHRINK, 1); + toolBarPanel->pack_end (*vsep1, Gtk::PACK_SHRINK, 2); + toolBarPanel->pack_end (*tpc->coarse, Gtk::PACK_SHRINK, 2); + toolBarPanel->pack_end (*vsepcl, Gtk::PACK_SHRINK, 2); toolBarPanel->pack_end (*iarea->imageArea->indClippedPanel, Gtk::PACK_SHRINK, 0); toolBarPanel->pack_end (*vsepz, Gtk::PACK_SHRINK, 2); @@ -126,16 +147,16 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be beforeAfterBox = Gtk::manage (new Gtk::HBox()); beforeAfterBox->pack_start (*afterBox); - editbox->pack_start (*toolBarPanel, Gtk::PACK_SHRINK); + editbox->pack_start (*toolBarPanel, Gtk::PACK_SHRINK,0); editbox->pack_start (*beforeAfterBox); // build right side panel vboxright = new Gtk::VBox (false, 0); vboxright->set_size_request(100,250); - vboxright->set_border_width (4); - vboxright->pack_start (*histogramPanel, Gtk::PACK_SHRINK, 4); - vboxright->pack_start (*ppframe, Gtk::PACK_SHRINK, 4); + vboxright->set_border_width (2); + vboxright->pack_start (*histogramPanel, Gtk::PACK_SHRINK, 2); + vboxright->pack_start (*ppframe, Gtk::PACK_SHRINK, 2); // main notebook vboxright->pack_start (*tpc->toolPanelNotebook); @@ -176,16 +197,28 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be green = new Gtk::Image (argv0+"/images/green.png"); red->show (); green->show (); - statusBox->pack_end (*green, Gtk::PACK_SHRINK, 4); - iops->pack_start(*statusBox, Gtk::PACK_SHRINK, 4); + statusBox->pack_end (*green, Gtk::PACK_SHRINK, 2); + iops->pack_start(*statusBox, Gtk::PACK_SHRINK, 2); + + // tbRightPanel_1 + iops->pack_end (*tbRightPanel_1, Gtk::PACK_SHRINK,0); + + // ShowHideSidePanels + tbShowHideSidePanels = new Gtk::ToggleButton (); + iShowHideSidePanels = new Gtk::Image(argv0+"/images/crossed_arrows_out_45_02.png"); + tbShowHideSidePanels->set_relief(Gtk::RELIEF_NONE); + tbShowHideSidePanels->set_active (false); + tbShowHideSidePanels->set_tooltip_markup (M("MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP")); + tbShowHideSidePanels->set_image (*iShowHideSidePanels); + iops->pack_end (*tbShowHideSidePanels, Gtk::PACK_SHRINK,0); + iops->pack_end (*vsepz2, Gtk::PACK_SHRINK,1); // Zoom panel iops->pack_end (*iarea->imageArea->zoomPanel, Gtk::PACK_SHRINK, 1); - iops->pack_end (*vsepz2, Gtk::PACK_SHRINK, 2); + iops->pack_end (*vsepz3, Gtk::PACK_SHRINK, 2); - - editbox->pack_start (*Gtk::manage(new Gtk::HSeparator()), Gtk::PACK_SHRINK, 4); - editbox->pack_start (*iops, Gtk::PACK_SHRINK, 4); + editbox->pack_start (*Gtk::manage(new Gtk::HSeparator()), Gtk::PACK_SHRINK, 0); + editbox->pack_start (*iops, Gtk::PACK_SHRINK, 0); editbox->show_all (); // build screen @@ -249,10 +282,12 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be info->signal_toggled().connect( sigc::mem_fun(*this, &EditorPanel::info_toggled) ); beforeAfter->signal_toggled().connect( sigc::mem_fun(*this, &EditorPanel::beforeAfterToggled) ); hidehp->signal_toggled().connect( sigc::mem_fun(*this, &EditorPanel::hideHistoryActivated) ); + tbTopPanel_1->signal_toggled().connect( sigc::mem_fun(*this, &EditorPanel::tbTopPanel_1_toggled) ); + tbRightPanel_1->signal_toggled().connect( sigc::mem_fun(*this, &EditorPanel::tbRightPanel_1_toggled) ); saveimgas->signal_pressed().connect( sigc::mem_fun(*this, &EditorPanel::saveAsPressed) ); queueimg->signal_pressed().connect( sigc::mem_fun(*this, &EditorPanel::queueImgPressed) ); sendtogimp->signal_pressed().connect( sigc::mem_fun(*this, &EditorPanel::sendToGimpPressed) ); - + ShowHideSidePanelsconn = tbShowHideSidePanels->signal_toggled().connect ( sigc::mem_fun(*this, &EditorPanel::toggleSidePanels), true); } EditorPanel::~EditorPanel () { @@ -569,7 +604,7 @@ void EditorPanel::refreshProcessingState (bool inProcessing) { if (inProcessing) { if (processingStartedTime==0) processingStartedTime = ::time(NULL); - statusBox->pack_end (*red, Gtk::PACK_SHRINK, 4); + statusBox->pack_end (*red, Gtk::PACK_SHRINK, 2); } else { if (processingStartedTime!=0) { time_t curTime= ::time(NULL); @@ -579,7 +614,7 @@ void EditorPanel::refreshProcessingState (bool inProcessing) { processingStartedTime = 0; } - statusBox->pack_end (*green, Gtk::PACK_SHRINK, 4); + statusBox->pack_end (*green, Gtk::PACK_SHRINK, 2); } } @@ -671,12 +706,96 @@ void EditorPanel::hideHistoryActivated () { else { hidehp->set_image (*iHistoryShow); } + + tbShowHideSidePanels_managestate(); +} + + +void EditorPanel::tbRightPanel_1_toggled () { +/* + removeIfThere (hpanedr, vboxright, false); + if (tbRightPanel_1->get_active()){ + hpanedr->pack2(*vboxright, false, true); + tbRightPanel_1->set_image (*iRightPanel_1_Hide); + } + else { + tbRightPanel_1->set_image (*iRightPanel_1_Show); + } + tbShowHideSidePanels_managestate(); + */ + if (vboxright){ + if (tbRightPanel_1->get_active()){ + vboxright->show(); + tbRightPanel_1->set_image (*iRightPanel_1_Hide); + } + else{ + vboxright->hide(); + tbRightPanel_1->set_image (*iRightPanel_1_Show); + } + tbShowHideSidePanels_managestate(); + } +} + +void EditorPanel::tbTopPanel_1_visible (bool visible){ + if (visible) + tbTopPanel_1->show(); + else + tbTopPanel_1->hide(); +} + +void EditorPanel::tbTopPanel_1_toggled () { + + if (catalogPane){ // catalogPane does not exist in multitab mode + tbTopPanel_1_Active = tbTopPanel_1->get_active(); + + if (tbTopPanel_1_Active){ + catalogPane->show(); + tbTopPanel_1->set_image (*iTopPanel_1_Hide); + } + else { + catalogPane->hide(); + tbTopPanel_1->set_image (*iTopPanel_1_Show); + } + + tbShowHideSidePanels_managestate(); + } } bool EditorPanel::handleShortcutKey (GdkEventKey* event) { bool ctrl = event->state & GDK_CONTROL_MASK; bool shift = event->state & GDK_SHIFT_MASK; + bool alt = event->state & GDK_MOD1_MASK; + + + // Editor Layout + switch(event->keyval) { + case GDK_L: + tbTopPanel_1->set_active (!tbTopPanel_1->get_active()); // toggle top panel + if (ctrl) hidehp->set_active (!hidehp->get_active()); // toggle History (left panel) + if (alt) tbRightPanel_1->set_active (!tbRightPanel_1->get_active()); // toggle right panel + return true; + case GDK_l: + if (!shift && !alt /*&& !ctrl*/){ + hidehp->set_active (!hidehp->get_active()); // toggle History (left panel) + return true; + } + if (alt && !ctrl){ // toggle right panel + tbRightPanel_1->set_active (!tbRightPanel_1->get_active()); + return true; + } + if (alt && ctrl){ // toggle left and right panels + hidehp->set_active (!hidehp->get_active()); + tbRightPanel_1->set_active (!tbRightPanel_1->get_active()); + return true; + } + case GDK_m: // Maximize preview panel: hide top AND right AND history panels + if (!ctrl) toggleSidePanels(); + return true; + case GDK_M: // Maximize preview panel: hide top AND right AND history panels AND (fit image preview) + if (!ctrl) toggleSidePanelsZoomFit(); + return true; + } if (!ctrl) { // Normal @@ -688,10 +807,6 @@ bool EditorPanel::handleShortcutKey (GdkEventKey* event) { tpc->coarse->rotateLeft(); return true; - case GDK_h: - case GDK_H: - hidehp->set_active (!hidehp->get_active()); - return true; case GDK_i: case GDK_I: info->set_active (!info->get_active()); @@ -711,11 +826,10 @@ bool EditorPanel::handleShortcutKey (GdkEventKey* event) { case GDK_1: iarea->imageArea->zoomPanel->zoom11Clicked(); return true; + case GDK_f: - case GDK_F: iarea->imageArea->zoomPanel->zoomFitClicked(); return true; - case GDK_less: iarea->imageArea->indClippedPanel->toggleClipped(true); return true; @@ -1156,3 +1270,39 @@ void EditorPanel::histogramChanged (unsigned int* rh, unsigned int* gh, unsigned histogramPanel->histogramChanged (rh, gh, bh, lh); tpc->updateCurveBackgroundHistogram (bcrgb, bcl); } + +bool EditorPanel::CheckSidePanelsVisibility(){ + if(tbTopPanel_1->get_active()==false && tbRightPanel_1->get_active()==false && hidehp->get_active()==false) + return false; + else + return true; +} +void EditorPanel::toggleSidePanels(){ + // Maximize preview panel: + // toggle top AND right AND history panels + + bool bAllSidePanelsVisible; + bAllSidePanelsVisible= CheckSidePanelsVisibility(); + + tbTopPanel_1->set_active (!bAllSidePanelsVisible); + tbRightPanel_1->set_active (!bAllSidePanelsVisible); + hidehp->set_active (!bAllSidePanelsVisible); +} + +void EditorPanel::toggleSidePanelsZoomFit(){ + toggleSidePanels(); + + // fit image preview + // !!! TODO this does not want to work... seems to have an effect on a subsequent key press + // iarea->imageArea->zoomPanel->zoomFitClicked(); +} + +void EditorPanel::tbShowHideSidePanels_managestate(){ + bool bAllSidePanelsVisible; + bAllSidePanelsVisible = CheckSidePanelsVisibility(); + ShowHideSidePanelsconn.block (true); + + tbShowHideSidePanels->set_active (!bAllSidePanelsVisible); + + ShowHideSidePanelsconn.block (false); +} diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index ade69f5ca..8ce26ad63 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -54,6 +54,12 @@ class EditorPanel : public Gtk::VBox, Gtk::Label *progressLabel; Gtk::ToggleButton* info; Gtk::ToggleButton* hidehp; + Gtk::ToggleButton* tbShowHideSidePanels; + Gtk::ToggleButton* tbTopPanel_1; + Gtk::ToggleButton* tbRightPanel_1; + bool tbTopPanel_1_Active; + bool tbRightPanel_1_Active; + //bool bAllSidePanelsVisible; Gtk::ToggleButton* beforeAfter; Gtk::HPaned* hpanedl; Gtk::HPaned* hpanedr; @@ -61,6 +67,9 @@ class EditorPanel : public Gtk::VBox, Gtk::Image* red; Gtk::Image* green; Gtk::Image *iHistoryShow, *iHistoryHide; + Gtk::Image *iTopPanel_1_Show, *iTopPanel_1_Hide; + Gtk::Image *iRightPanel_1_Show, *iRightPanel_1_Hide; + Gtk::Image *iShowHideSidePanels; Gtk::VBox* leftbox, *vboxright; Gtk::Button* queueimg; @@ -109,6 +118,8 @@ class EditorPanel : public Gtk::VBox, time_t processingStartedTime; + sigc::connection ShowHideSidePanelsconn; + public: EditorPanel (FilePanel* filePanel = NULL); @@ -145,11 +156,19 @@ class EditorPanel : public Gtk::VBox, // event handlers void info_toggled (); void hideHistoryActivated (); + void tbRightPanel_1_toggled (); + void tbTopPanel_1_toggled (); void beforeAfterToggled (); void saveAsPressed (); void queueImgPressed (); void sendToGimpPressed (); + void tbTopPanel_1_visible (bool visible); + bool CheckSidePanelsVisibility(); + void tbShowHideSidePanels_managestate(); + void toggleSidePanels(); + void toggleSidePanelsZoomFit(); + void saveProfile (); Glib::ustring getShortName (); Glib::ustring getFileName (); diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index d49f648ff..38a81405e 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -90,7 +90,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : tbLeftPanel_1->set_active (true); tbLeftPanel_1->set_tooltip_markup (M("MAIN_TOOLTIP_SHOWHIDELP1")); tbLeftPanel_1->set_image (*iLeftPanel_1_Hide); - tbLeftPanel_1->signal_toggled().connect( sigc::mem_fun(*this, &FileCatalog::tbLeftPanel_1_Activated) ); + tbLeftPanel_1->signal_toggled().connect( sigc::mem_fun(*this, &FileCatalog::tbLeftPanel_1_toggled) ); buttonBar->pack_start (*tbLeftPanel_1, Gtk::PACK_SHRINK); buttonBar->pack_start (*(new Gtk::VSeparator), Gtk::PACK_SHRINK); @@ -208,6 +208,17 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : buttonBar->pack_start (*hbBrowsePath, Gtk::PACK_EXPAND_WIDGET,4); buttonBrowsePath->signal_clicked().connect( sigc::mem_fun(*this, &FileCatalog::buttonBrowsePathPressed) ); + tbRightPanel_1 = new Gtk::ToggleButton (); + iRightPanel_1_Show = new Gtk::Image(argv0+"/images/panel_to_left.png"); + iRightPanel_1_Hide = new Gtk::Image(argv0+"/images/panel_to_right.png"); + + tbRightPanel_1->set_relief(Gtk::RELIEF_NONE); + tbRightPanel_1->set_active (true); + tbRightPanel_1->set_tooltip_markup (M("MAIN_TOOLTIP_SHOWHIDERP1")); + tbRightPanel_1->set_image (*iRightPanel_1_Hide); + tbRightPanel_1->signal_toggled().connect( sigc::mem_fun(*this, &FileCatalog::tbRightPanel_1_toggled) ); + buttonBar->pack_end (*tbRightPanel_1, Gtk::PACK_SHRINK); + buttonBar->pack_end (*coarsePanel, Gtk::PACK_SHRINK); buttonBar->pack_end (*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK, 4); buttonBar->pack_end (*toolBar, Gtk::PACK_SHRINK); @@ -961,28 +972,73 @@ void FileCatalog::tbLeftPanel_1_visible (bool visible){ else tbLeftPanel_1->hide(); } -void FileCatalog::tbLeftPanel_1_Activated () { +void FileCatalog::tbRightPanel_1_visible (bool visible){ + if (visible) + tbRightPanel_1->show(); + else + tbRightPanel_1->hide(); +} +void FileCatalog::tbLeftPanel_1_toggled () { removeIfThere (filepanel->dirpaned, filepanel->placespaned, false); - if (tbLeftPanel_1->get_active()) + if (tbLeftPanel_1->get_active()){ filepanel->dirpaned->pack1 (*filepanel->placespaned, false, true); - - tbLeftPanel_1_Active = tbLeftPanel_1->get_active(); - - if (tbLeftPanel_1_Active){ - tbLeftPanel_1->set_image (*iLeftPanel_1_Hide); + tbLeftPanel_1->set_image (*iLeftPanel_1_Hide); } else { tbLeftPanel_1->set_image (*iLeftPanel_1_Show); } - } + +void FileCatalog::tbRightPanel_1_toggled () { + if (tbRightPanel_1->get_active()){ + filepanel->rightBox->show(); + tbRightPanel_1->set_image (*iRightPanel_1_Hide); + } + else{ + filepanel->rightBox->hide(); + tbRightPanel_1->set_image (*iRightPanel_1_Show); + } +} + +bool FileCatalog::CheckSidePanelsVisibility(){ + if(tbLeftPanel_1->get_active()==false && tbRightPanel_1->get_active()==false) + return false; + else + return true; +} +void FileCatalog::toggleSidePanels(){ + // toggle left AND right panels + + bool bAllSidePanelsVisible; + bAllSidePanelsVisible= CheckSidePanelsVisibility(); + + tbLeftPanel_1->set_active (!bAllSidePanelsVisible); + tbRightPanel_1->set_active (!bAllSidePanelsVisible); +} + bool FileCatalog::handleShortcutKey (GdkEventKey* event) { bool ctrl = event->state & GDK_CONTROL_MASK; bool shift = event->state & GDK_SHIFT_MASK; + bool alt = event->state & GDK_MOD1_MASK; modifierKey = event->state; + // GUI Layout + switch(event->keyval) { + case GDK_l: + if (!alt)tbLeftPanel_1->set_active (!tbLeftPanel_1->get_active()); // toggle left panel + if (alt && !ctrl) tbRightPanel_1->set_active (!tbRightPanel_1->get_active()); // toggle right panel + if (alt && ctrl) { + tbLeftPanel_1->set_active (!tbLeftPanel_1->get_active()); // toggle left panel + tbRightPanel_1->set_active (!tbRightPanel_1->get_active()); // toggle right panel + } + return true; + case GDK_m: + if (!ctrl) toggleSidePanels(); + return true; + } + switch(event->keyval) { case GDK_1: categoryButtonToggled(bRank[0]); @@ -1025,11 +1081,6 @@ bool FileCatalog::handleShortcutKey (GdkEventKey* event) { case GDK_bracketleft: coarsePanel->rotateLeft(); return true; - - case GDK_h: - case GDK_H: - tbLeftPanel_1->set_active (!tbLeftPanel_1->get_active()); - return true; case GDK_i: case GDK_I: exifInfo->set_active (!exifInfo->get_active()); diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index 1a731c295..798760488 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -75,7 +75,7 @@ class FileCatalog : public Gtk::VBox, Gtk::HBox* buttonBar; Gtk::HBox* buttonBar2; Gtk::ToggleButton* tbLeftPanel_1; - bool tbLeftPanel_1_Active; + Gtk::ToggleButton* tbRightPanel_1; Gtk::ToggleButton* bDir; Gtk::ToggleButton* bUnRanked; Gtk::ToggleButton* bRank[5]; @@ -84,7 +84,9 @@ class FileCatalog : public Gtk::VBox, Gtk::ToggleButton* exifInfo; sigc::connection bCateg[8]; Gtk::Image* iranked[5], *igranked[5]; - Gtk::Image *iTrashEmpty, *iTrashFull, *iRightArrow_red, *iRightArrow, *iLeftPanel_1_Show, *iLeftPanel_1_Hide; + Gtk::Image *iTrashEmpty, *iTrashFull; + Gtk::Image *iRightArrow_red, *iRightArrow; + Gtk::Image *iLeftPanel_1_Show, *iLeftPanel_1_Hide, *iRightPanel_1_Show, *iRightPanel_1_Hide; Gtk::Entry* BrowsePath; Gtk::Button* buttonBrowsePath; sigc::connection BrowsePathconn; @@ -187,15 +189,19 @@ class FileCatalog : public Gtk::VBox, void zoomOut (); void buttonBrowsePathPressed (); - void tbLeftPanel_1_Activated (); + + void tbLeftPanel_1_toggled (); void tbLeftPanel_1_visible (bool visible); + void tbRightPanel_1_toggled (); + void tbRightPanel_1_visible (bool visible); void openNextImage () { fileBrowser->openNextImage(); } void openPrevImage () { fileBrowser->openPrevImage(); } bool handleShortcutKey (GdkEventKey* event); - + bool CheckSidePanelsVisibility(); + void toggleSidePanels(); }; #endif diff --git a/rtgui/filepanel.h b/rtgui/filepanel.h index a3412adb9..f392f1e7b 100644 --- a/rtgui/filepanel.h +++ b/rtgui/filepanel.h @@ -42,7 +42,7 @@ class FilePanel : public Gtk::HPaned, PlacesBrowser* placesBrowser; RecentBrowser* recentBrowser; // FileCatalog* fileCatalog; // filecatalog is the file browser with the button bar above it - Gtk::HBox* rightBox; + Gtk::VPaned* tpcPaned; BatchToolPanelCoordinator* tpc; History* history; @@ -58,7 +58,9 @@ class FilePanel : public Gtk::HPaned, Gtk::Paned* placespaned; Gtk::HPaned* dirpaned; - DirBrowser* dirBrowser; + Gtk::HBox* rightBox; + + DirBrowser* dirBrowser; FilterPanel* filterPanel; FileCatalog* fileCatalog; Gtk::Paned *ribbonPane; diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 62c3c3344..584ef333b 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -119,6 +119,7 @@ RTWindow::RTWindow () vbe->set_spacing (2); vbe->set_tooltip_markup (M("MAIN_FRAME_EDITOR_TOOLTIP")); vbe->show_all (); + epanel->tbTopPanel_1_visible(true); //show the toggle Top Panel button mainNB->append_page (*epanel, *vbe); } else { Gtk::HBox* hbe = Gtk::manage (new Gtk::HBox ()); @@ -127,6 +128,7 @@ RTWindow::RTWindow () hbe->set_spacing (2); hbe->set_tooltip_markup (M("MAIN_FRAME_EDITOR_TOOLTIP")); hbe->show_all (); + epanel->tbTopPanel_1_visible(true); //show the toggle Top Panel button mainNB->append_page (*epanel, *hbe); } @@ -140,19 +142,27 @@ RTWindow::RTWindow () mainBox->pack_start (*bottomBox, Gtk::PACK_SHRINK, 1); // filling bottom box + iFullScreen = new Gtk::Image(argv0+"/images/fullscreen.png"); + iFullScreen_exit = new Gtk::Image(argv0+"/images/fullscreen_exit.png"); + Gtk::LinkButton* rtWeb = Gtk::manage (new Gtk::LinkButton ("http://rawtherapee.com")); - Gtk::Button* preferences = Gtk::manage (new Gtk::Button (M("MAIN_BUTTON_PREFERENCES")+"...")); + //Gtk::Button* preferences = Gtk::manage (new Gtk::Button (M("MAIN_BUTTON_PREFERENCES")+"...")); + Gtk::Button* preferences = Gtk::manage (new Gtk::Button ()); preferences->set_image (*Gtk::manage(new Gtk::Image (Gtk::StockID("gtk-preferences"), Gtk::ICON_SIZE_BUTTON))); + preferences->set_tooltip_markup (M("MAIN_BUTTON_PREFERENCES")); preferences->signal_clicked().connect( sigc::mem_fun(*this, &RTWindow::showPreferences) ); is_fullscreen = false; - btn_fullscreen = Gtk::manage( new Gtk::Button(M("MAIN_BUTTON_FULLSCREEN"))); + //btn_fullscreen = Gtk::manage( new Gtk::Button(M("MAIN_BUTTON_FULLSCREEN"))); + btn_fullscreen = Gtk::manage( new Gtk::Button()); + btn_fullscreen->set_tooltip_markup (M("MAIN_BUTTON_FULLSCREEN")); + btn_fullscreen->set_image (*iFullScreen); btn_fullscreen->signal_clicked().connect( sigc::mem_fun(*this, &RTWindow::toggle_fullscreen) ); bottomBox->pack_start (*preferences, Gtk::PACK_SHRINK, 0); - bottomBox->pack_end (*btn_fullscreen, Gtk::PACK_SHRINK, 4); - bottomBox->pack_start (*rtWeb, Gtk::PACK_SHRINK, 4); + bottomBox->pack_end (*btn_fullscreen, Gtk::PACK_SHRINK, 1); + bottomBox->pack_start (*rtWeb, Gtk::PACK_SHRINK, 1); bottomBox->pack_start (prLabel ); prLabel.set_alignment(Gtk::ALIGN_RIGHT); - bottomBox->pack_start (prProgBar, Gtk::PACK_SHRINK, 4); + bottomBox->pack_start (prProgBar, Gtk::PACK_SHRINK, 1); pldBridge = new PLDBridge(&prLabel,&prProgBar); @@ -240,6 +250,7 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) { epanels[ name ] = ep; filesEdited.insert ( name ); fpanel->refreshEditedState (filesEdited); + ep->tbTopPanel_1_visible(false); //hide the toggle Top Panel button } } @@ -371,11 +382,15 @@ void RTWindow::toggle_fullscreen () { if (is_fullscreen) { unfullscreen(); is_fullscreen = false; - btn_fullscreen->set_label(M("MAIN_BUTTON_FULLSCREEN")); + //btn_fullscreen->set_label(M("MAIN_BUTTON_FULLSCREEN")); + btn_fullscreen->set_tooltip_markup(M("MAIN_BUTTON_FULLSCREEN")); + btn_fullscreen->set_image (*iFullScreen); } else { fullscreen(); is_fullscreen = true; - btn_fullscreen->set_label(M("MAIN_BUTTON_UNFULLSCREEN")); + //btn_fullscreen->set_label(M("MAIN_BUTTON_UNFULLSCREEN")); + btn_fullscreen->set_tooltip_markup(M("MAIN_BUTTON_UNFULLSCREEN")); + btn_fullscreen->set_image (*iFullScreen_exit); } } @@ -402,6 +417,7 @@ void RTWindow::MoveFileBrowserToMain() fpanel->ribbonPane->add(*fCatalog); fCatalog->enableTabMode(false); fCatalog->tbLeftPanel_1_visible(true); + fCatalog->tbRightPanel_1_visible(true); } } @@ -415,6 +431,7 @@ void RTWindow::MoveFileBrowserToEditor() fCatalog->enableTabMode(true); fCatalog->refreshHeight(); fCatalog->tbLeftPanel_1_visible(false); + fCatalog->tbRightPanel_1_visible(false); } } diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index 26ae3be85..42a82546b 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -40,6 +40,8 @@ class RTWindow : public Gtk::Window, public rtengine::ProgressListener{ bool is_fullscreen; Gtk::Button * btn_fullscreen; + Gtk::Image *iFullScreen, *iFullScreen_exit; + bool isSingleTabMode() { return !options.tabbedUI && !EditWindow::isMultiDisplayEnabled(); }; bool on_expose_event_epanel(GdkEventExpose* event); diff --git a/rtgui/toolbar.cc b/rtgui/toolbar.cc index cc3830313..52f3298be 100644 --- a/rtgui/toolbar.cc +++ b/rtgui/toolbar.cc @@ -213,8 +213,8 @@ bool ToolBar::handleShortcutKey (GdkEventKey* event) { case GDK_S: stra_pressed (); return true; - case GDK_n: - case GDK_N: + case GDK_h: + case GDK_H: hand_pressed (); return true; }