From c7be386c3a0d06dd5570d25b38d34c5e9efae4e1 Mon Sep 17 00:00:00 2001 From: Hombre Date: Tue, 20 Dec 2016 01:58:37 +0100 Subject: [PATCH] Solving issue #3531, assign classes to Gtk::Window and MyWidget - Curve editor buttons are set to expand by default, but they are set to shrink as soon as an accompagnying widget is set to expand - White Balance's method button now has a centered ellipse ("...") - White Balance's buttons are now aligned on their right - A "withScrollbar" class is added to MyExpander if the ToolPanel's vertical scrollbar is visible. This can let you add padding space for the scrollbar (see #MyExpander.withScrollbar in RT default theme) - A "maximized" and "fullscreen" class is added to the RTWindow whenever it change state ; BEWARE: if you maximize the window then make it fullscreen, Gtk says that the window is in a "maximized & fullscreen" state, which mean that both class can be added at the same time to the window. One Gtk oddity (at least on Windows) is that you can make your window fullscreen and still drag it around by its header bar... That's not very practical to click on the unfullscreen button if in Single Editor mode with vertical Tab. I also managed to see the window in a Inconified + Maximized state. This part of Gtk doesn't seem very robust, on Windows at least. --- rtdata/themes/RawTherapee-GTK3-20_.css | 38 ++++++++++++-------- rtgui/colortoning.cc | 8 ++--- rtgui/curveeditor.cc | 1 + rtgui/curveeditor.h | 1 + rtgui/curveeditorgroup.cc | 16 +++++++-- rtgui/curveeditorgroup.h | 2 +- rtgui/dirpyrdenoise.cc | 4 +-- rtgui/guiutils.cc | 27 ++++++++------ rtgui/guiutils.h | 7 ++-- rtgui/retinex.cc | 4 +-- rtgui/rtwindow.cc | 49 ++++++++++++++++++++++---- rtgui/toolpanelcoord.cc | 4 +++ rtgui/wavelet.cc | 10 +++--- rtgui/whitebalance.cc | 16 ++++++--- 14 files changed, 129 insertions(+), 58 deletions(-) diff --git a/rtdata/themes/RawTherapee-GTK3-20_.css b/rtdata/themes/RawTherapee-GTK3-20_.css index a18b41031..052560bb7 100644 --- a/rtdata/themes/RawTherapee-GTK3-20_.css +++ b/rtdata/themes/RawTherapee-GTK3-20_.css @@ -55,6 +55,12 @@ headerbar { background-image: none; } +/* Warning: maximized and fullscreen can be set at the same time ! */ +window.maximized > decoration, window.fullscreen > decoration { + padding: 0; + margin: 0; +} + window > decoration, dialog > decoration { box-shadow: none; margin: 0px; @@ -169,25 +175,20 @@ button { button.flat { background-image: none; } -button.popupbutton-arrow { - min-width: 18px; -} - -button:hover { - background-image: linear-gradient(#444444, #3E3E3E, #393939); +button.flat:checked { + background-image: linear-gradient(#343434, #2E2E2E, #292929); } checkbutton > check { background-image: linear-gradient(#343434, #2E2E2E, #292929); - -} -checkbutton:hover > check { - background-image: linear-gradient(#444444, #3E3E3E, #393939); } radiobutton > radio { background-image: linear-gradient(#343434, #2E2E2E, #292929); } -radiobutton:hover > radio { - background-image: linear-gradient(#444444, #3E3E3E, #393939); +button:hover , button.flat:hover, checkbutton:hover > check, radiobutton:hover > radio { + background-image: linear-gradient(shade(#343434,1.3), shade(#2E2E2E,1.3), shade(#292929,1.3)); +} +button.popupbutton-arrow { + min-width: 18px; } combobox { @@ -337,6 +338,10 @@ entry, spinbutton { background-color: #262626; } +spinbutton entry { + padding-right: 6px; +} + entry:disabled, spinbutton:disabled { background-color: #363636; } @@ -372,6 +377,9 @@ menuitem { margin: 0; padding: 0; } +#MyExpander.withScrollbar { + margin-right: 6px; +} /* Tool background */ #ExpanderBox > box, #ExpanderBox > grid { @@ -476,8 +484,8 @@ menuitem { } #MyExpanderTitle > box { - margin: 2px 0 2px 0; - padding: 2px; + margin: 2px 0; + padding: 2px 0; } #MyExpanderTitle label { @@ -798,7 +806,7 @@ paned.vertical > separator { } #RightNotebook #ToolPanelNotebook stack { - margin: 4px; + margin: 0px; } #RightNotebook #HistoryPanel { diff --git a/rtgui/colortoning.cc b/rtgui/colortoning.cc index ce595e90f..ceec0092f 100644 --- a/rtgui/colortoning.cc +++ b/rtgui/colortoning.cc @@ -40,7 +40,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR colorCurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_COLOR")); colorCurveEditorG->setCurveListener (this); - colorShape = static_cast(colorCurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + colorShape = static_cast(colorCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); colorShape->setCurveColorProvider(this, 1); std::vector milestones; @@ -89,7 +89,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR opacityCurveEditorG->setCurveListener (this); rtengine::ColorToningParams::getDefaultOpacityCurve(defaultCurve); - opacityShape = static_cast(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + opacityShape = static_cast(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); opacityShape->setIdentityValue(0.); opacityShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); opacityShape->setBottomBarBgGradient(milestones); @@ -108,7 +108,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR clCurveEditorG->setCurveListener (this); rtengine::ColorToningParams::getDefaultCLCurve(defaultCurve); - clshape = static_cast(clCurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_AB"), irg)); + clshape = static_cast(clCurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_AB"), irg, false)); clshape->setResetCurve(DiagonalCurveType(defaultCurve.at(0)), defaultCurve); clshape->setTooltip(M("TP_COLORTONING_CURVEEDITOR_CL_TOOLTIP")); @@ -128,7 +128,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR cl2CurveEditorG->setCurveListener (this); rtengine::ColorToningParams::getDefaultCL2Curve(defaultCurve); - cl2shape = static_cast(cl2CurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_BY"), iby)); + cl2shape = static_cast(cl2CurveEditorG->addCurve(CT_Diagonal, M("TP_COLORTONING_BY"), iby, false)); cl2shape->setResetCurve(DiagonalCurveType(defaultCurve.at(0)), defaultCurve); cl2shape->setTooltip(M("TP_COLORTONING_CURVEEDITOR_CL_TOOLTIP")); diff --git a/rtgui/curveeditor.cc b/rtgui/curveeditor.cc index 5428677c3..117051b2a 100644 --- a/rtgui/curveeditor.cc +++ b/rtgui/curveeditor.cc @@ -200,6 +200,7 @@ CurveEditor::CurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEd leftBarCP = nullptr; curveCP = nullptr; relatedWidget = nullptr; + expandRelatedWidget = true; group = ceGroup; subGroup = ceSubGroup; diff --git a/rtgui/curveeditor.h b/rtgui/curveeditor.h index a3ba68436..3f279ff05 100644 --- a/rtgui/curveeditor.h +++ b/rtgui/curveeditor.h @@ -66,6 +66,7 @@ protected: CurveEditorGroup* group; CurveEditorSubGroup* subGroup; Gtk::Widget* relatedWidget; + bool expandRelatedWidget; std::vector tempCurve; sigc::connection typeconn; diff --git a/rtgui/curveeditorgroup.cc b/rtgui/curveeditorgroup.cc index f813919bb..8c2efdadd 100644 --- a/rtgui/curveeditorgroup.cc +++ b/rtgui/curveeditorgroup.cc @@ -74,7 +74,7 @@ void CurveEditorGroup::hideCurrentCurve() * periodic: for FlatCurve only, ask the curve to be periodic (default: True) * */ -CurveEditor* CurveEditorGroup::addCurve(CurveType cType, Glib::ustring curveLabel, Gtk::Widget *relatedWidget, bool periodic) +CurveEditor* CurveEditorGroup::addCurve(CurveType cType, Glib::ustring curveLabel, Gtk::Widget *relatedWidget, bool expandRelatedWidget, bool periodic) { switch (cType) { case (CT_Diagonal): { @@ -85,6 +85,7 @@ CurveEditor* CurveEditorGroup::addCurve(CurveType cType, Glib::ustring curveLabe // We add it to the curve editor list DiagonalCurveEditor* newCE = diagonalSubGroup->addCurve(curveLabel); newCE->relatedWidget = relatedWidget; + newCE->expandRelatedWidget = expandRelatedWidget; curveEditors.push_back(newCE); return (newCE); } @@ -97,6 +98,7 @@ CurveEditor* CurveEditorGroup::addCurve(CurveType cType, Glib::ustring curveLabe // We add it to the curve editor list FlatCurveEditor* newCE = flatSubGroup->addCurve(curveLabel, periodic); newCE->relatedWidget = relatedWidget; + newCE->expandRelatedWidget = expandRelatedWidget; curveEditors.push_back(newCE); return (newCE); } @@ -127,10 +129,20 @@ void CurveEditorGroup::newLine() currLine->attach(*curveGroupLabel, x++, 0, 1, 1); } + bool rwe = false; + for (int i = numberOfPackedCurve; i < (int)(curveEditors.size()); ++i) { + if (curveEditors[i]->relatedWidget != nullptr && curveEditors[i]->expandRelatedWidget) { + rwe = true; + } + } + + for (int i = numberOfPackedCurve; i < (int)(curveEditors.size()); ++i) { + setExpandAlignProperties(curveEditors[i]->curveType->buttonGroup, !rwe, true, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL); currLine->attach(*curveEditors[i]->curveType->buttonGroup, x++, 0, 1, 1); if (curveEditors[i]->relatedWidget != nullptr) { + setExpandAlignProperties(curveEditors[i]->relatedWidget, curveEditors[i]->expandRelatedWidget, true, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL); currLine->attach(*curveEditors[i]->relatedWidget, x++, 0, 1, 1); } @@ -139,7 +151,7 @@ void CurveEditorGroup::newLine() if (isHeader) { curve_reset = Gtk::manage (new Gtk::Button ()); - setExpandAlignProperties(curve_reset, false, false, Gtk::ALIGN_END, Gtk::ALIGN_FILL); + setExpandAlignProperties(curve_reset, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); curve_reset->add (*Gtk::manage (new RTImage ("gtk-undo-ltr-small.png", "gtk-undo-rtl-small.png"))); curve_reset->set_relief (Gtk::RELIEF_NONE); curve_reset->set_tooltip_text (M("CURVEEDITOR_TOOLTIPLINEAR")); diff --git a/rtgui/curveeditorgroup.h b/rtgui/curveeditorgroup.h index 2b1da158f..ffd522fae 100644 --- a/rtgui/curveeditorgroup.h +++ b/rtgui/curveeditorgroup.h @@ -86,7 +86,7 @@ public: return displayedCurve; } //void on_realize (); - CurveEditor* addCurve(CurveType cType, Glib::ustring curveLabel, Gtk::Widget *relatedWidget = nullptr, bool periodic = true); + CurveEditor* addCurve(CurveType cType, Glib::ustring curveLabel, Gtk::Widget *relatedWidget = nullptr, bool expandRelatedWidget = true, bool periodic = true); void attachCurve (Gtk::Grid* curve); protected: diff --git a/rtgui/dirpyrdenoise.cc b/rtgui/dirpyrdenoise.cc index 1871d4ab0..a5611cc45 100644 --- a/rtgui/dirpyrdenoise.cc +++ b/rtgui/dirpyrdenoise.cc @@ -62,7 +62,7 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP //curveEditorG = new CurveEditorGroup (options.lastLabCurvesDir); NoiscurveEditorG->setCurveListener (this); rtengine::DirPyrDenoiseParams::getDefaultNoisCurve(defaultCurve); - lshape = static_cast(NoiscurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + lshape = static_cast(NoiscurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); lshape->setIdentityValue(0.); lshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); @@ -150,7 +150,7 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP CCcurveEditorG = new CurveEditorGroup (options.lastDenoiseCurvesDir, M("TP_DIRPYRDENOISE_CCCURVE")); CCcurveEditorG->setCurveListener (this); rtengine::DirPyrDenoiseParams::getDefaultCCCurve(defaultCurve); - ccshape = static_cast(CCcurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + ccshape = static_cast(CCcurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); ccshape->setIdentityValue(0.); ccshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 0726e27c4..23ef02658 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -591,11 +591,8 @@ MyExpander::MyExpander(bool useEnabled, Gtk::Widget* titleWidget) : pack_start(*titleEvBox, Gtk::PACK_EXPAND_WIDGET, 0); -//GTK318 -#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 updateStyle(); -#endif -//GTK318 + titleEvBox->signal_button_release_event().connect( sigc::mem_fun(this, & MyExpander::on_toggle) ); titleEvBox->signal_enter_notify_event().connect( sigc::mem_fun(this, & MyExpander::on_enter_leave_title), false); titleEvBox->signal_leave_notify_event().connect( sigc::mem_fun(this, & MyExpander::on_enter_leave_title), false); @@ -651,11 +648,8 @@ MyExpander::MyExpander(bool useEnabled, Glib::ustring titleLabel) : pack_start(*titleEvBox, Gtk::PACK_EXPAND_WIDGET, 0); -//GTK318 -#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 updateStyle(); -#endif -//GTK318 + titleEvBox->signal_button_release_event().connect( sigc::mem_fun(this, & MyExpander::on_toggle)); titleEvBox->signal_enter_notify_event().connect( sigc::mem_fun(this, & MyExpander::on_enter_leave_title), false); titleEvBox->signal_leave_notify_event().connect( sigc::mem_fun(this, & MyExpander::on_enter_leave_title), false); @@ -691,17 +685,28 @@ bool MyExpander::on_enter_leave_enable (GdkEventCrossing* event) return true; } -//GTK318 -#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 void MyExpander::updateStyle() { + updateVScrollbars(options.hideTPVScrollbar); + +//GTK318 +#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 headerHBox->set_spacing(2); headerHBox->set_border_width(1); set_spacing(0); set_border_width(0); -} #endif //GTK318 +} + +void MyExpander::updateVScrollbars(bool hide) +{ + if (hide) { + get_style_context()->remove_class("withScrollbar"); + } else { + get_style_context()->add_class("withScrollbar"); + } +} void MyExpander::setLevel (int level) { diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index 0a7489e12..82d2e0c3a 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -178,11 +178,8 @@ private: bool on_enter_leave_title (GdkEventCrossing* event); /// Used to handle the colored background for the Enable button bool on_enter_leave_enable (GdkEventCrossing* event); -//GTK318 -#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 + void updateStyle(); -#endif -//GTK318 protected: Gtk::Container* child; /// Gtk::Contained to display below the expander's title @@ -256,6 +253,8 @@ public: /// Add a Gtk::Container for the content of the expander /// Warning: do not manually Show/Hide the widget, because this parameter is handled by the click on the Expander's title void add (Gtk::Container& widget); + + void updateVScrollbars(bool hide); }; diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index b5606fbe2..a466e8500 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -383,7 +383,7 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"), setExpandAlignProperties(transmissionCurveEditorG, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); transmissionCurveEditorG->setCurveListener (this); rtengine::RetinexParams::getDefaulttransmissionCurve(defaultCurve); - transmissionShape = static_cast(transmissionCurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + transmissionShape = static_cast(transmissionCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); transmissionShape->setIdentityValue(0.); transmissionShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); transmissionShape->setBottomBarBgGradient(milestones); @@ -438,7 +438,7 @@ Retinex::Retinex () : FoldableToolPanel(this, "retinex", M("TP_RETINEX_LABEL"), setExpandAlignProperties(gaintransmissionCurve, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); gaintransmissionCurve->setCurveListener (this); rtengine::RetinexParams::getDefaultgaintransmissionCurve(defaultCurve); - gaintransmissionShape = static_cast(gaintransmissionCurve->addCurve(CT_Flat, "", nullptr, false)); + gaintransmissionShape = static_cast(gaintransmissionCurve->addCurve(CT_Flat, "", nullptr, false, false)); gaintransmissionShape->setIdentityValue(0.); gaintransmissionShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); gaintransmissionShape->setBottomBarBgGradient(milestones); diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index f00eb6348..ea64a1043 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -133,6 +133,7 @@ RTWindow::RTWindow () if (options.windowMaximized) { maximize(); + get_style_context()->add_class("maximized"); } else { unmaximize(); move(options.windowX, options.windowY); @@ -385,14 +386,48 @@ void RTWindow::on_realize () bool RTWindow::on_window_state_event(GdkEventWindowState* event) { - const int new_window_state = event->new_window_state & ~GDK_WINDOW_STATE_FOCUSED; + /* + printf("Window state event: %s%s%s%s%s%s%s%s%s\n", + event->new_window_state & GDK_WINDOW_STATE_WITHDRAWN ? "Withdrawn" : "", + event->new_window_state & GDK_WINDOW_STATE_ICONIFIED ? " Iconified" : "", + event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED ? " Maximized" : "", + event->new_window_state & GDK_WINDOW_STATE_STICKY ? " Sticky" : "", + event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN ? " Fullscreen" : "", + event->new_window_state & GDK_WINDOW_STATE_ABOVE ? " Above" : "", + event->new_window_state & GDK_WINDOW_STATE_BELOW ? " Below" : "", + event->new_window_state & GDK_WINDOW_STATE_FOCUSED ? " Focused" : "", + event->new_window_state & GDK_WINDOW_STATE_TILED ? " Tiled" : "" + ); + */ - if (!new_window_state) { - // Window mode - options.windowMaximized = false; - } else if (new_window_state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN | GDK_WINDOW_STATE_ICONIFIED)) { - // Fullscreen mode, save this mode even when window is iconified (minimized) to allow easier restore, not the best solution though... - options.windowMaximized = true; + // Return if we get iconified + if (event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) { + return true; + } + + // Then looking for evolutions of GDK_WINDOW_STATE_FULLSCREEN & GDK_WINDOW_STATE_MAXIMIZED only + bool isFullScreen = event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN; + bool isMaximized = event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED; + bool switchFullScreen = event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN; + bool switchMaximized = event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED; + + if (switchFullScreen) { + // Fullscreen mode + if (isFullScreen) { + get_style_context()->add_class("fullscreen"); + } else { + get_style_context()->remove_class("fullscreen"); + } + } + if (switchMaximized) { + // Maximized mode + if (isMaximized) { + options.windowMaximized = true; + get_style_context()->add_class("maximized"); + } else { + options.windowMaximized = false; + get_style_context()->remove_class("maximized"); + } } return true; diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 3ebbcd616..98dc311f8 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -831,6 +831,10 @@ void ToolPanelCoordinator::updateVScrollbars (bool hide) transformPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy); rawPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy); waveletPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy); + + for (auto currExp : expList) { + currExp->updateVScrollbars(hide); + } } void ToolPanelCoordinator::updateTabsHeader (bool useIcons) diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index 1b2af6b8a..6b659ea5e 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -365,7 +365,7 @@ Wavelet::Wavelet () : FoldableToolPanel(this, "wavelet", M("TP_WAVELET_LABEL"), opaCurveEditorG->setCurveListener (this); rtengine::WaveletParams::getDefaultOpacityCurveRG(defaultCurve); - opacityShapeRG = static_cast(opaCurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + opacityShapeRG = static_cast(opaCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); opacityShapeRG->setIdentityValue(0.); opacityShapeRG->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); @@ -378,7 +378,7 @@ Wavelet::Wavelet () : FoldableToolPanel(this, "wavelet", M("TP_WAVELET_LABEL"), opacityCurveEditorG->setCurveListener (this); rtengine::WaveletParams::getDefaultOpacityCurveBY(defaultCurve); - opacityShapeBY = static_cast(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + opacityShapeBY = static_cast(opacityCurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); opacityShapeBY->setIdentityValue(0.); opacityShapeBY->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); @@ -474,7 +474,7 @@ Wavelet::Wavelet () : FoldableToolPanel(this, "wavelet", M("TP_WAVELET_LABEL"), CCWcurveEditorG->setCurveListener (this); rtengine::WaveletParams::getDefaultCCWCurve(defaultCurve); - ccshape = static_cast(CCWcurveEditorG->addCurve(CT_Flat, "", nullptr, false)); + ccshape = static_cast(CCWcurveEditorG->addCurve(CT_Flat, "", nullptr, false, false)); ccshape->setIdentityValue(0.); ccshape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); @@ -794,7 +794,7 @@ Wavelet::Wavelet () : FoldableToolPanel(this, "wavelet", M("TP_WAVELET_LABEL"), opacityCurveEditorW->setCurveListener (this); rtengine::WaveletParams::getDefaultOpacityCurveW(defaultCurve); - opacityShape = static_cast(opacityCurveEditorW->addCurve(CT_Flat, "", nullptr, false)); + opacityShape = static_cast(opacityCurveEditorW->addCurve(CT_Flat, "", nullptr, false, false)); opacityShape->setIdentityValue(0.); opacityShape->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); opacityShape->setBottomBarBgGradient(milestonesW); @@ -813,7 +813,7 @@ Wavelet::Wavelet () : FoldableToolPanel(this, "wavelet", M("TP_WAVELET_LABEL"), opacityCurveEditorWL->setCurveListener (this); rtengine::WaveletParams::getDefaultOpacityCurveWL(defaultCurve); - opacityShapeWL = static_cast(opacityCurveEditorWL->addCurve(CT_Flat, "", nullptr, false)); + opacityShapeWL = static_cast(opacityCurveEditorWL->addCurve(CT_Flat, "", nullptr, false, false)); opacityShapeWL->setIdentityValue(0.); opacityShapeWL->setResetCurve(FlatCurveType(defaultCurve.at(0)), defaultCurve); opacityShapeWL->setTooltip(M("TP_WAVELET_OPACITYWL_TOOLTIP")); diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index ffc650cdb..d0413412b 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -151,6 +151,7 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB { Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); + hbox->set_spacing(4); hbox->show (); Gtk::Label* lab = Gtk::manage (new Gtk::Label (M("TP_WBALANCE_METHOD"))); lab->show (); @@ -238,14 +239,19 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB method->pack_start(methodColumns.colIcon, false); method->pack_start(methodColumns.colLabel, true); + std::vector cells = method->get_cells(); + Gtk::CellRendererText* cellRenderer = dynamic_cast(cells.at(1)); + cellRenderer->property_ellipsize() = Pango::ELLIPSIZE_MIDDLE; + method->set_active (0); // Camera method->show (); - hbox->pack_start (*lab, Gtk::PACK_SHRINK, 4); + hbox->pack_start (*lab, Gtk::PACK_SHRINK, 0); hbox->pack_start (*method); - pack_start (*hbox, Gtk::PACK_SHRINK, 4); + pack_start (*hbox, Gtk::PACK_SHRINK, 0); opt = 0; Gtk::HBox* spotbox = Gtk::manage (new Gtk::HBox ()); + spotbox->set_spacing(4); spotbox->show (); spotbutton = Gtk::manage (new Gtk::Button ()); @@ -292,10 +298,10 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB spotsize->set_active(4); } - spotbox->pack_end (*spotsize, Gtk::PACK_EXPAND_WIDGET, 4); - spotbox->pack_end (*slab, Gtk::PACK_SHRINK, 4); + spotbox->pack_end (*spotsize, Gtk::PACK_EXPAND_WIDGET, 0); + spotbox->pack_end (*slab, Gtk::PACK_SHRINK, 0); - pack_start (*spotbox, Gtk::PACK_SHRINK, 4); + pack_start (*spotbox, Gtk::PACK_SHRINK, 0); Gtk::Image* itempL = Gtk::manage (new RTImage ("ajd-wb-temp1.png")); Gtk::Image* itempR = Gtk::manage (new RTImage ("ajd-wb-temp2.png"));