diff --git a/rtdata/images/histBar.png b/rtdata/images/histBar.png new file mode 100644 index 000000000..b152f7e8c Binary files /dev/null and b/rtdata/images/histBar.png differ diff --git a/rtdata/images/histBlue.png b/rtdata/images/histBlue.png new file mode 100644 index 000000000..4abcbb226 Binary files /dev/null and b/rtdata/images/histBlue.png differ diff --git a/rtdata/images/histGreen.png b/rtdata/images/histGreen.png new file mode 100644 index 000000000..d6bb4188a Binary files /dev/null and b/rtdata/images/histGreen.png differ diff --git a/rtdata/images/histRaw.png b/rtdata/images/histRaw.png new file mode 100644 index 000000000..a597b5ade Binary files /dev/null and b/rtdata/images/histRaw.png differ diff --git a/rtdata/images/histRed.png b/rtdata/images/histRed.png new file mode 100644 index 000000000..9af98926b Binary files /dev/null and b/rtdata/images/histRed.png differ diff --git a/rtdata/images/histValue.png b/rtdata/images/histValue.png new file mode 100644 index 000000000..a298bc926 Binary files /dev/null and b/rtdata/images/histValue.png differ diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index a589037da..385c576ef 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -376,6 +376,7 @@ MAIN_MSG_CANNOTLOAD;Impossible de charger l'image MAIN_MSG_CANNOTSAVE;Erreur d'enregistrement du fichier MAIN_MSG_CANNOTSTARTEDITOR;Impossible de lancer l'éditeur. MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY;Veuillez saisir son chemin d'accès dans les "Préférences". +MAIN_MSG_EMPTYFILENAME;Nom de fichier non spécifié! MAIN_MSG_ERRORDURINGIMAGESAVING;Erreur pendant la sauvegarde de l'image MAIN_MSG_EXITJOBSINQUEUEINFO;Les images non traitées seront perdues en quittant l'application MAIN_MSG_EXITJOBSINQUEUEQUEST;Êtes-vous sûr de vouloir quitter? Il reste dans la file des images en attente de traitement. @@ -676,6 +677,15 @@ TP_CHMIXER_GREEN;Vert TP_CHMIXER_LABEL;Mixage des canaux TP_CHMIXER_RED;Rouge TP_CHROMATABERR_LABEL;Aberration Chromatique +TP_CLARITY_LABEL;Clareté et netteté +TP_CLARITY_SHARPEN;Bord +TP_CLARITY_STRENGTH;Quantité +TP_CLARITY_PASSES;Itérations +TP_CLARITY_MICRO;Texture +TP_CLARITY_THREE;Luminance uniquement +TP_CLARITY_MATRIX;Matrice 3x3 au lieu de 5x5 +TP_MLMICRO_STRENGTH;Quantité +TP_MLMICRO_UNIFORMITY;Uniformité TP_COARSETRAF_DEGREE;degré: TP_COARSETRAF_TOOLTIP_HFLIP;Symétriser / axe vertical TP_COARSETRAF_TOOLTIP_ROTLEFT;Rotation vers la gauche diff --git a/rtdata/languages/default b/rtdata/languages/default index b422d24d6..2bf442f0d 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -426,6 +426,7 @@ MAIN_MSG_CANNOTLOAD;Cannot load image MAIN_MSG_CANNOTSAVE;File saving error MAIN_MSG_CANNOTSTARTEDITOR;Can not start editor. MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY;Please set the correct path in the "Preferences" dialog. +MAIN_MSG_EMPTYFILENAME;Filename unspecified! MAIN_MSG_ERRORDURINGIMAGESAVING;Error during image saving MAIN_MSG_EXITJOBSINQUEUEINFO;Unprocessed images in the queue will be lost on exit. MAIN_MSG_EXITJOBSINQUEUEQUEST;Are you sure you want to exit? There are unprocessed images waiting in the queue. @@ -736,12 +737,12 @@ TP_CHMIXER_LABEL;Channel Mixer TP_CHMIXER_RED;Red TP_CHROMATABERR_LABEL;Chromatic Aberration TP_CLARITY_LABEL;Clarity and Sharpening -TP_CLARITY_SHARPEN;Gradient Sharpening (border) +TP_CLARITY_SHARPEN;Border TP_CLARITY_STRENGTH;Gradient strength TP_CLARITY_PASSES;Gradient passes -TP_CLARITY_MICRO;Microcontrast (texture) +TP_CLARITY_MICRO;Texture TP_CLARITY_THREE;Luminance only -TP_CLARITY_MATRIX;Matrix 3x3 instead of 5x5 +TP_CLARITY_MATRIX;3x3 matrix instead of 5x5 TP_MLMICRO_STRENGTH;Strength TP_MLMICRO_UNIFORMITY;Uniformity TP_COARSETRAF_DEGREE;degree: diff --git a/rtdata/themes/09-Gray-Orange.gtkrc b/rtdata/themes/09-Gray-Orange.gtkrc index 576ccd642..c37f31f9f 100644 --- a/rtdata/themes/09-Gray-Orange.gtkrc +++ b/rtdata/themes/09-Gray-Orange.gtkrc @@ -234,6 +234,12 @@ style "clearlooks-button" { } } +style "clearlooks-histButton" { + + GtkButton::child-displacement-x = 0 + GtkButton::child-displacement-y = 0 +} + # The color is changed by the notebook_bg style, this style # changes the x/ythickness style "clearlooks-notebook" { @@ -447,6 +453,7 @@ widget_class "*.." style "clearlooks-treeview_header" widget "*.partialPasteHeader.*" style "clearlooks-frame_title" widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep" +widget "*.histButton" style "clearlooks-histButton" # The window of the tooltip is called "gtk-tooltip" ################################################################## diff --git a/rtdata/themes/17-Gray-Red.gtkrc b/rtdata/themes/17-Gray-Red.gtkrc index 85fcbbceb..c71c8458b 100644 --- a/rtdata/themes/17-Gray-Red.gtkrc +++ b/rtdata/themes/17-Gray-Red.gtkrc @@ -234,6 +234,12 @@ style "clearlooks-button" { } } +style "clearlooks-histButton" { + + GtkButton::child-displacement-x = 0 + GtkButton::child-displacement-y = 0 +} + # The color is changed by the notebook_bg style, this style # changes the x/ythickness style "clearlooks-notebook" { @@ -447,6 +453,7 @@ widget_class "*.." style "clearlooks-treeview_header" widget "*.partialPasteHeader.*" style "clearlooks-frame_title" widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep" +widget "*.histButton" style "clearlooks-histButton" # The window of the tooltip is called "gtk-tooltip" ################################################################## diff --git a/rtdata/themes/21-Gray-Gray.gtkrc b/rtdata/themes/21-Gray-Gray.gtkrc index 0c706f14e..0b6117a9f 100644 --- a/rtdata/themes/21-Gray-Gray.gtkrc +++ b/rtdata/themes/21-Gray-Gray.gtkrc @@ -244,6 +244,12 @@ style "clearlooks-checkbutton" { } } +style "clearlooks-histButton" { + + GtkButton::child-displacement-x = 0 + GtkButton::child-displacement-y = 0 +} + # The color is changed by the notebook_bg style, this style # changes the x/ythickness style "clearlooks-notebook" { @@ -458,6 +464,7 @@ widget_class "*.." style "clearlooks-treeview_header" widget "*.partialPasteHeader.*" style "clearlooks-frame_title" widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep" +widget "*.histButton" style "clearlooks-histButton" # The window of the tooltip is called "gtk-tooltip" ################################################################## diff --git a/rtdata/themes/25-Gray-Gray.gtkrc b/rtdata/themes/25-Gray-Gray.gtkrc index fe8288de6..3968308c2 100644 --- a/rtdata/themes/25-Gray-Gray.gtkrc +++ b/rtdata/themes/25-Gray-Gray.gtkrc @@ -234,6 +234,12 @@ style "clearlooks-button" { } } +style "clearlooks-histButton" { + + GtkButton::child-displacement-x = 0 + GtkButton::child-displacement-y = 0 +} + # The color is changed by the notebook_bg style, this style # changes the x/ythickness style "clearlooks-notebook" { @@ -447,6 +453,7 @@ widget_class "*.." style "clearlooks-treeview_header" widget "*.partialPasteHeader.*" style "clearlooks-frame_title" widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep" +widget "*.histButton" style "clearlooks-histButton" # The window of the tooltip is called "gtk-tooltip" ################################################################## diff --git a/rtdata/themes/25-Gray-Purple.gtkrc b/rtdata/themes/25-Gray-Purple.gtkrc index 1c6171a6e..022811d51 100644 --- a/rtdata/themes/25-Gray-Purple.gtkrc +++ b/rtdata/themes/25-Gray-Purple.gtkrc @@ -234,6 +234,12 @@ style "clearlooks-button" { } } +style "clearlooks-histButton" { + + GtkButton::child-displacement-x = 0 + GtkButton::child-displacement-y = 0 +} + # The color is changed by the notebook_bg style, this style # changes the x/ythickness style "clearlooks-notebook" { @@ -447,6 +453,7 @@ widget_class "*.." style "clearlooks-treeview_header" widget "*.partialPasteHeader.*" style "clearlooks-frame_title" widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep" +widget "*.histButton" style "clearlooks-histButton" # The window of the tooltip is called "gtk-tooltip" ################################################################## diff --git a/rtdata/themes/25-Gray-Red.gtkrc b/rtdata/themes/25-Gray-Red.gtkrc index fd76e8248..e67821f79 100644 --- a/rtdata/themes/25-Gray-Red.gtkrc +++ b/rtdata/themes/25-Gray-Red.gtkrc @@ -234,6 +234,12 @@ style "clearlooks-button" { } } +style "clearlooks-histButton" { + + GtkButton::child-displacement-x = 0 + GtkButton::child-displacement-y = 0 +} + # The color is changed by the notebook_bg style, this style # changes the x/ythickness style "clearlooks-notebook" { @@ -447,6 +453,7 @@ widget_class "*.." style "clearlooks-treeview_header" widget "*.partialPasteHeader.*" style "clearlooks-frame_title" widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep" +widget "*.histButton" style "clearlooks-histButton" # The window of the tooltip is called "gtk-tooltip" ################################################################## diff --git a/rtdata/themes/37-Gray-Red-Textured.gtkrc b/rtdata/themes/37-Gray-Red-Textured.gtkrc index 23531d001..a14919e3d 100644 --- a/rtdata/themes/37-Gray-Red-Textured.gtkrc +++ b/rtdata/themes/37-Gray-Red-Textured.gtkrc @@ -583,6 +583,12 @@ style "clearlooks-button" { } } +style "clearlooks-histButton" { + + GtkButton::child-displacement-x = 0 + GtkButton::child-displacement-y = 0 +} + # The color is changed by the notebook_bg style, this style # changes the x/ythickness style "clearlooks-notebook" { @@ -798,6 +804,7 @@ widget_class "*.." style "clearlooks-treeview_header" widget "*.partialPasteHeader.*" style "clearlooks-frame_title" widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep" +widget "*.histButton" style "clearlooks-histButton" # The window of the tooltip is called "gtk-tooltip" ################################################################## diff --git a/rtdata/themes/37-Gray-Red.gtkrc b/rtdata/themes/37-Gray-Red.gtkrc index ae5732761..021820a8b 100644 --- a/rtdata/themes/37-Gray-Red.gtkrc +++ b/rtdata/themes/37-Gray-Red.gtkrc @@ -234,6 +234,12 @@ style "clearlooks-button" { } } +style "clearlooks-histButton" { + + GtkButton::child-displacement-x = 0 + GtkButton::child-displacement-y = 0 +} + # The color is changed by the notebook_bg style, this style # changes the x/ythickness style "clearlooks-notebook" { @@ -448,6 +454,7 @@ widget_class "*.." style "clearlooks-treeview_header" widget "*.partialPasteHeader.*" style "clearlooks-frame_title" widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep" +widget "*.histButton" style "clearlooks-histButton" # The window of the tooltip is called "gtk-tooltip" ################################################################## diff --git a/rtdata/themes/63-Gray-Cyan.gtkrc b/rtdata/themes/63-Gray-Cyan.gtkrc index 6cea351d0..ab8523afb 100644 --- a/rtdata/themes/63-Gray-Cyan.gtkrc +++ b/rtdata/themes/63-Gray-Cyan.gtkrc @@ -235,6 +235,12 @@ style "clearlooks-button" { } } +style "clearlooks-histButton" { + + GtkButton::child-displacement-x = 0 + GtkButton::child-displacement-y = 0 +} + # The color is changed by the notebook_bg style, this style # changes the x/ythickness style "clearlooks-notebook" { @@ -448,6 +454,7 @@ widget_class "*.." style "clearlooks-treeview_header" widget "*.partialPasteHeader.*" style "clearlooks-frame_title" widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep" +widget "*.histButton" style "clearlooks-histButton" # The window of the tooltip is called "gtk-tooltip" ################################################################## diff --git a/rtdata/themes/92-Beige-DarkCyan.gtkrc b/rtdata/themes/92-Beige-DarkCyan.gtkrc index c95e651f5..3172ac645 100644 --- a/rtdata/themes/92-Beige-DarkCyan.gtkrc +++ b/rtdata/themes/92-Beige-DarkCyan.gtkrc @@ -233,6 +233,12 @@ style "clearlooks-button" { } } +style "clearlooks-histButton" { + + GtkButton::child-displacement-x = 0 + GtkButton::child-displacement-y = 0 +} + # The color is changed by the notebook_bg style, this style # changes the x/ythickness style "clearlooks-notebook" { @@ -435,6 +441,7 @@ widget_class "*.." style "clearlooks-treeview_header" widget "*.partialPasteHeader.*" style "clearlooks-frame_title" widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep" +widget "*.histButton" style "clearlooks-histButton" # The window of the tooltip is called "gtk-tooltip" ################################################################## diff --git a/rtdata/themes/Default.gtkrc b/rtdata/themes/Default.gtkrc index 05e59c87b..4bd7a0207 100644 --- a/rtdata/themes/Default.gtkrc +++ b/rtdata/themes/Default.gtkrc @@ -211,6 +211,12 @@ style "clearlooks-button" { bg[ACTIVE] = shade (0.85, @rt_bg_color) } +style "clearlooks-histButton" { + + GtkButton::child-displacement-x = 0 + GtkButton::child-displacement-y = 0 +} + # The color is changed by the notebook_bg style, this style # changes the x/ythickness style "clearlooks-notebook" { @@ -388,6 +394,7 @@ widget_class "*.." style "clearlooks-treeview_header" widget "*.partialPasteHeader.*" style "clearlooks-frame_title" widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep" +widget "*.histButton" style "clearlooks-histButton" # The window of the tooltip is called "gtk-tooltip" ################################################################## diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index a38850658..1541d08de 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -40,10 +40,11 @@ EditorPanel::EditorPanel (FilePanel* filePanel) processingStartedTime = 0; firstProcessingDone = false; -// construct toolpanelcoordinator + // construct toolpanelcoordinator tpc = new ToolPanelCoordinator (); -// build GUI + // build GUI + // build left side panel leftbox = new Gtk::VBox (); leftbox->set_border_width (2); @@ -51,7 +52,6 @@ EditorPanel::EditorPanel (FilePanel* filePanel) if (options.histogramPosition>0) { histogramPanel = Gtk::manage (new HistogramPanel ()); - histogramPanel->set_size_request (-1, 160); if (options.histogramPosition==1) leftbox->pack_start (*histogramPanel, Gtk::PACK_SHRINK, 4); } else histogramPanel = NULL; @@ -59,7 +59,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) Gtk::Frame* ppframe = Gtk::manage (new Gtk::Frame ()); ppframe->add (*profilep); ppframe->set_label (M("PROFILEPANEL_LABEL")); -// leftbox->pack_start (*ppframe, Gtk::PACK_SHRINK, 4); + //leftbox->pack_start (*ppframe, Gtk::PACK_SHRINK, 4); navigator = Gtk::manage (new Navigator ()); navigator->previewWindow->set_size_request (-1, 150); @@ -101,10 +101,10 @@ EditorPanel::EditorPanel (FilePanel* filePanel) hidehp->set_active (options.showHistory); hidehp->set_tooltip_markup (M("MAIN_TOOLTIP_HIDEHP")); if (options.showHistory){ - hidehp->set_image (*iHistoryHide); + hidehp->set_image (*iHistoryHide); } else { - hidehp->set_image (*iHistoryShow); + hidehp->set_image (*iHistoryShow); } tbTopPanel_1 = new Gtk::ToggleButton (); @@ -137,7 +137,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) 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 (*tbTopPanel_1, Gtk::PACK_SHRINK, 1); toolBarPanel->pack_end (*vsep1, Gtk::PACK_SHRINK, 2); toolBarPanel->pack_end (*tpc->coarse, Gtk::PACK_SHRINK, 2); @@ -235,7 +235,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) if(filePanel) { catalogPane = new Gtk::Paned(); - viewpaned->pack1(*catalogPane, false, true); + viewpaned->pack1(*catalogPane, false, true); } viewpaned->pack2(*editbox, true, true); @@ -247,8 +247,8 @@ EditorPanel::EditorPanel (FilePanel* filePanel) hpanedr->pack1(*hpanedl, true, true); hpanedr->pack2(*vboxright, false, true); - hpanedl->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &EditorPanel::leftPaneButtonReleased) ); - hpanedr->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &EditorPanel::rightPaneButtonReleased) ); + hpanedl->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &EditorPanel::leftPaneButtonReleased) ); + hpanedr->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &EditorPanel::rightPaneButtonReleased) ); pack_start (*hpanedr); show_all (); @@ -261,7 +261,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) saveAsDialog->set_default_size (options.saveAsDialogWidth, options.saveAsDialogHeight); -// connect listeners + // connect listeners profilep->setProfileChangeListener (tpc); history->setProfileChangeListener (tpc); history->setHistoryBeforeLineListener (this); @@ -273,11 +273,11 @@ EditorPanel::EditorPanel (FilePanel* filePanel) iarea->imageArea->setPointerMotionHListener (histogramPanel); iarea->imageArea->setImageAreaToolListener (tpc); -// initialize components + // initialize components info->set_active (options.showInfo); tpc->readOptions (); -// connect event handlers + // connect event handlers 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) ); @@ -322,7 +322,7 @@ EditorPanel::~EditorPanel () { delete tpc; delete leftbox; - delete vboxright; + delete vboxright; delete saveAsDialog; if(catalogPane) delete catalogPane; diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 43a5c55d3..b67617b22 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -18,39 +18,64 @@ */ #include #include +#include +#include #include #include +extern Glib::ustring argv0; +extern Options options; + + // // // HistogramPanel HistogramPanel::HistogramPanel () { - // Gtk::HBox* outer_hbox = Gtk::manage (new Gtk::HBox (false, 0)); - histogramArea = Gtk::manage (new HistogramArea ()); histogramRGBArea = Gtk::manage (new HistogramRGBArea ()); + histogramRGBArea->show(); - Gtk::VBox* left_vbox = Gtk::manage (new Gtk::VBox (false, 0)); - left_vbox->pack_start (*histogramArea, Gtk::PACK_EXPAND_WIDGET, 2); - left_vbox->pack_start (*histogramRGBArea, Gtk::PACK_SHRINK, 2); - set_size_request (-1, 170); - histogramArea->set_size_request (-1, 150); - histogramRGBArea->set_size_request(-1, 10); + gfxVBox = Gtk::manage (new Gtk::VBox (false, 2)); + histogramRGBArea->setParent(gfxVBox); + gfxVBox->pack_start (*histogramArea, Gtk::PACK_EXPAND_WIDGET, 0); + if (options.histogramBar) + gfxVBox->pack_start (*histogramRGBArea, Gtk::PACK_SHRINK, 0); - showRed = Gtk::manage (new Gtk::ToggleButton (M("HISTOGRAM_BUTTON_R"))); - showGreen = Gtk::manage (new Gtk::ToggleButton (M("HISTOGRAM_BUTTON_G"))); - showBlue = Gtk::manage (new Gtk::ToggleButton (M("HISTOGRAM_BUTTON_B"))); - showValue = Gtk::manage (new Gtk::ToggleButton (M("HISTOGRAM_BUTTON_L"))); - showRAW = Gtk::manage (new Gtk::ToggleButton (M("HISTOGRAM_BUTTON_RAW"))); - showBAR = Gtk::manage (new Gtk::ToggleButton (M("HISTOGRAM_BUTTON_BAR"))); + Gtk::Image* redImage = Gtk::manage( new Gtk::Image (Glib::ustring::compose("%1%2",argv0,"/images/histRed.png")) ); + Gtk::Image* greenImage = Gtk::manage( new Gtk::Image (Glib::ustring::compose("%1%2",argv0,"/images/histGreen.png")) ); + Gtk::Image* blueImage = Gtk::manage( new Gtk::Image (Glib::ustring::compose("%1%2",argv0,"/images/histBlue.png")) ); + Gtk::Image* valueImage = Gtk::manage( new Gtk::Image (Glib::ustring::compose("%1%2",argv0,"/images/histValue.png")) ); + Gtk::Image* rawImage = Gtk::manage( new Gtk::Image (Glib::ustring::compose("%1%2",argv0,"/images/histRaw.png")) ); + Gtk::Image* barImage = Gtk::manage( new Gtk::Image (Glib::ustring::compose("%1%2",argv0,"/images/histBar.png")) ); - showRed->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); - showGreen->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); - showBlue->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); - showValue->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); - showRAW->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); - showBAR->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); + showRed = Gtk::manage (new Gtk::ToggleButton ()); + showGreen = Gtk::manage (new Gtk::ToggleButton ()); + showBlue = Gtk::manage (new Gtk::ToggleButton ()); + showValue = Gtk::manage (new Gtk::ToggleButton ()); + showRAW = Gtk::manage (new Gtk::ToggleButton ()); + showBAR = Gtk::manage (new Gtk::ToggleButton ()); + + showRed->set_name("histButton"); + showGreen->set_name("histButton"); + showBlue->set_name("histButton"); + showValue->set_name("histButton"); + showRAW->set_name("histButton"); + showBAR->set_name("histButton"); + + showRed->set_relief (Gtk::RELIEF_NONE); + showGreen->set_relief (Gtk::RELIEF_NONE); + showBlue->set_relief (Gtk::RELIEF_NONE); + showValue->set_relief (Gtk::RELIEF_NONE); + showRAW->set_relief (Gtk::RELIEF_NONE); + showBAR->set_relief (Gtk::RELIEF_NONE); + + showRed->set_image(*redImage); + showGreen->set_image(*greenImage); + showBlue->set_image(*blueImage); + showValue->set_image(*valueImage); + showRAW->set_image(*rawImage); + showBAR->set_image(*barImage); showRed->set_tooltip_text (M("HISTOGRAM_TOOLTIP_R")); showGreen->set_tooltip_text (M("HISTOGRAM_TOOLTIP_G")); @@ -59,22 +84,37 @@ HistogramPanel::HistogramPanel () { showRAW->set_tooltip_text (M("HISTOGRAM_TOOLTIP_RAW")); showBAR->set_tooltip_text (M("HISTOGRAM_TOOLTIP_BAR")); - Gtk::VBox* vbox = Gtk::manage (new Gtk::VBox (false, 0)); + Gtk::VBox* buttonVBox = Gtk::manage (new Gtk::VBox (false, 2)); showRed->set_active (true); showGreen->set_active (true); showBlue->set_active (true); showValue->set_active (true); showRAW->set_active (false); - showBAR->set_active (true); - vbox->pack_start (*showRed, Gtk::PACK_SHRINK, 2); - vbox->pack_start (*showGreen, Gtk::PACK_SHRINK, 2); - vbox->pack_start (*showBlue, Gtk::PACK_SHRINK, 2); - vbox->pack_start (*showValue, Gtk::PACK_SHRINK, 2); - vbox->pack_start (*showRAW, Gtk::PACK_SHRINK, 2); - vbox->pack_start (*showBAR, Gtk::PACK_SHRINK, 2); + showBAR->set_active (options.histogramBar); - pack_start (*left_vbox,Gtk::PACK_EXPAND_WIDGET, 2); - pack_start (*vbox, Gtk::PACK_SHRINK, 2); + showRed->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); + showGreen->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); + showBlue->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); + showValue->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); + showRAW->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); + showBAR->signal_toggled().connect( sigc::mem_fun(*this, &HistogramPanel::rgbv_toggled) ); + + buttonVBox->pack_start (*showRed, Gtk::PACK_SHRINK, 0); + buttonVBox->pack_start (*showGreen, Gtk::PACK_SHRINK, 0); + buttonVBox->pack_start (*showBlue, Gtk::PACK_SHRINK, 0); + buttonVBox->pack_start (*showValue, Gtk::PACK_SHRINK, 0); + buttonVBox->pack_start (*showRAW, Gtk::PACK_SHRINK, 0); + buttonVBox->pack_start (*showBAR, Gtk::PACK_SHRINK, 0); + + // Put the button vbox next to the window's border to be less disturbing + if (options.histogramPosition == 1) { + pack_start (*buttonVBox, Gtk::PACK_SHRINK, 2); + pack_start (*gfxVBox,Gtk::PACK_EXPAND_WIDGET, 2); + } + else { + pack_start (*gfxVBox,Gtk::PACK_EXPAND_WIDGET, 2); + pack_start (*buttonVBox, Gtk::PACK_SHRINK, 2); + } show_all (); @@ -84,21 +124,13 @@ HistogramPanel::HistogramPanel () { void HistogramPanel::resized (Gtk::Allocation& req) { rconn.block (true); - - if (req.get_width()/2>150) { - set_size_request (req.get_width(), 170); - histogramArea->set_size_request (req.get_width(), 150); - histogramRGBArea->set_size_request (req.get_width(), 10); - - // Probably set R,G,B,V, RAW, and BAR button here to their original size if resizing below is implemented. - } - else { - set_size_request (req.get_width(), req.get_width()/2); - histogramArea->set_size_request (req.get_width(), req.get_width()/2); - histogramRGBArea->set_size_request(req.get_width(),5); - // Probably reduce R,G,B,V, RAW, and BAR button here a to a half-sized version. - } + int gHeight = req.get_width()/2; + if (gHeight > 150) gHeight = 150; else if (gHeight < 100) gHeight = 100; + int bHeight = req.get_width()/30; + if (bHeight > 10) bHeight = 10; else if (bHeight < 5 ) bHeight = 5; + histogramArea->set_size_request (req.get_width(), gHeight); + histogramRGBArea->set_size_request (req.get_width(), bHeight); rconn.block (false); @@ -131,36 +163,35 @@ void HistogramPanel::rgbv_toggled () { histogramArea->queue_draw (); } - void HistogramPanel::setHistRGBInvalid () { - // do something to un-show vertical bars - histogramRGBArea->renderRGBMarks(-1, -1, -1); - histogramRGBArea->queue_draw (); - } - + // do something to un-show vertical bars + histogramRGBArea->renderRGBMarks(-1, -1, -1); + histogramRGBArea->queue_draw (); +} + // "Freeze" is not a button, but a RMB-click, so this is not in the RGBV-Toggle method void HistogramPanel::toggleFreeze () { - if (histogramRGBArea->getFreeze()==true) { histogramRGBArea->updateFreeze(false); } - else { - if (histogramRGBArea->getShow()==true) { - histogramRGBArea->updateFreeze(true); - } - } - return; + if (histogramRGBArea->getFreeze()==true) { + histogramRGBArea->updateFreeze(false); + } + else if (histogramRGBArea->getShow()==true) { + histogramRGBArea->updateFreeze(true); + } + return; } void HistogramPanel::pointerMoved (bool validPos, Glib::ustring profile, int x, int y, int r, int g, int b) { - if (!validPos) { - // do something to un-show vertical bars - histogramRGBArea->renderRGBMarks(-1, -1, -1); - histogramRGBArea->queue_draw (); - } - else { - // do something to show vertical bars - histogramRGBArea->renderRGBMarks(r, g, b); - histogramRGBArea->queue_draw (); - } + if (!validPos) { + // do something to un-show vertical bars + histogramRGBArea->renderRGBMarks(-1, -1, -1); + histogramRGBArea->queue_draw (); + } + else { + // do something to show vertical bars + histogramRGBArea->renderRGBMarks(r, g, b); + histogramRGBArea->queue_draw (); + } } // @@ -168,7 +199,7 @@ void HistogramPanel::pointerMoved (bool validPos, Glib::ustring profile, int x, // // HistogramRGBArea HistogramRGBArea::HistogramRGBArea () : - frozen(false), valid(false), showMode(true), rawMode(false), needLuma(true), needRed(true), needGreen(true), needBlue(true) { + frozen(false), valid(false), needRed(true), needGreen(true), needBlue(true), needLuma(true), rawMode(false), showMode(options.histogramBar) { harih = new HistogramRGBAreaIdleHelper; harih->harea = this; @@ -224,7 +255,7 @@ void HistogramRGBArea::renderRGBMarks (int r, int g, int b) { window->draw_drawable (rgbgc_, overlay, 0, 0, 0, 0, -1, -1); } return; } else { - ovrl->set_foreground (style->get_fg (Gtk::STATE_NORMAL)); + ovrl->set_foreground (mgray); overlay->draw_rectangle (ovrl, true, 0, 0, winw, winh); if (rgbgc_ && overlay) { window->draw_drawable (rgbgc_, overlay, 0, 0, 0, 0, -1, -1); } @@ -305,26 +336,34 @@ void HistogramRGBArea::update (int valh, int rh, int gh, int bh) { g_idle_add (histrgbupdate, harih); } -void HistogramRGBArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, bool show) { +void HistogramRGBArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, bool bar) { needRed = r; needGreen = g; needBlue = b; needLuma = l; rawMode = raw; - showMode = show; + showMode = bar; // Histogram RGB BAR button logic goes here - // Disable bar button when RAW histogram is displayed - if ( rawMode && showMode) { + if (bar) { + // Toggled on, add (show) the widget + parent->pack_start(*this, Gtk::PACK_SHRINK, 0); + options.histogramBar = true; + } + else { + // Toggled off, remove (hide) the widget + removeIfThere(parent, this, false); + options.histogramBar = false; + // unfreeze + updateFreeze(false); + } + + // Disable (but don't hide it) the bar button when RAW histogram is displayed + if (rawMode) { showMode = false; } - - // When un-showing the bar, set the freeze state to off - if (!showMode) { - updateFreeze(false); - } } void HistogramRGBArea::on_realize () { @@ -384,18 +423,18 @@ void HistogramRGBArea::styleChanged (const Glib::RefPtr& style) { // // HistogramArea HistogramArea::HistogramArea () : - valid(false), showFull(true), oldwidth(-1), needLuma(true), needRed(true), needGreen(true), needBlue(true), rawMode(false) { + valid(false), showFull(true), oldwidth(-1), needLuma(true), needRed(true), needGreen(true), needBlue(true), rawMode(false) { - lhist(256); - rhist(256); - ghist(256); - bhist(256); + lhist(256); + rhist(256); + ghist(256); + bhist(256); haih = new HistogramAreaIdleHelper; haih->harea = this; haih->destroyed = false; haih->pending = 0; - + signal_style_changed().connect( sigc::mem_fun(*this, &HistogramArea::styleChanged) ); } diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 35db19f4c..3e76d6756 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -71,6 +71,8 @@ class HistogramRGBArea : public Gtk::DrawingArea { bool rawMode; bool showMode; + Gtk::VBox* parent; + HistogramRGBAreaIdleHelper* harih; public: @@ -82,6 +84,7 @@ class HistogramRGBArea : public Gtk::DrawingArea { void updateFreeze (bool f); bool getFreeze (); bool getShow (); + void setParent (Gtk::VBox* p) { parent = p; }; void update (int val, int rh, int gh, int bh); void updateOptions (bool r, bool g, bool b, bool l, bool raw, bool show); @@ -144,7 +147,8 @@ class HistogramPanel : public Gtk::HBox, public PointerMotionListener { protected: - HistogramArea* histogramArea; + Gtk::VBox* gfxVBox; + HistogramArea* histogramArea; HistogramRGBArea* histogramRGBArea; Gtk::ToggleButton* showRed; Gtk::ToggleButton* showGreen; diff --git a/rtgui/options.cc b/rtgui/options.cc index 75eda2223..87b57beed 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -149,6 +149,7 @@ void Options::setDefaults () { multiDisplayMode = 0; tunnelMetaData = false; histogramPosition = 2; + histogramBar = true; showProfileSelector = true; FileBrowserToolbarSingleRow = true; menuGroupRank = true; @@ -393,8 +394,9 @@ if (keyFile.has_group ("GUI")) { if (keyFile.has_key ("GUI", "ToolPanelsExpanded")) tpOpen = keyFile.get_integer_list ("GUI", "ToolPanelsExpanded"); if (keyFile.has_key ("GUI", "MultiDisplayMode")) multiDisplayMode = keyFile.get_integer ("GUI", "MultiDisplayMode"); //if (keyFile.has_key ("GUI", "CurvePanelsExpanded")) crvOpen = keyFile.get_integer_list ("GUI", "CurvePanelsExpanded"); - if (keyFile.has_key ("GUI", "CutOverlayBrush")) cutOverlayBrush = keyFile.get_double_list ("GUI", "CutOverlayBrush"); + if (keyFile.has_key ("GUI", "CutOverlayBrush")) cutOverlayBrush = keyFile.get_double_list ("GUI", "CutOverlayBrush"); if (keyFile.has_key ("GUI", "HistogramPosition")) histogramPosition = keyFile.get_integer ("GUI", "HistogramPosition"); + if (keyFile.has_key ("GUI", "HistogramBar")) histogramBar = keyFile.get_boolean ("GUI", "HistogramBar"); if (keyFile.has_key ("GUI", "ShowProfileSelector")) showProfileSelector = keyFile.get_boolean ("GUI", "ShowProfileSelector"); if (keyFile.has_key ("GUI", "FileBrowserToolbarSingleRow")) FileBrowserToolbarSingleRow = keyFile.get_boolean ("GUI", "FileBrowserToolbarSingleRow"); } @@ -563,6 +565,7 @@ int Options::saveToFile (Glib::ustring fname) { keyFile.set_integer ("GUI", "MultiDisplayMode", multiDisplayMode); keyFile.set_double_list ("GUI", "CutOverlayBrush", cutOverlayBrush); keyFile.set_integer ("GUI", "HistogramPosition", histogramPosition); + keyFile.set_boolean ("GUI", "HistogramBar", histogramBar); keyFile.set_boolean ("GUI", "ShowProfileSelector", showProfileSelector); keyFile.set_boolean ("GUI", "FileBrowserToolbarSingleRow", FileBrowserToolbarSingleRow); diff --git a/rtgui/options.h b/rtgui/options.h index 65ab35300..f0de3cae0 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -147,8 +147,9 @@ class Options { double sndLngEditProcDoneSecs; // Minimum processing time seconds till the sound is played bool sndEnable; - bool tunnelMetaData; // Pass through IPTC and XMP unchanged + bool tunnelMetaData; // Pass through IPTC and XMP unchanged int histogramPosition; // 0=disabled, 1=left pane, 2=right pane + bool histogramBar; bool showProfileSelector; bool FileBrowserToolbarSingleRow; diff --git a/tools/histogramButtons.svg b/tools/histogramButtons.svg new file mode 100644 index 000000000..231b6dd94 --- /dev/null +++ b/tools/histogramButtons.svg @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +