From 08b967f62b54956f4994eab2b263c49b4a9ebbf3 Mon Sep 17 00:00:00 2001 From: natureh Date: Sun, 18 Sep 2011 15:39:21 +0200 Subject: [PATCH] Patch from issue 975 on behalf of Phil: "Proposition of a patch right Pannel (new visual rendering <-> icons instead of text)" It moreover better handle workflow changes: no need to restart RT for some options. --- rtdata/images/colour-24.png | Bin 0 -> 1202 bytes rtdata/images/detail-24.png | Bin 0 -> 1693 bytes rtdata/images/exif-24.png | Bin 0 -> 912 bytes rtdata/images/exposure-24.png | Bin 0 -> 702 bytes rtdata/images/raw-24.png | Bin 0 -> 338 bytes rtdata/images/transform-24.png | Bin 0 -> 1521 bytes rtdata/languages/Francais | 4 +- rtdata/languages/default | 4 +- rtgui/batchtoolpanelcoord.cc | 2 + rtgui/editorpanel.cc | 92 +++++++++++++++++++++++++++++---- rtgui/editorpanel.h | 7 ++- rtgui/filecatalog.cc | 18 +++++++ rtgui/filecatalog.h | 1 + rtgui/filepanel.cc | 4 ++ rtgui/filepanel.h | 1 + rtgui/guiutils.cc | 45 ++++++++++++++++ rtgui/guiutils.h | 42 +++++++++++++++ rtgui/histogrampanel.cc | 14 ++++- rtgui/histogrampanel.h | 2 + rtgui/options.cc | 3 ++ rtgui/options.h | 1 + rtgui/preferences.cc | 33 +++++++++++- rtgui/preferences.h | 1 + rtgui/rtwindow.cc | 32 ++++++++++++ rtgui/rtwindow.h | 4 ++ rtgui/toolpanelcoord.cc | 72 +++++++++++--------------- rtgui/toolpanelcoord.h | 22 ++++++++ 27 files changed, 345 insertions(+), 59 deletions(-) create mode 100644 rtdata/images/colour-24.png create mode 100644 rtdata/images/detail-24.png create mode 100644 rtdata/images/exif-24.png create mode 100644 rtdata/images/exposure-24.png create mode 100644 rtdata/images/raw-24.png create mode 100644 rtdata/images/transform-24.png diff --git a/rtdata/images/colour-24.png b/rtdata/images/colour-24.png new file mode 100644 index 0000000000000000000000000000000000000000..2681422ae128457ef4a01e722505984eac7fadd9 GIT binary patch literal 1202 zcmV;j1Wo&iP)>VPTP=c!&y$aSd@)%ow$`jcwcMq-qYD5H;Bu2KL?h zRn>c6ef9NMML6eJTwJ680s#B~>;MRU4jjNefUf`!`}+DAi9{k4Ko~mXNn^gOSvHu>X88Sny|J+ok|eQ2BEhrStm)w3;6qne*VpeFEG;e7pP!$98XX;V z5JH3kFU#`v=H_N5pUq6q{C8SN|+)5RbnYiW^ZpVv%I{Vuvjdv0`GJ>-)(Pizkg$JadF|%b-g$- zm&-XeHa6S~3kz0F(_ZUC(=^P?%$WE0_dSG=VlShVx-Tv+iUm-tqT1Tp%Ty{Q>$>hO zaQS@REeOJw$;nAgQ54-~vl#$DQIx#RW;4~*)iI;dSYK+)7`v;jt-X9>(9zM6Iz2so z0N^cMKq+;JqIhSuT184}?pegBs_N%)SDEEqIj>WszeBR(H$9M z&S*5s3c`#rBLKu=v7EtRc-@1t@pxPkMe+WP0RRjS53lLEeu}4?sR&7u?1@C8_yZ-A z$)w-!fA>22WHNc$-`~Gh${B`-hXZ)-s4kaF=bT?29UVCYK`=AMEYFcwrBW%Ps_Iob zoxU}hOb&y=P)sEuB(t-#bJEn*^mluE`%Q^HCy_|x4*)NsQ53~6J3AZHG|fv0u@geT z7<GMW2qHhVQPGO}T_+46Xa42eV{zW``P1u({luIt2N zv9MBJ(==)_nK-4CS6U0;Ukcz5PZxAqP)hl0aR9JbEbKetGJr$!e?MEk0T+kx&4Ha0 QHvj+t07*qoM6N<$g7IoBdjJ3c literal 0 HcmV?d00001 diff --git a/rtdata/images/detail-24.png b/rtdata/images/detail-24.png new file mode 100644 index 0000000000000000000000000000000000000000..116e21a86871c2f0f94a753aba30e8e0f0fb3b55 GIT binary patch literal 1693 zcmV;O24eY%P)HxkhFE0zSy1GgM{1d<_0Epw5BuPSD*JZ6%OKG>;isLwn z@B2JS5()r}F`=qzr0aTEC=|kCu^4KamMDrMD5V+xhYo;$v%d0Ua^LrvZQHz7tL5wU zy3uO24A*tlFbtJ6Okeh~t>J zt}EB;^`ZU!{Z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yS|Po6wEp;RjWplO;_UtfQIdU`sW%jLcyNpeSfhXK94y)YOIJ5tnWG_MaFIM93M z%o#UL(+~=UFc=Ji>FMc`qN1X1KA-=F%jG&wo;-PPw=D`EQ>|8ugoFgR-EO#Cu6Vs( z|MRu^z-vWf>p00000NkvXXu0mjfw!Oog literal 0 HcmV?d00001 diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index 48b79113d..8d5b6b572 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -681,7 +681,9 @@ PREFERENCES_TAB_IMPROC;Traitement de l'image PREFERENCES_TAB_OUTPUT;Options de sortie PREFERENCES_TAB_SOUND;Sons PREFERENCES_THUMBSIZE;Tailles des vignettes -PREFERENCES_TP_VSCROLLBAR;Cacher la barre de défilement verticale du panneau des outils +PREFERENCES_TP_LABEL;Panneau des outils: +PREFERENCES_TP_USEICONORTEXT;Utiliser des icônes au lieu de textes +PREFERENCES_TP_VSCROLLBAR;Cacher la barre de défilement verticale PREFERENCES_TUNNELMETADATA;Copier les données IPTC/XMP sans les\nchanger dans fichier de sortie PREFERENCES_USESYSTEMTHEME;Utiliser le thème système PREFERENCES_WORKFLOW;Habitudes de travail diff --git a/rtdata/languages/default b/rtdata/languages/default index 16cd380a3..c52e8be89 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -676,7 +676,9 @@ PREFERENCES_TAB_IMPROC;Image Processing PREFERENCES_TAB_OUTPUT;Output Options PREFERENCES_TAB_SOUND;Sounds PREFERENCES_THUMBSIZE;Thumbnail Size -PREFERENCES_TP_VSCROLLBAR;Hide tool panel's vertical scrollbar +PREFERENCES_TP_LABEL;Tool panel: +PREFERENCES_TP_USEICONORTEXT;Use tab icons instead of text +PREFERENCES_TP_VSCROLLBAR;Hide vertical scrollbar PREFERENCES_TUNNELMETADATA;Copy IPTC/XMP unchanged to output file (when tagging with other program) PREFERENCES_USESYSTEMTHEME; Use System Theme PREFERENCES_WORKFLOW;Layout diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index 79b6ab052..3aacb213c 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -35,6 +35,8 @@ BatchToolPanelCoordinator::BatchToolPanelCoordinator (FilePanel* parent) : ToolP if (ipi!=toolPanels.end()) toolPanels.erase (ipi); toolPanelNotebook->remove_page (*metadataPanel); + metadataPanel = 0; + toiM = 0; for (int i=0; isetBatchMode (true); diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 77f810e3d..792ecf1e5 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -50,13 +50,10 @@ EditorPanel::EditorPanel (FilePanel* filePanel) leftbox->set_border_width (2); leftbox->set_size_request(100,250); - if (options.histogramPosition>0) { - histogramPanel = Gtk::manage (new HistogramPanel ()); - if (options.histogramPosition==1) leftbox->pack_start (*histogramPanel, Gtk::PACK_SHRINK, 4); - } else histogramPanel = NULL; + histogramPanel = NULL; profilep = Gtk::manage (new ProfilePanel ()); - Gtk::Frame* ppframe = Gtk::manage (new Gtk::Frame ()); + ppframe = new Gtk::Frame (); ppframe->add (*profilep); ppframe->set_label (M("PROFILEPANEL_LABEL")); //leftbox->pack_start (*ppframe, Gtk::PACK_SHRINK, 4); @@ -160,7 +157,6 @@ EditorPanel::EditorPanel (FilePanel* filePanel) vboxright->set_border_width (2); - if (options.histogramPosition==2) vboxright->pack_start (*histogramPanel, Gtk::PACK_SHRINK, 2); if (options.showProfileSelector) vboxright->pack_start (*ppframe, Gtk::PACK_SHRINK, 2); // main notebook vboxright->pack_start (*tpc->toolPanelNotebook); @@ -251,6 +247,9 @@ EditorPanel::EditorPanel (FilePanel* filePanel) hpanedr->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &EditorPanel::rightPaneButtonReleased) ); pack_start (*hpanedr); + + updateHistogramPosition (0, options.histogramPosition); + show_all (); // save as dialog @@ -270,7 +269,6 @@ EditorPanel::EditorPanel (FilePanel* filePanel) tpc->addPParamsChangeListener (this); iarea->imageArea->setCropGUIListener (tpc->getCropGUIListener()); iarea->imageArea->setPointerMotionListener (navigator); - iarea->imageArea->setPointerMotionHListener (histogramPanel); iarea->imageArea->setImageAreaToolListener (tpc); // initialize components @@ -321,6 +319,7 @@ EditorPanel::~EditorPanel () { delete tpc; + delete ppframe; delete leftbox; delete vboxright; delete saveAsDialog; @@ -1286,7 +1285,7 @@ void EditorPanel::histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & his tpc->updateCurveBackgroundHistogram (histToneCurve, histLCurve); } -bool EditorPanel::CheckSidePanelsVisibility(){ +bool EditorPanel::CheckSidePanelsVisibility() { if(tbTopPanel_1->get_active()==false && tbRightPanel_1->get_active()==false && hidehp->get_active()==false) return false; else @@ -1304,7 +1303,7 @@ void EditorPanel::toggleSidePanels(){ hidehp->set_active (!bAllSidePanelsVisible); } -void EditorPanel::toggleSidePanelsZoomFit(){ +void EditorPanel::toggleSidePanelsZoomFit() { toggleSidePanels(); // fit image preview @@ -1312,7 +1311,7 @@ void EditorPanel::toggleSidePanelsZoomFit(){ // iarea->imageArea->zoomPanel->zoomFitClicked(); } -void EditorPanel::tbShowHideSidePanels_managestate(){ +void EditorPanel::tbShowHideSidePanels_managestate() { bool bAllSidePanelsVisible; bAllSidePanelsVisible = CheckSidePanelsVisibility(); ShowHideSidePanelsconn.block (true); @@ -1325,3 +1324,76 @@ void EditorPanel::tbShowHideSidePanels_managestate(){ void EditorPanel::updateTPVScrollbar (bool hide) { tpc->updateTPVScrollbar (hide); } + +void EditorPanel::updateTabsUsesIcons (bool useIcons) { + tpc->updateTabsUsesIcons (useIcons); +} + +void EditorPanel::updateProfileSelector (bool showMe) { + if (showMe) { + // add the profile panel + vboxright->pack_start (*ppframe, Gtk::PACK_SHRINK, 2); + vboxright->reorder_child(*ppframe, 0 + (options.histogramPosition==2?1:0)); + ppframe->show_all(); + } + else { + // remove (but don't delete) the profile panel + removeIfThere(vboxright, ppframe, false); + } +} + +void EditorPanel::updateHistogramPosition (int oldPosition, int newPosition) { + + switch (newPosition) { + case 0: + // No histogram + if (!oldPosition) { + // An histogram actually exist, we delete it + if (oldPosition == 1) + removeIfThere(leftbox, histogramPanel, false); + else if (oldPosition == 2) + removeIfThere(vboxright, histogramPanel, false); + delete histogramPanel; + histogramPanel = NULL; + } + // else no need to create it + break; + case 1: + // Histogram on the left pane + if (oldPosition == 0) { + // There was no Histogram before, so we create it + histogramPanel = Gtk::manage (new HistogramPanel ()); + leftbox->pack_start (*histogramPanel, Gtk::PACK_SHRINK, 2); + } + else if (oldPosition == 2) { + // The histogram was on the right side, so we move it to the left + histogramPanel->reference(); + removeIfThere(vboxright, histogramPanel, false); + leftbox->pack_start (*histogramPanel, Gtk::PACK_SHRINK, 2); + histogramPanel->unreference(); + } + histogramPanel->reorder(Gtk::ALIGN_LEFT); + leftbox->reorder_child(*histogramPanel, 0); + break; + case 2: + default: + // Histogram on the right pane + if (oldPosition == 0) { + // There was no Histogram before, so we create it + histogramPanel = Gtk::manage (new HistogramPanel ()); + vboxright->pack_start (*histogramPanel, Gtk::PACK_SHRINK, 2); + } + else if (oldPosition == 1) { + // The histogram was on the left side, so we move it to the right + histogramPanel->reference(); + removeIfThere(leftbox, histogramPanel, false); + vboxright->pack_start (*histogramPanel, Gtk::PACK_SHRINK, 2); + histogramPanel->unreference(); + } + histogramPanel->reorder(Gtk::ALIGN_RIGHT); + vboxright->reorder_child(*histogramPanel, 0); + break; + } + + iarea->imageArea->setPointerMotionHListener (histogramPanel); +} diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 9d2d8b348..6e8ee6fcf 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -68,7 +68,8 @@ class EditorPanel : public Gtk::VBox, Gtk::Image *iTopPanel_1_Show, *iTopPanel_1_Hide; Gtk::Image *iRightPanel_1_Show, *iRightPanel_1_Hide; Gtk::Image *iShowHideSidePanels; - Gtk::VBox* leftbox, *vboxright; + Gtk::VBox *leftbox; + Gtk::VBox *vboxright; Gtk::Button* queueimg; Gtk::Button* saveimgas; @@ -85,6 +86,7 @@ class EditorPanel : public Gtk::VBox, Gtk::Label* afterLabel; Gtk::HBox* beforeAfterBox; + Gtk::Frame* ppframe; ProfilePanel* profilep; History* history; HistogramPanel* histogramPanel; @@ -177,7 +179,10 @@ class EditorPanel : public Gtk::VBox, bool handleShortcutKey (GdkEventKey* event); bool getIsProcessing() const { return isProcessing; } + void updateProfileSelector(bool showMe); void updateTPVScrollbar (bool hide); + void updateTabsUsesIcons (bool useIcons); + void updateHistogramPosition (int oldPosition, int newPosition); Gtk::Paned *catalogPane; }; diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index b35afe9f4..6cad42963 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -1443,6 +1443,24 @@ void FileCatalog::executeQuery(){ FileCatalog::filterChanged (); } +void FileCatalog::updateFBQueryTB (bool singleRow) { + hbToolBar1->reference(); + if (singleRow) { + bool removed = removeIfThere(this, hbToolBar1, false); + if (removed) { + buttonBar->pack_start(*hbToolBar1, Gtk::PACK_EXPAND_WIDGET, 0); + } + } + else { + bool removed = removeIfThere(buttonBar, hbToolBar1, false); + if (removed) { + pack_start(*hbToolBar1, Gtk::PACK_SHRINK, 0); + reorder_child(*hbToolBar1, 0); + } + } + hbToolBar1->unreference(); +} + void FileCatalog::buttonBrowsePathPressed () { Glib::ustring BrowsePathValue = BrowsePath->get_text(); Glib::ustring DecodedPathPrefix=""; diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index a3c5ab341..c2519495f 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -218,6 +218,7 @@ class FileCatalog : public Gtk::VBox, void buttonBrowsePathPressed (); void buttonQueryClearPressed (); void executeQuery (); + void updateFBQueryTB (bool singleRow); void tbLeftPanel_1_toggled (); void tbLeftPanel_1_visible (bool visible); diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 6204d31fc..c34a36261 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -256,3 +256,7 @@ void FilePanel::loadingThumbs(Glib::ustring str, double rate) void FilePanel::updateTPVScrollbar (bool hide) { tpc->updateTPVScrollbar (hide); } + +void FilePanel::updateTabsUsesIcons (bool useIcons) { + tpc->updateTabsUsesIcons (useIcons); +} diff --git a/rtgui/filepanel.h b/rtgui/filepanel.h index bc6adbd02..bc57cbf8c 100644 --- a/rtgui/filepanel.h +++ b/rtgui/filepanel.h @@ -83,6 +83,7 @@ class FilePanel : public Gtk::HPaned, bool handleShortcutKey (GdkEventKey* event); void updateTPVScrollbar (bool hide); + void updateTabsUsesIcons (bool useIcons); }; #endif diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index ef0e06dd7..5229eda69 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -351,3 +351,48 @@ bool MyFileChooserButton::on_scroll_event (GdkEventScroll* event) { // ... otherwise the scroll event is sent back to an upper level return false; } + +TextOrIcon::TextOrIcon (Glib::ustring fname, Glib::ustring labelTx, Glib::ustring tooltipTx, TOITypes type) { + + imgIcon = 0; + label = 0; + filename = fname; + labelText = labelTx; + tooltipText = tooltipTx; + + switchTo(type); +} + +TextOrIcon::~TextOrIcon () { + if (imgIcon) delete imgIcon; + if (label) delete label; +} + +void TextOrIcon::switchTo(TOITypes type) { + switch (type) { + case (TOI_ICON): + if (!imgIcon) { + removeIfThere(this, label, false); + delete label; + label = 0; + imgIcon = new Gtk::Image (filename); + pack_start(*imgIcon, Gtk::PACK_SHRINK, 0); + set_tooltip_markup ("" + labelText + "\n" + tooltipText); + } + // do nothing if imgIcon exist, which mean that it is currently being displayed + break; + case(TOI_TEXT): + default: + if (!label) { + removeIfThere(this, imgIcon, false); + delete imgIcon; + imgIcon = 0; + label = new Gtk::Label (labelText, Gtk::ALIGN_CENTER); + pack_start(*label, Gtk::PACK_EXPAND_WIDGET, 0); + set_tooltip_markup (tooltipText); + } + // do nothing if label exist, which mean that it is currently being displayed + break; + } + show_all(); +} diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index a21b55d55..e150ca127 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -71,6 +71,9 @@ public: } }; +/** + * @brief subclass of Gtk::ScrolledWindow in order to handle the scrollwheel + */ class MyScrolledWindow : public Gtk::ScrolledWindow { bool on_scroll_event (GdkEventScroll* event); @@ -79,6 +82,9 @@ public: MyScrolledWindow(); }; +/** + * @brief subclass of Gtk::ComboBox in order to handle the scrollwheel + */ class MyComboBox : public Gtk::ComboBox { bool on_scroll_event (GdkEventScroll* event); @@ -87,6 +93,9 @@ public: MyComboBox (); }; +/** + * @brief subclass of Gtk::ComboBoxText in order to handle the scrollwheel + */ class MyComboBoxText : public Gtk::ComboBoxText { bool on_scroll_event (GdkEventScroll* event); @@ -95,6 +104,9 @@ public: MyComboBoxText (); }; +/** + * @brief subclass of Gtk::SpinButton in order to handle the scrollwheel + */ class MySpinButton : public Gtk::SpinButton { bool on_scroll_event (GdkEventScroll* event); @@ -103,11 +115,17 @@ public: MySpinButton (); }; +/** + * @brief subclass of Gtk::HScale in order to handle the scrollwheel + */ class MyHScale : public Gtk::HScale { bool on_scroll_event (GdkEventScroll* event); }; +/** + * @brief subclass of Gtk::FileChooserButton in order to handle the scrollwheel + */ class MyFileChooserButton : public Gtk::FileChooserButton { protected: @@ -117,4 +135,28 @@ public: MyFileChooserButton (const Glib::ustring& title, Gtk::FileChooserAction action=Gtk::FILE_CHOOSER_ACTION_OPEN); }; +enum TOITypes { + TOI_TEXT, + TOI_ICON +}; + +/** + * @brief Handle the switch between text and image to be displayed in the HBox (to be used in a button/toolpanel) + */ +class TextOrIcon : public Gtk::HBox { + +protected: + Gtk::Image* imgIcon; + Gtk::Label* label; + Glib::ustring filename; + Glib::ustring labelText; + Glib::ustring tooltipText; + +public: + TextOrIcon (Glib::ustring filename, Glib::ustring labelTx, Glib::ustring tooltipTx, TOITypes type); + ~TextOrIcon (); + + void switchTo(TOITypes type); +}; + #endif diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index b67617b22..a0e3b99c6 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -84,7 +84,7 @@ HistogramPanel::HistogramPanel () { showRAW->set_tooltip_text (M("HISTOGRAM_TOOLTIP_RAW")); showBAR->set_tooltip_text (M("HISTOGRAM_TOOLTIP_BAR")); - Gtk::VBox* buttonVBox = Gtk::manage (new Gtk::VBox (false, 2)); + buttonVBox = Gtk::manage (new Gtk::VBox (false, 2)); showRed->set_active (true); showGreen->set_active (true); showBlue->set_active (true); @@ -194,6 +194,17 @@ void HistogramPanel::pointerMoved (bool validPos, Glib::ustring profile, int x, } } +/* + * Move the vertical button bar to the right side + * only allowed values for align are Gtk::ALIGN_LEFT and Gtk::ALIGN_RIGHT + */ +void HistogramPanel::reorder (Gtk::AlignmentEnum align) { + if (align == Gtk::ALIGN_LEFT) + reorder_child(*buttonVBox, 0); + else + reorder_child(*buttonVBox, 1); +} + // // // @@ -686,7 +697,6 @@ bool HistogramArea::on_expose_event(GdkEventExpose* event) { return true; } - bool HistogramArea::on_button_press_event (GdkEventButton* event) { if (event->type==GDK_2BUTTON_PRESS && event->button==1) { diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 3e76d6756..e6dfee4b2 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -148,6 +148,7 @@ class HistogramPanel : public Gtk::HBox, public PointerMotionListener { protected: Gtk::VBox* gfxVBox; + Gtk::VBox* buttonVBox; HistogramArea* histogramArea; HistogramRGBArea* histogramRGBArea; Gtk::ToggleButton* showRed; @@ -174,6 +175,7 @@ class HistogramPanel : public Gtk::HBox, public PointerMotionListener { // TODO should be protected void setHistRGBInvalid (); + void reorder (Gtk::AlignmentEnum align); void rgbv_toggled (); void resized (Gtk::Allocation& req); }; diff --git a/rtgui/options.cc b/rtgui/options.cc index e794879fa..906c356d1 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -154,6 +154,7 @@ void Options::setDefaults () { showProfileSelector = true; FileBrowserToolbarSingleRow = true; hideTPVScrollbar = false; + UseIconNoText = true; squareDetailWindow = false; menuGroupRank = true; menuGroupLabel = true; @@ -405,6 +406,7 @@ if (keyFile.has_group ("GUI")) { if (keyFile.has_key ("GUI", "SquareDetailWindow")) squareDetailWindow = keyFile.get_boolean ("GUI", "SquareDetailWindow"); if (keyFile.has_key ("GUI", "FileBrowserToolbarSingleRow")) FileBrowserToolbarSingleRow = keyFile.get_boolean ("GUI", "FileBrowserToolbarSingleRow"); if (keyFile.has_key ("GUI", "HideTPVScrollbar")) hideTPVScrollbar = keyFile.get_boolean ("GUI", "HideTPVScrollbar"); + if (keyFile.has_key ("GUI", "UseIconNoText")) UseIconNoText = keyFile.get_boolean ("GUI", "UseIconNoText"); } @@ -577,6 +579,7 @@ int Options::saveToFile (Glib::ustring fname) { keyFile.set_boolean ("GUI", "SquareDetailWindow", squareDetailWindow); keyFile.set_boolean ("GUI", "FileBrowserToolbarSingleRow", FileBrowserToolbarSingleRow); keyFile.set_boolean ("GUI", "HideTPVScrollbar", hideTPVScrollbar); + keyFile.set_boolean ("GUI", "UseIconNoText", UseIconNoText); //Glib::ArrayHandle crvopen = crvOpen; //keyFile.set_integer_list ("GUI", "CurvePanelsExpanded", crvopen); diff --git a/rtgui/options.h b/rtgui/options.h index 86d3d9ac2..f6978759a 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -155,6 +155,7 @@ class Options { bool squareDetailWindow; bool FileBrowserToolbarSingleRow; bool hideTPVScrollbar; + bool UseIconNoText; bool menuGroupRank; bool menuGroupLabel; diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 313283cd4..8977a6708 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -436,11 +436,21 @@ Gtk::Widget* Preferences::getGeneralPanel () { Gtk::HBox* hbworkflow3 = Gtk::manage( new Gtk::HBox () ); ckbFileBrowserToolbarSingleRow = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_FILEBROWSERTOOLBARSINGLEROW")) ); + hbworkflow3->pack_start (*ckbFileBrowserToolbarSingleRow, Gtk::PACK_SHRINK, 4); vbworkflow->pack_start (*hbworkflow3, Gtk::PACK_SHRINK, 0); + Gtk::HBox* hbworkflow4 = Gtk::manage( new Gtk::HBox () ); + + Gtk::Label* hb4label = Gtk::manage( new Gtk::Label (M("PREFERENCES_TP_LABEL")) ); + hbworkflow4->pack_start (*hb4label, Gtk::PACK_SHRINK, 4); ckbHideTPVScrollbar = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_TP_VSCROLLBAR")) ); - vbworkflow->pack_start (*ckbHideTPVScrollbar, Gtk::PACK_SHRINK, 4); + hbworkflow4->pack_start (*ckbHideTPVScrollbar, Gtk::PACK_SHRINK, 4); + + ckbUseIconNoText = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_TP_USEICONORTEXT")) ); + hbworkflow4->pack_start (*ckbUseIconNoText, Gtk::PACK_SHRINK, 4); + + vbworkflow->pack_start (*hbworkflow4, Gtk::PACK_SHRINK, 4); fworklflow->add (*vbworkflow); mvbsd->pack_start (*fworklflow, Gtk::PACK_SHRINK, 4); @@ -1042,6 +1052,7 @@ void Preferences::storePreferences () { moptions.FileBrowserToolbarSingleRow = ckbFileBrowserToolbarSingleRow->get_active(); moptions.hideTPVScrollbar = ckbHideTPVScrollbar->get_active(); moptions.overwriteOutputFile = chOverwriteOutputFile->get_active (); + moptions.UseIconNoText = ckbUseIconNoText->get_active(); // Sounds moptions.sndEnable = ckbSndEnable->get_active (); @@ -1155,6 +1166,7 @@ void Preferences::fillPreferences () { ckbSquareDetailWindow->set_active(moptions.squareDetailWindow); ckbFileBrowserToolbarSingleRow->set_active(moptions.FileBrowserToolbarSingleRow); ckbHideTPVScrollbar->set_active(moptions.hideTPVScrollbar); + ckbUseIconNoText->set_active(moptions.UseIconNoText); //darkFrameDir->set_filename( moptions.rtSettings.darkFramesPath ); //updateDFinfos(); @@ -1328,10 +1340,27 @@ void Preferences::workflowUpdate (){ else parent->epanel->show_all(); } - if (moptions.hideTPVScrollbar != options.hideTPVScrollbar) { + if(moptions.hideTPVScrollbar != options.hideTPVScrollbar) { // Update the tool panels parent->updateTPVScrollbar (moptions.hideTPVScrollbar); } + if(moptions.UseIconNoText != options.UseIconNoText) { + // Update the tool's tab titles + parent->updateTabsUsesIcons(moptions.UseIconNoText); + } + if(moptions.FileBrowserToolbarSingleRow != options.FileBrowserToolbarSingleRow) { + // Update the position of the Query toolbar + parent->updateFBQueryTB(moptions.FileBrowserToolbarSingleRow); + } + if(moptions.histogramPosition != options.histogramPosition) { + // Update the position of the Histogram + parent->updateHistogramPosition(options.histogramPosition, moptions.histogramPosition); + } + if(moptions.showProfileSelector != options.showProfileSelector) { + // Update the position of the Profile selector + parent->updateTPProfileSelector(moptions.showProfileSelector); + } + } void Preferences::switchFontTo(Glib::ustring newFont) { diff --git a/rtgui/preferences.h b/rtgui/preferences.h index e9ea7d3d0..f02da17bd 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -134,6 +134,7 @@ class Preferences : public Gtk::Dialog { Gtk::CheckButton* ckbFileBrowserToolbarSingleRow; Gtk::CheckButton* ckbHideTPVScrollbar; Gtk::CheckButton* ckbSquareDetailWindow; + Gtk::CheckButton* ckbUseIconNoText; Options moptions; diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 0e3d8f46d..9b7de0cc2 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -466,6 +466,15 @@ void RTWindow::MoveFileBrowserToEditor() } } +void RTWindow::updateTPProfileSelector (bool showMe) { + epanel->updateProfileSelector (showMe); + + std::map::const_iterator itr; + for(itr = epanels.begin(); itr != epanels.end(); ++itr){ + ((*itr).second)->updateProfileSelector (showMe); + } +} + void RTWindow::updateTPVScrollbar (bool hide) { fpanel->updateTPVScrollbar (hide); epanel->updateTPVScrollbar (hide); @@ -475,3 +484,26 @@ void RTWindow::updateTPVScrollbar (bool hide) { ((*itr).second)->updateTPVScrollbar (hide); } } + +void RTWindow::updateTabsUsesIcons (bool useIcons) { + fpanel->updateTabsUsesIcons (useIcons); + epanel->updateTabsUsesIcons (useIcons); + + std::map::const_iterator itr; + for(itr = epanels.begin(); itr != epanels.end(); ++itr){ + ((*itr).second)->updateTabsUsesIcons (useIcons); + } +} + +void RTWindow::updateFBQueryTB (bool singleRow) { + fpanel->fileCatalog->updateFBQueryTB (singleRow); +} + +void RTWindow::updateHistogramPosition (int oldPosition, int newPosition) { + epanel->updateHistogramPosition (oldPosition, newPosition); + + std::map::const_iterator itr; + for(itr = epanels.begin(); itr != epanels.end(); ++itr){ + ((*itr).second)->updateHistogramPosition (oldPosition, newPosition); + } +} diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index 3fad8ee0f..39bb137f4 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -78,6 +78,10 @@ class RTWindow : public Gtk::Window, public rtengine::ProgressListener{ void MoveFileBrowserToMain(); void updateTPVScrollbar (bool hide); + void updateTPProfileSelector (bool showMe); + void updateHistogramPosition (int oldPosition, int newPosition); + void updateTabsUsesIcons (bool useIcons); + void updateFBQueryTB (bool singleRow); bool getIsFullscreen() { return is_fullscreen; } }; diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index af8850952..7959493d3 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -148,48 +148,22 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc(NULL) { rawPanel->pack_start (*Gtk::manage(new Gtk::HSeparator), Gtk::PACK_SHRINK,4); rawPanel->pack_start (*vbPanelEnd[4],Gtk::PACK_SHRINK,4); + TOITypes type = options.UseIconNoText ? TOI_ICON : TOI_TEXT; - Gtk::HBox* hbe = Gtk::manage (new Gtk::HBox ()); - hbe->pack_start (*Gtk::manage (new Gtk::Label (M("MAIN_TAB_EXPOSURE")))); - hbe->set_spacing (2); - hbe->set_tooltip_markup (M("MAIN_TAB_EXPOSURE_TOOLTIP")); - hbe->show_all (); - toolPanelNotebook->append_page (*exposurePanelSW, *hbe); + toiE = Gtk::manage (new TextOrIcon (argv0+"/images/exposure-24.png" , M("MAIN_TAB_EXPOSURE") , M("MAIN_TAB_EXPOSURE_TOOLTIP") , type)); + toiD = Gtk::manage (new TextOrIcon (argv0+"/images/detail-24.png" , M("MAIN_TAB_DETAIL") , M("MAIN_TAB_DETAIL_TOOLTIP") , type)); + toiC = Gtk::manage (new TextOrIcon (argv0+"/images/colour-24.png" , M("MAIN_TAB_COLOR") , M("MAIN_TAB_COLOR_TOOLTIP") , type)); + toiT = Gtk::manage (new TextOrIcon (argv0+"/images/transform-24.png", M("MAIN_TAB_TRANSFORM"), M("MAIN_TAB_TRANSFORM_TOOLTIP"), type)); + toiR = Gtk::manage (new TextOrIcon (argv0+"/images/raw-24.png" , M("MAIN_TAB_RAW") , M("MAIN_TAB_RAW_TOOLTIP") , type)); + toiM = Gtk::manage (new TextOrIcon (argv0+"/images/exif-24.png" , M("MAIN_TAB_METADATA") , M("MAIN_TAB_METADATA_TOOLTIP") , type)); - Gtk::HBox* hbd = Gtk::manage (new Gtk::HBox ()); - hbd->pack_start (*Gtk::manage (new Gtk::Label (M("MAIN_TAB_DETAIL")))); - hbd->set_spacing (2); - hbd->set_tooltip_markup (M("MAIN_TAB_DETAIL_TOOLTIP")); - hbd->show_all (); - toolPanelNotebook->append_page (*detailsPanelSW, *hbd); + toolPanelNotebook->append_page (*exposurePanelSW, *toiE); + toolPanelNotebook->append_page (*detailsPanelSW, *toiD); + toolPanelNotebook->append_page (*colorPanelSW, *toiC); + toolPanelNotebook->append_page (*transformPanelSW, *toiT); + toolPanelNotebook->append_page (*rawPanelSW, *toiR); + toolPanelNotebook->append_page (*metadataPanel, *toiM); - Gtk::HBox* hbc = Gtk::manage (new Gtk::HBox ()); - hbc->pack_start (*Gtk::manage (new Gtk::Label (M("MAIN_TAB_COLOR")))); - hbc->set_spacing (2); - hbc->set_tooltip_markup (M("MAIN_TAB_COLOR_TOOLTIP")); - hbc->show_all (); - toolPanelNotebook->append_page (*colorPanelSW, *hbc); - - Gtk::HBox* hbt = Gtk::manage (new Gtk::HBox ()); - hbt->pack_start (*Gtk::manage (new Gtk::Label (M("MAIN_TAB_TRANSFORM")))); - hbt->set_spacing (2); - hbt->set_tooltip_markup (M("MAIN_TAB_TRANSFORM_TOOLTIP")); - hbt->show_all (); - toolPanelNotebook->append_page (*transformPanelSW, *hbt); - - Gtk::HBox* hbr = Gtk::manage (new Gtk::HBox ()); - hbr->pack_start (*Gtk::manage (new Gtk::Label (M("MAIN_TAB_RAW")))); - hbr->set_spacing (2); - hbr->set_tooltip_markup (M("MAIN_TAB_RAW_TOOLTIP")); - hbr->show_all (); - toolPanelNotebook->append_page (*rawPanelSW, *hbr); - - Gtk::HBox* hbm = Gtk::manage (new Gtk::HBox ()); - hbm->pack_start (*Gtk::manage (new Gtk::Label (M("MAIN_TAB_METADATA")))); - hbm->set_spacing (2); - hbm->set_tooltip_markup (M("MAIN_TAB_METADATA_TOOLTIP")); - hbm->show_all (); - toolPanelNotebook->append_page (*metadataPanel, *hbm); toolPanelNotebook->set_current_page (0); toolPanelNotebook->set_scrollable (); @@ -549,9 +523,7 @@ bool ToolPanelCoordinator::handleShortcutKey (GdkEventKey* event) { toolPanelNotebook->set_current_page (toolPanelNotebook->page_num(*rawPanelSW)); return true; case GDK_m: - // !!! this should be improved by detecting if metadataPanel is present, - // as this page is removed in BatchToolPanelCoordinator::BatchToolPanelCoordinator - if (toolPanelNotebook->get_n_pages()==6){ + if (metadataPanel){ toolPanelNotebook->set_current_page (toolPanelNotebook->page_num(*metadataPanel)); return true; } @@ -569,6 +541,22 @@ void ToolPanelCoordinator::updateVScrollbars (bool hide) { rawPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy); } +void ToolPanelCoordinator::updateTabsHeader (bool useIcons) { + TOITypes type = useIcons ? TOI_ICON : TOI_TEXT; + + toiE->switchTo(type); + toiD->switchTo(type); + toiC->switchTo(type); + toiT->switchTo(type); + toiR->switchTo(type); + if (toiM) + toiM->switchTo(type); +} + void ToolPanelCoordinator::updateTPVScrollbar (bool hide) { updateVScrollbars (hide); } + +void ToolPanelCoordinator::updateTabsUsesIcons (bool useIcons) { + updateTabsHeader (useIcons); +} diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index f8344a93a..b7392c6a5 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -120,6 +120,26 @@ class ToolPanelCoordinator : public ToolPanelListener, IPTCPanel* iptcpanel; ToolBar* toolBar; + TextOrIcon* toiE; + TextOrIcon* toiD; + TextOrIcon* toiC; + TextOrIcon* toiT; + TextOrIcon* toiR; + TextOrIcon* toiM; + + Gtk::Label* labelE; + Gtk::Label* labelD; + Gtk::Label* labelC; + Gtk::Label* labelT; + Gtk::Label* labelR; + Gtk::Label* labelM; + + Gtk::Image* imgIconE; + Gtk::Image* imgIconD; + Gtk::Image* imgIconC; + Gtk::Image* imgIconT; + Gtk::Image* imgIconR; + Gtk::Image* imgIconM; Gtk::Image* imgPanelEnd[5]; Gtk::VBox* vbPanelEnd[5]; @@ -136,6 +156,7 @@ class ToolPanelCoordinator : public ToolPanelListener, void addPanel (Gtk::Box* where, FoldableToolPanel* panel, Glib::ustring label); void foldThemAll (GdkEventButton* event); void updateVScrollbars (bool hide); + void updateTabsHeader (bool useIcons); public: @@ -203,6 +224,7 @@ class ToolPanelCoordinator : public ToolPanelListener, CropGUIListener* startCropEditing (Thumbnail* thm=NULL) { return crop; } void updateTPVScrollbar (bool hide); + void updateTabsUsesIcons (bool useIcons); bool handleShortcutKey (GdkEventKey* event); };