From 5309307c7ba5f885be4f25ef329a3e46bf68a0ce Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Wed, 18 Jul 2018 19:37:24 +0200 Subject: [PATCH] Theme tweaks in light of new icons, #4469 - Button and combobox sizes consistent. - Padding around left and right edges of comboboxes. - Fixed bug in green channel preview togglebutton icon always being shown as "off". - Added CSS classes to various elements. --- rtdata/languages/English (UK) | 2 +- rtdata/languages/English (US) | 2 +- rtdata/languages/Portugues (Brasil) | 2 +- rtdata/languages/default | 2 +- rtdata/themes/RawTherapee-GTK3-20_.css | 64 +++++++++++++++++++++++++- rtgui/crop.cc | 1 + rtgui/distortion.cc | 1 + rtgui/filecatalog.cc | 10 ++++ rtgui/gradient.cc | 1 + rtgui/imagearea.cc | 1 + rtgui/lensgeom.cc | 1 + rtgui/popupcommon.cc | 1 + rtgui/previewmodepanel.cc | 10 +++- rtgui/rotate.cc | 1 + rtgui/whitebalance.cc | 1 + 15 files changed, 93 insertions(+), 7 deletions(-) diff --git a/rtdata/languages/English (UK) b/rtdata/languages/English (UK) index 25687187f..47de0e9eb 100644 --- a/rtdata/languages/English (UK) +++ b/rtdata/languages/English (UK) @@ -2210,7 +2210,7 @@ TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behaviour of "wh !TP_WBALANCE_SOLUX41;Solux 4100K !TP_WBALANCE_SOLUX47;Solux 4700K (vendor) !TP_WBALANCE_SOLUX47_NG;Solux 4700K (Nat. Gallery) -!TP_WBALANCE_SPOTWB;Spot WB +!TP_WBALANCE_SPOTWB;Use the pipette to pick the white balance from a neutral patch in the preview. !TP_WBALANCE_TEMPBIAS;AWB temperature bias !TP_WBALANCE_TEMPBIAS_TOOLTIP;Allows to alter the computation of the "auto white balance"\nby biasing it towards warmer or cooler temperatures. The bias\nis expressed as a percentage of the computed temperature,\nso that the result is given by "computedTemp + computedTemp * bias". !TP_WBALANCE_TEMPERATURE;Temperature diff --git a/rtdata/languages/English (US) b/rtdata/languages/English (US) index 7aff8a60c..01328cdaa 100644 --- a/rtdata/languages/English (US) +++ b/rtdata/languages/English (US) @@ -2210,7 +2210,7 @@ !TP_WBALANCE_SOLUX41;Solux 4100K !TP_WBALANCE_SOLUX47;Solux 4700K (vendor) !TP_WBALANCE_SOLUX47_NG;Solux 4700K (Nat. Gallery) -!TP_WBALANCE_SPOTWB;Spot WB +!TP_WBALANCE_SPOTWB;Use the pipette to pick the white balance from a neutral patch in the preview. !TP_WBALANCE_TEMPBIAS;AWB temperature bias !TP_WBALANCE_TEMPBIAS_TOOLTIP;Allows to alter the computation of the "auto white balance"\nby biasing it towards warmer or cooler temperatures. The bias\nis expressed as a percentage of the computed temperature,\nso that the result is given by "computedTemp + computedTemp * bias". !TP_WBALANCE_TEMPERATURE;Temperature diff --git a/rtdata/languages/Portugues (Brasil) b/rtdata/languages/Portugues (Brasil) index 3c7548a80..0518c3358 100644 --- a/rtdata/languages/Portugues (Brasil) +++ b/rtdata/languages/Portugues (Brasil) @@ -2198,7 +2198,7 @@ TP_WBALANCE_SOLUX35;Solux 3500K TP_WBALANCE_SOLUX41;Solux 4100K TP_WBALANCE_SOLUX47;Solux 4700K (vendor) TP_WBALANCE_SOLUX47_NG;Solux 4700K (Galeria Nat.) -TP_WBALANCE_SPOTWB;Spot WB +TP_WBALANCE_SPOTWB;Use the pipette to pick the white balance from a neutral patch in the preview. TP_WBALANCE_TEMPBIAS;Viés de temperatura AWB TP_WBALANCE_TEMPBIAS_TOOLTIP;Permite alterar o cálculo do "balanço de branco automático"\ninclinando-o para temperaturas mais quentes ou mais frias. O viés\né expresso como uma porcentagem da temperatura calculada,\npara que o resultado seja dado por "Temperatura calculada + Temperatura calculada * viés". TP_WBALANCE_TEMPERATURE;Temperatura diff --git a/rtdata/languages/default b/rtdata/languages/default index 99a23fb84..9bd32e982 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2209,7 +2209,7 @@ TP_WBALANCE_SOLUX35;Solux 3500K TP_WBALANCE_SOLUX41;Solux 4100K TP_WBALANCE_SOLUX47;Solux 4700K (vendor) TP_WBALANCE_SOLUX47_NG;Solux 4700K (Nat. Gallery) -TP_WBALANCE_SPOTWB;Spot WB +TP_WBALANCE_SPOTWB;Use the pipette to pick the white balance from a neutral patch in the preview. TP_WBALANCE_TEMPBIAS;AWB temperature bias TP_WBALANCE_TEMPBIAS_TOOLTIP;Allows to alter the computation of the "auto white balance"\nby biasing it towards warmer or cooler temperatures. The bias\nis expressed as a percentage of the computed temperature,\nso that the result is given by "computedTemp + computedTemp * bias". TP_WBALANCE_TEMPERATURE;Temperature diff --git a/rtdata/themes/RawTherapee-GTK3-20_.css b/rtdata/themes/RawTherapee-GTK3-20_.css index 3f25ce509..91aff9a99 100644 --- a/rtdata/themes/RawTherapee-GTK3-20_.css +++ b/rtdata/themes/RawTherapee-GTK3-20_.css @@ -225,6 +225,7 @@ scrollbar.vertical.overlay-indicator:not(.hovering) slider { button { padding: 0; + box-shadow: none; min-height: 5px; min-width: 5px; background-image: linear-gradient(to bottom, rgba(100,100,100,.3), rgba(30,30,30,.3)); @@ -631,7 +632,6 @@ flowboxchild:selected { /* Editor tab button */ #MainNotebook grid label, #MainNotebook grid image { - /* OK */ padding: 1px; } @@ -954,5 +954,65 @@ button#MyFileChooserButton { } #ToolPanelNotebook button { - margin: 0px; + margin: 0px; } + +button.flat { + background: none; + border: none; + outline: none; +} + +button.flat:checked { + background: #262626; +} + +.text-button, .image-button, .independent { + box-shadow: none; + min-height: 24px; + min-width: 24px; + padding: 0px; +} + +/* Makes image-comboboxes (e.g. tone curve types) have same size as image buttons */ +combobox, .popupbutton-arrow { + min-height: 24px; +} + +/* Makes image-combobox small icons centered */ +button.toggle > grid > image { + padding: 4px; +} + +#histButton { + background: none; + min-height: 16px; + min-width: 16px; +} + +/* -gtk-icon-shadow looks buggy on the small histogram icons */ +#histButton:hover { + -gtk-icon-shadow: none; +} + +.narrowbutton { + min-width: 10px; +} + + +.smallbuttonbox button { + min-width: 16px; + min-height: 16px; +} + +/* Adds padding around sides of text-buttons */ +button.text-button { + padding: 0 8px; +} + +/* Adds gap between combobox contents and combobox edges */ +button.combo, .image-combo .toggle, #MyFileChooserButton { + padding-left: 4px; + padding-right: 4px; +} + diff --git a/rtgui/crop.cc b/rtgui/crop.cc index caa3b5ea2..c229a6088 100644 --- a/rtgui/crop.cc +++ b/rtgui/crop.cc @@ -128,6 +128,7 @@ Crop::Crop(): pack_start (*hb2, Gtk::PACK_SHRINK, 4); selectCrop = Gtk::manage (new Gtk::Button (M("TP_CROP_SELECTCROP"))); + selectCrop->get_style_context()->add_class("independent"); selectCrop->set_image (*Gtk::manage (new RTImage ("crop-small.png"))); pack_start (*selectCrop, Gtk::PACK_SHRINK, 2); diff --git a/rtgui/distortion.cc b/rtgui/distortion.cc index ae1da88f5..c181ed479 100644 --- a/rtgui/distortion.cc +++ b/rtgui/distortion.cc @@ -29,6 +29,7 @@ Distortion::Distortion (): FoldableToolPanel(this, "distortion", M("TP_DISTORTIO rlistener = nullptr; autoDistor = Gtk::manage (new Gtk::Button (M("GENERAL_AUTO"))); autoDistor->set_image (*Gtk::manage (new RTImage ("distortion-auto-small.png"))); + autoDistor->get_style_context()->add_class("independent"); autoDistor->set_alignment(0.5f, 0.5f); autoDistor->set_tooltip_text (M("TP_DISTORTION_AUTO_TIP")); idConn = autoDistor->signal_pressed().connect( sigc::mem_fun(*this, &Distortion::idPressed) ); diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index d0866a021..3b9b2a673 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -163,11 +163,14 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : fltrVbox1 = Gtk::manage (new Gtk::VBox()); fltrRankbox = Gtk::manage (new Gtk::HBox()); + fltrRankbox->get_style_context()->add_class("smallbuttonbox"); fltrLabelbox = Gtk::manage (new Gtk::HBox()); + fltrLabelbox->get_style_context()->add_class("smallbuttonbox"); iUnRanked = new RTImage ("star-gold-hollow-small.png"); igUnRanked = new RTImage ("star-hollow-small.png"); bUnRanked = Gtk::manage( new Gtk::ToggleButton () ); + bUnRanked->get_style_context()->add_class("smallbutton"); bUnRanked->set_active (false); bUnRanked->set_image (*igUnRanked); bUnRanked->set_relief (Gtk::RELIEF_NONE); @@ -182,6 +185,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : iranked[i]->show (); igranked[i]->show (); bRank[i] = Gtk::manage( new Gtk::ToggleButton () ); + bRank[i]->get_style_context()->add_class("smallbutton"); bRank[i]->set_image (*igranked[i]); bRank[i]->set_relief (Gtk::RELIEF_NONE); fltrRankbox->pack_start (*bRank[i], Gtk::PACK_SHRINK); @@ -196,6 +200,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : iUnCLabeled = new RTImage(clabelActiveIcons[0]); igUnCLabeled = new RTImage(clabelInactiveIcons[0]); bUnCLabeled = Gtk::manage(new Gtk::ToggleButton()); + bUnCLabeled->get_style_context()->add_class("smallbutton"); bUnCLabeled->set_active(false); bUnCLabeled->set_image(*igUnCLabeled); bUnCLabeled->set_relief(Gtk::RELIEF_NONE); @@ -210,6 +215,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : iCLabeled[i]->show(); igCLabeled[i]->show(); bCLabel[i] = Gtk::manage(new Gtk::ToggleButton()); + bCLabel[i]->get_style_context()->add_class("smallbutton"); bCLabel[i]->set_image(*igCLabeled[i]); bCLabel[i]->set_relief(Gtk::RELIEF_NONE); fltrLabelbox->pack_start(*bCLabel[i], Gtk::PACK_SHRINK); @@ -237,7 +243,9 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : fltrVbox2 = Gtk::manage (new Gtk::VBox()); fltrEditedBox = Gtk::manage (new Gtk::HBox()); + fltrEditedBox->get_style_context()->add_class("smallbuttonbox"); fltrRecentlySavedBox = Gtk::manage (new Gtk::HBox()); + fltrRecentlySavedBox->get_style_context()->add_class("smallbuttonbox"); // bEdited // TODO The "g" variant was the more transparent variant of the icon, used @@ -251,6 +259,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : for (int i = 0; i < 2; i++) { iEdited[i]->show (); bEdited[i] = Gtk::manage(new Gtk::ToggleButton ()); + bEdited[i]->get_style_context()->add_class("smallbutton"); bEdited[i]->set_active (false); bEdited[i]->set_image (*igEdited[i]); bEdited[i]->set_relief (Gtk::RELIEF_NONE); @@ -275,6 +284,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : for (int i = 0; i < 2; i++) { iRecentlySaved[i]->show (); bRecentlySaved[i] = Gtk::manage(new Gtk::ToggleButton ()); + bRecentlySaved[i]->get_style_context()->add_class("smallbutton"); bRecentlySaved[i]->set_active (false); bRecentlySaved[i]->set_image (*igRecentlySaved[i]); bRecentlySaved[i]->set_relief (Gtk::RELIEF_NONE); diff --git a/rtgui/gradient.cc b/rtgui/gradient.cc index 10cc30054..88e67adb3 100644 --- a/rtgui/gradient.cc +++ b/rtgui/gradient.cc @@ -13,6 +13,7 @@ Gradient::Gradient () : FoldableToolPanel(this, "gradient", M("TP_GRADIENT_LABEL editHBox = Gtk::manage (new Gtk::HBox()); edit = Gtk::manage (new Gtk::ToggleButton()); + edit->get_style_context()->add_class("independent"); edit->add (*Gtk::manage (new RTImage ("crosshair-adjust.png"))); edit->set_tooltip_text(M("EDIT_OBJECT_TOOLTIP")); editConn = edit->signal_toggled().connect( sigc::mem_fun(*this, &Gradient::editToggled) ); diff --git a/rtgui/imagearea.cc b/rtgui/imagearea.cc index b5989b098..b2b938139 100644 --- a/rtgui/imagearea.cc +++ b/rtgui/imagearea.cc @@ -43,6 +43,7 @@ ImageArea::ImageArea (ImageAreaPanel* p) : parent(p), fullImageWidth(0), fullIma zoomPanel = Gtk::manage (new ZoomPanel (this)); indClippedPanel = Gtk::manage (new IndicateClippedPanel (this)); previewModePanel = Gtk::manage (new PreviewModePanel (this)); + previewModePanel->get_style_context()->add_class("narrowbuttonbox"); add_events(Gdk::LEAVE_NOTIFY_MASK); diff --git a/rtgui/lensgeom.cc b/rtgui/lensgeom.cc index 2f74f4e42..898fa1105 100644 --- a/rtgui/lensgeom.cc +++ b/rtgui/lensgeom.cc @@ -31,6 +31,7 @@ LensGeometry::LensGeometry () : FoldableToolPanel(this, "lensgeom", M("TP_LENSGE autoCrop = Gtk::manage (new Gtk::Button (M("TP_LENSGEOM_AUTOCROP"))); autoCrop->set_image (*Gtk::manage (new RTImage ("crop-auto-small.png"))); + autoCrop->get_style_context()->add_class("independent"); pack_start (*autoCrop, Gtk::PACK_SHRINK, 2); packBox = Gtk::manage (new ToolParamBlock ()); diff --git a/rtgui/popupcommon.cc b/rtgui/popupcommon.cc index a64c8303b..b7d08721e 100644 --- a/rtgui/popupcommon.cc +++ b/rtgui/popupcommon.cc @@ -47,6 +47,7 @@ PopUpCommon::PopUpCommon (Gtk::Button* thisButton, const Glib::ustring& label) buttonGroup = Gtk::manage( new Gtk::Grid()); setExpandAlignProperties(buttonGroup, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); buttonGroup->attach(*button, 0, 0, 1, 1); + buttonGroup->get_style_context()->add_class("image-combo"); } PopUpCommon::~PopUpCommon () diff --git a/rtgui/previewmodepanel.cc b/rtgui/previewmodepanel.cc index 9e88f7626..4b821f298 100644 --- a/rtgui/previewmodepanel.cc +++ b/rtgui/previewmodepanel.cc @@ -25,7 +25,7 @@ PreviewModePanel::PreviewModePanel (ImageArea* ia) : imageArea(ia) { iR = new RTImage ("square-toggle-red-on.png"); - iG = new RTImage ("square-toggle-green-off.png"); + iG = new RTImage ("square-toggle-green-on.png"); iB = new RTImage ("square-toggle-blue-on.png"); iL = new RTImage ("square-toggle-luminosity-on.png"); iBC0 = new RTImage ("square-toggle-theme-on.png"); @@ -43,41 +43,49 @@ PreviewModePanel::PreviewModePanel (ImageArea* ia) : imageArea(ia) igBC3 = new RTImage ("square-toggle-gray-off.png"); backColor0 = Gtk::manage (new Gtk::ToggleButton ()); + backColor0->get_style_context()->add_class("narrowbutton"); backColor0->set_relief(Gtk::RELIEF_NONE); backColor0->set_tooltip_markup (M("MAIN_TOOLTIP_BACKCOLOR0")); backColor0->set_image(options.bgcolor == 0 ? *iBC0 : *igBC0); backColor1 = Gtk::manage (new Gtk::ToggleButton ()); + backColor1->get_style_context()->add_class("narrowbutton"); backColor1->set_relief(Gtk::RELIEF_NONE); backColor1->set_tooltip_markup (M("MAIN_TOOLTIP_BACKCOLOR1")); backColor1->set_image(options.bgcolor == 1 ? *iBC1 : *igBC1); backColor3 = Gtk::manage (new Gtk::ToggleButton ()); + backColor3->get_style_context()->add_class("narrowbutton"); backColor3->set_relief(Gtk::RELIEF_NONE); backColor3->set_tooltip_markup (M("MAIN_TOOLTIP_BACKCOLOR3")); backColor3->set_image(options.bgcolor == 3 ? *iBC3 : *igBC3); backColor2 = Gtk::manage (new Gtk::ToggleButton ()); + backColor2->get_style_context()->add_class("narrowbutton"); backColor2->set_relief(Gtk::RELIEF_NONE); backColor2->set_tooltip_markup (M("MAIN_TOOLTIP_BACKCOLOR2")); backColor2->set_image(options.bgcolor == 2 ? *iBC2 : *igBC2); previewR = Gtk::manage (new Gtk::ToggleButton ()); + previewR->get_style_context()->add_class("narrowbutton"); previewR->set_relief(Gtk::RELIEF_NONE); previewR->set_tooltip_markup (M("MAIN_TOOLTIP_PREVIEWR")); previewR->set_image(*igR); previewG = Gtk::manage (new Gtk::ToggleButton ()); + previewG->get_style_context()->add_class("narrowbutton"); previewG->set_relief(Gtk::RELIEF_NONE); previewG->set_tooltip_markup (M("MAIN_TOOLTIP_PREVIEWG")); previewG->set_image(*igG); previewB = Gtk::manage (new Gtk::ToggleButton ()); + previewB->get_style_context()->add_class("narrowbutton"); previewB->set_relief(Gtk::RELIEF_NONE); previewB->set_tooltip_markup (M("MAIN_TOOLTIP_PREVIEWB")); previewB->set_image(*igB); previewL = Gtk::manage (new Gtk::ToggleButton ()); + previewL->get_style_context()->add_class("narrowbutton"); previewL->set_relief(Gtk::RELIEF_NONE); previewL->set_tooltip_markup (M("MAIN_TOOLTIP_PREVIEWL")); previewL->set_image(*igL); diff --git a/rtgui/rotate.cc b/rtgui/rotate.cc index a5cd02c2d..802519d8d 100644 --- a/rtgui/rotate.cc +++ b/rtgui/rotate.cc @@ -39,6 +39,7 @@ Rotate::Rotate () : FoldableToolPanel(this, "rotate", M("TP_ROTATE_LABEL")) selectStraight = Gtk::manage (new Gtk::Button (M("TP_ROTATE_SELECTLINE"))); selectStraight->set_image (*Gtk::manage (new RTImage ("rotate-straighten-small.png"))); + selectStraight->get_style_context()->add_class("independent"); pack_start (*selectStraight, Gtk::PACK_SHRINK, 2); selectStraight->signal_pressed().connect( sigc::mem_fun(*this, &Rotate::selectStraightPressed) ); diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index 315b53db4..99a564a85 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -255,6 +255,7 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB spotbox->show (); spotbutton = Gtk::manage (new Gtk::Button ()); + spotbutton->get_style_context()->add_class("independent"); spotbutton->set_tooltip_text(M("TP_WBALANCE_SPOTWB")); Gtk::Image* spotimg = Gtk::manage (new RTImage ("color-picker.png")); spotimg->show ();