From 42ba3169e0934f4b3653e25ad8b14b39f3c687b8 Mon Sep 17 00:00:00 2001 From: natureh Date: Fri, 2 Sep 2011 15:16:30 +0200 Subject: [PATCH] Solving issue 735 : "Zooming with mouse wheel should zoom where the mouse is". The scroll wheel is now used for scrolling the editor's tab content. If you want to change the spin button's/slider's value or combobox entry, press the SHIFT key while using the scroll wheel. This patch also: - reduce the spin buttons size (50px wide, instead of 70px) - reduce the minimum size of the combobox (tool panels can now be narrower before showing the horizontal scrollbar) Note to developers: ------------------- When creating GUI for editor tools, please use the MyComboBox, MyComboBoxText, MySpinButton and MyFileChooserButton derived class only in order to handle the scroll wheel properly (-> #include ). Known bug: The MyFileChooserButton thas is a FILE_CHOOSER_ACTION_SELECT_FOLDER does not respond correctly to the new behaviour. --- rtgui/adjuster.cc | 8 ++-- rtgui/adjuster.h | 5 ++- rtgui/batchqueuepanel.cc | 5 +-- rtgui/batchqueuepanel.h | 3 +- rtgui/crop.cc | 19 +++++---- rtgui/crop.h | 17 ++++---- rtgui/cropwindow.cc | 55 ++++++++++++++++++++++--- rtgui/cropwindow.h | 62 +++++++++++++++-------------- rtgui/darkframe.cc | 2 +- rtgui/darkframe.h | 4 +- rtgui/exifpanel.cc | 5 ++- rtgui/flatfield.cc | 4 +- rtgui/flatfield.h | 5 ++- rtgui/guiutils.cc | 86 ++++++++++++++++++++++++++++++++++++++++ rtgui/guiutils.h | 38 ++++++++++++++++++ rtgui/hlrec.cc | 2 +- rtgui/hlrec.h | 3 +- rtgui/hsvequalizer.h | 1 - rtgui/icmpanel.cc | 8 ++-- rtgui/icmpanel.h | 9 +++-- rtgui/imagearea.cc | 15 ++++--- rtgui/iptcpanel.h | 1 + rtgui/labcurve.cc | 20 ---------- rtgui/labcurve.h | 2 - rtgui/profilepanel.cc | 2 +- rtgui/profilepanel.h | 3 +- rtgui/rawprocess.cc | 2 +- rtgui/rawprocess.h | 3 +- rtgui/recentbrowser.cc | 4 +- rtgui/recentbrowser.h | 3 +- rtgui/renamedlg.cc | 2 +- rtgui/renamedlg.h | 3 +- rtgui/resize.cc | 10 ++--- rtgui/resize.h | 12 +++--- rtgui/saveformatpanel.cc | 2 +- rtgui/saveformatpanel.h | 3 +- rtgui/sharpening.cc | 2 +- rtgui/sharpening.h | 3 +- rtgui/tonecurve.cc | 3 +- rtgui/tonecurve.h | 3 +- rtgui/whitebalance.cc | 6 +-- rtgui/whitebalance.h | 5 ++- 42 files changed, 309 insertions(+), 141 deletions(-) diff --git a/rtgui/adjuster.cc b/rtgui/adjuster.cc index f35cff80e..8c25782e6 100644 --- a/rtgui/adjuster.cc +++ b/rtgui/adjuster.cc @@ -39,7 +39,7 @@ Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep addMode = false; // TODO: let the user chose the default value of Adjuster::delay, for slow machines - delay = options.adjusterDelay; // delay is no more static, so we can set the delay individually (usefull for the RAW editor tab) + delay = options.adjusterDelay; // delay is no more static, so we can set the delay individually (useful for the RAW editor tab) set_border_width (2); @@ -65,14 +65,13 @@ Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep hbox->pack_end (*reset, Gtk::PACK_SHRINK, 0); - spin = Gtk::manage (new Gtk::SpinButton ()); - spin->set_size_request (70, -1); + spin = Gtk::manage (new MySpinButton ()); hbox->pack_end (*spin, Gtk::PACK_SHRINK, 0); reset->set_size_request (-1, spin->get_height()); - slider = Gtk::manage (new Gtk::HScale ()); + slider = Gtk::manage (new MyHScale ()); slider->set_draw_value (false); pack_start (*hbox, false, false); @@ -338,4 +337,3 @@ float Adjuster::trimValue (float& val) { else if (val < (float)vMin) val = (float)vMin; // shapeValue(vMin) ? return val; } - diff --git a/rtgui/adjuster.h b/rtgui/adjuster.h index d4da4ebbc..af2a10561 100644 --- a/rtgui/adjuster.h +++ b/rtgui/adjuster.h @@ -21,6 +21,7 @@ #include #include +#include class Adjuster; class AdjusterListener { @@ -35,8 +36,8 @@ class Adjuster : public Gtk::VBox { protected: Gtk::HBox* hbox; Gtk::Label* label; - Gtk::HScale* slider; - Gtk::SpinButton* spin; + MyHScale* slider; + MySpinButton* spin; Gtk::Button* reset; AdjusterListener* adjusterListener; sigc::connection delayConnection; diff --git a/rtgui/batchqueuepanel.cc b/rtgui/batchqueuepanel.cc index a0f49b01c..4c479ebc6 100644 --- a/rtgui/batchqueuepanel.cc +++ b/rtgui/batchqueuepanel.cc @@ -64,7 +64,7 @@ BatchQueuePanel::BatchQueuePanel () { Gtk::HBox* hb3 = Gtk::manage (new Gtk::HBox ()); useFolder = Gtk::manage (new Gtk::RadioButton (M("PREFERENCES_OUTDIRFOLDER")+":")); hb3->pack_start (*useFolder, Gtk::PACK_SHRINK,4); - outdirFolder = Gtk::manage (new Gtk::FileChooserButton (M("PREFERENCES_OUTDIRFOLDER"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER)); + outdirFolder = Gtk::manage (new MyFileChooserButton (M("PREFERENCES_OUTDIRFOLDER"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER)); hb3->pack_start (*outdirFolder); odvb->pack_start (*hb3, Gtk::PACK_SHRINK, 4); outdirFolder->set_tooltip_markup (M("PREFERENCES_OUTDIRFOLDERHINT")); @@ -87,7 +87,7 @@ BatchQueuePanel::BatchQueuePanel () { // setup signal handlers outdirTemplate->signal_changed().connect (sigc::mem_fun(*this, &BatchQueuePanel::saveOptions)); - outdirFolder->signal_current_folder_changed().connect (sigc::mem_fun(*this, &BatchQueuePanel::pathFolderChanged)); + outdirFolder->signal_current_folder_changed().connect (sigc::mem_fun(*this, &BatchQueuePanel::pathFolderChanged)); useTemplate->signal_toggled().connect (sigc::mem_fun(*this, &BatchQueuePanel::saveOptions)); useFolder->signal_toggled().connect (sigc::mem_fun(*this, &BatchQueuePanel::saveOptions)); saveFormatPanel->setListener (this); @@ -101,7 +101,6 @@ BatchQueuePanel::BatchQueuePanel () { topBox->pack_start (*fformat, Gtk::PACK_SHRINK, 4); // add middle browser area - Gtk::HBox* hBox = Gtk::manage (new Gtk::HBox ()); pack_start (*batchQueue); // lower box with thumbnail zoom diff --git a/rtgui/batchqueuepanel.h b/rtgui/batchqueuepanel.h index b170ef650..8413f1251 100644 --- a/rtgui/batchqueuepanel.h +++ b/rtgui/batchqueuepanel.h @@ -22,6 +22,7 @@ #include #include #include +#include class RTWindow; class BatchQueuePanel : public Gtk::VBox, @@ -37,7 +38,7 @@ class BatchQueuePanel : public Gtk::VBox, sigc::connection stopConnection; Gtk::Entry* outdirTemplate; - Gtk::FileChooserButton* outdirFolder; + MyFileChooserButton* outdirFolder; Gtk::RadioButton* useTemplate; Gtk::RadioButton* useFolder; SaveFormatPanel* saveFormatPanel; diff --git a/rtgui/crop.cc b/rtgui/crop.cc index 5d4441a9e..30957d4ac 100644 --- a/rtgui/crop.cc +++ b/rtgui/crop.cc @@ -18,7 +18,6 @@ */ #include #include -#include using namespace rtengine; using namespace rtengine::procparams; @@ -50,12 +49,12 @@ Crop::Crop (): Gtk::VBox(), FoldableToolPanel(this) { Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); hb1->pack_start (*Gtk::manage (new Gtk::Label (Glib::ustring(" ") + M("TP_CROP_X") +": "))); - x = Gtk::manage (new Gtk::SpinButton ()); + x = Gtk::manage (new MySpinButton ()); x->set_size_request (60, -1); hb1->pack_start (*x); hb1->pack_start (*Gtk::manage (new Gtk::Label (Glib::ustring(" ") + M("TP_CROP_Y") + ": "))); - y = Gtk::manage (new Gtk::SpinButton ()); + y = Gtk::manage (new MySpinButton ()); y->set_size_request (60, -1); hb1->pack_start (*y); @@ -64,12 +63,12 @@ Crop::Crop (): Gtk::VBox(), FoldableToolPanel(this) { Gtk::HBox* hb2 = Gtk::manage (new Gtk::HBox ()); hb2->pack_start (*Gtk::manage (new Gtk::Label (M("TP_CROP_W") + ": "))); - w = Gtk::manage (new Gtk::SpinButton ()); + w = Gtk::manage (new MySpinButton ()); w->set_size_request (60, -1); hb2->pack_start (*w); hb2->pack_start (*Gtk::manage (new Gtk::Label (M("TP_CROP_H") + ": "))); - h = Gtk::manage (new Gtk::SpinButton ()); + h = Gtk::manage (new MySpinButton ()); h->set_size_request (60, -1); hb2->pack_start (*h); @@ -87,10 +86,10 @@ Crop::Crop (): Gtk::VBox(), FoldableToolPanel(this) { hb3->pack_start (*fixr, Gtk::PACK_SHRINK, 4); - ratio = Gtk::manage (new Gtk::ComboBoxText ()); - hb3->pack_start (*ratio, Gtk::PACK_SHRINK, 4); + ratio = Gtk::manage (new MyComboBoxText ()); + hb3->pack_start (*ratio, Gtk::PACK_EXPAND_WIDGET, 4); - orientation = Gtk::manage (new Gtk::ComboBoxText ()); + orientation = Gtk::manage (new MyComboBoxText ()); hb3->pack_start (*orientation); pack_start (*hb3, Gtk::PACK_SHRINK, 4); @@ -98,7 +97,7 @@ Crop::Crop (): Gtk::VBox(), FoldableToolPanel(this) { Gtk::HBox* hb31 = Gtk::manage (new Gtk::HBox ()); hb31->pack_start (*Gtk::manage (new Gtk::Label (M("TP_CROP_GUIDETYPE"))), Gtk::PACK_SHRINK, 4); - guide = Gtk::manage (new Gtk::ComboBoxText ()); + guide = Gtk::manage (new MyComboBoxText ()); hb31->pack_start (*guide); pack_start (*hb31, Gtk::PACK_SHRINK, 4); @@ -109,7 +108,7 @@ Crop::Crop (): Gtk::VBox(), FoldableToolPanel(this) { Gtk::HBox* hb4 = Gtk::manage (new Gtk::HBox ()); hb4->pack_start (*Gtk::manage (new Gtk::Label (M("TP_CROP_PPI")))); - ppi = Gtk::manage (new Gtk::SpinButton ()); + ppi = Gtk::manage (new MySpinButton ()); ppi->set_size_request (60, -1); hb4->pack_start (*ppi); diff --git a/rtgui/crop.h b/rtgui/crop.h index eb8111882..0b00f42df 100644 --- a/rtgui/crop.h +++ b/rtgui/crop.h @@ -22,6 +22,7 @@ #include #include #include +#include class CropPanelListener { @@ -35,17 +36,17 @@ class Crop : public Gtk::VBox, public CropGUIListener, public FoldableToolPanel, protected: Gtk::CheckButton* enabled; Gtk::CheckButton* fixr; - Gtk::ComboBoxText* ratio; - Gtk::ComboBoxText* orientation; - Gtk::ComboBoxText* guide; + MyComboBoxText* ratio; + MyComboBoxText* orientation; + MyComboBoxText* guide; Gtk::Button* selectCrop; CropPanelListener* clistener; int opt; - Gtk::SpinButton* x; - Gtk::SpinButton* y; - Gtk::SpinButton* w; - Gtk::SpinButton* h; - Gtk::SpinButton* ppi; + MySpinButton* x; + MySpinButton* y; + MySpinButton* w; + MySpinButton* h; + MySpinButton* ppi; Gtk::Label* sizecm; Gtk::Label* sizein; Gtk::VBox* ppibox; diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index b057a0776..95411194c 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -802,16 +802,51 @@ void CropWindow::expose (Cairo::RefPtr cr) { // printf ("etime --> %d, %d\n", t2.etime (t1), t4.etime (t3)); } -// zoom* is called from the zoomPanel -void CropWindow::zoomIn () { +// calculate the center of the zommed in/out preview given a cursor position +void CropWindow::findCenter (int deltaZoom, int& x, int& y) { + int cursorX, cursorY; + translateCoord(x, y, cursorX, cursorY); - changeZoom (cropZoom+1); - fitZoom = false; + int cropX, cropY, cropW, cropH, skip; + cropHandler.getWindow (cropX, cropY, cropW, cropH, skip); + + int currCenterX = cropX + cropW/2; + int currCenterY = cropY + cropH/2; + + int deltaX = currCenterX - cursorX; + int deltaY = currCenterY - cursorY; + + double factor = zoomSteps[cropZoom].zoom / zoomSteps[cropZoom+deltaZoom].zoom; + x = cursorX + (int)((double)(deltaX)*factor); + y = cursorY + (int)((double)(deltaY)*factor); } -void CropWindow::zoomOut () { +// zoom* is called from the zoomPanel or the scroll wheel in the preview area +void CropWindow::zoomIn (bool toCursor, int cursorX, int cursorY) { - changeZoom (cropZoom-1); + int x = -1; + int y = -1; + + if (toCursor) { + x = cursorX; + y = cursorY; + } + + changeZoom (cropZoom+1, true, x, y); + fitZoom = false; +} + +void CropWindow::zoomOut (bool toCursor, int cursorX, int cursorY) { + + int x = -1; + int y = -1; + + if (toCursor) { + x = cursorX; + y = cursorY; + } + + changeZoom (cropZoom-1, true, x, y); fitZoom = false; } @@ -826,6 +861,14 @@ double CropWindow::getZoom () { return zoomSteps[cropZoom].zoom; } +bool CropWindow::isMinZoom () { + return cropZoom <= 0; +} + +bool CropWindow::isMaxZoom () { + return cropZoom >= MAXZOOMSTEPS; +} + void CropWindow::setZoom (double zoom) { int cz = MAXZOOMSTEPS; if (zoom < zoomSteps[0].zoom) diff --git a/rtgui/cropwindow.h b/rtgui/cropwindow.h index a95b2b05f..11bef73d3 100644 --- a/rtgui/cropwindow.h +++ b/rtgui/cropwindow.h @@ -43,14 +43,14 @@ class ImageArea; class CropWindow : public LWButtonListener, public CropHandlerListener { // state management - ImgEditState state; // current state of user (see enum State) + ImgEditState state; // current state of user (see enum State) int action_x, action_y, press_x, press_y; double rot_deg; bool onResizeArea; bool deleted; bool fitZoomEnabled; bool fitZoom; - bool isLowUpdatePriority; + bool isLowUpdatePriority; // decoration Cairo::RefPtr resizeSurface; @@ -59,7 +59,7 @@ class CropWindow : public LWButtonListener, public CropHandlerListener { Glib::ustring cropLabel; int backColor; bool decorated; - + // crop frame description int titleHeight, sideBorderWidth, lowerBorderWidth, upperBorderWidth, sepWidth, minWidth; // size & position of the crop relative to the top left corner @@ -69,12 +69,12 @@ class CropWindow : public LWButtonListener, public CropHandlerListener { int imgAreaX, imgAreaY, imgAreaW, imgAreaH; // size & pos of the piece of preview image relative to the top left corner of the crop int imgX, imgY, imgW, imgH; - + // image handling - + ImageArea* iarea; int cropZoom; // *1000 - + // crop gui listener CropGUIListener* cropgl; PointerMotionListener* pmlistener; @@ -83,40 +83,44 @@ class CropWindow : public LWButtonListener, public CropHandlerListener { CropWindow* observedCropWin; - bool onArea (CursorArea a, int x, int y); - void updateCursor (int x, int y); - void drawDecoration (Cairo::RefPtr cr); - void drawStraightenGuide (Cairo::RefPtr cr); - void drawSpotWBRectangle (Cairo::RefPtr cr); - void drawObservedFrame (Cairo::RefPtr cr, int rw=0, int rh=0); - void translateCoord (int phyx, int phyy, int& imgx, int& imgy); - void changeZoom (int zoom, bool notify=true, int centerx=-1, int centery=-1); - void getObservedFrameArea(int& x, int& y, int& w, int& h, int rw=0, int rh=0); - + bool onArea (CursorArea a, int x, int y); + void updateCursor (int x, int y); + void drawDecoration (Cairo::RefPtr cr); + void drawStraightenGuide (Cairo::RefPtr cr); + void drawSpotWBRectangle (Cairo::RefPtr cr); + void drawObservedFrame (Cairo::RefPtr cr, int rw=0, int rh=0); + void translateCoord (int phyx, int phyy, int& imgx, int& imgy); + void changeZoom (int zoom, bool notify=true, int centerx=-1, int centery=-1); + void getObservedFrameArea(int& x, int& y, int& w, int& h, int rw=0, int rh=0); + public: CropHandler cropHandler; CropWindow (ImageArea* parent, rtengine::StagedImageProcessor* ipc_, bool isLowUpdatePriority_); ~CropWindow (); - + void setDecorated (bool decorated) { this->decorated = decorated; } void setFitZoomEnabled (bool fze) { fitZoomEnabled = fze; } void setObservedCropWin (CropWindow* cw) { observedCropWin = cw; } - + void setPosition (int x, int y); void getPosition (int& x, int& y); void setSize (int w, int h, bool norefresh=false); void getSize (int& w, int& h); - + // zoomlistener interface - void zoomIn (); - void zoomOut (); + void zoomIn (bool toCursor=false, int cursorX=-1, int cursorY=-1); + void zoomOut (bool toCursor=false, int cursorX=-1, int cursorY=-1); void zoom11 (); void zoomFit (); double getZoom (); - void setZoom (double zoom); + bool isMinZoom (); + bool isMaxZoom (); + void setZoom (double zoom); + void findCenter (int deltaZoom, int& x, int& y); bool isInside (int x, int y); + void buttonPress (int button, int num, int state, int x, int y); void buttonRelease (int button, int num, int state, int x, int y); void pointerMoved (int x, int y); @@ -126,27 +130,27 @@ class CropWindow : public LWButtonListener, public CropHandlerListener { // interface lwbuttonlistener void buttonPressed (LWButton* button, int actionCode, void* actionData); void redrawNeeded (LWButton* button); - + // crop handling void getCropRectangle (int& x, int& y, int& w, int& h); void getCropPosition (int& x, int& y); void setCropPosition (int x, int y); void getCropSize (int& w, int& h); - + // listeners void setCropGUIListener (CropGUIListener* cgl) { cropgl = cgl; } - void setPointerMotionListener (PointerMotionListener* pml) { pmlistener = pml; } - void setPointerMotionHListener (PointerMotionListener* pml) { pmhlistener = pml; } - + void setPointerMotionListener (PointerMotionListener* pml) { pmlistener = pml; } + void setPointerMotionHListener (PointerMotionListener* pml) { pmhlistener = pml; } + // crop window listeners void addCropWindowListener (CropWindowListener* l) { listeners.push_back (l); } void delCropWindowListener (CropWindowListener* l); - + // crophandlerlistener interface void cropImageUpdated (); void cropWindowChanged (); void initialImageArrived (); - + void remoteMove (int deltaX, int deltaY); void remoteMoveReady (); }; diff --git a/rtgui/darkframe.cc b/rtgui/darkframe.cc index ffefd0e35..9bd15e5bc 100644 --- a/rtgui/darkframe.cc +++ b/rtgui/darkframe.cc @@ -28,7 +28,7 @@ using namespace rtengine::procparams; DarkFrame::DarkFrame () : Gtk::VBox(), FoldableToolPanel(this) { hbdf = Gtk::manage(new Gtk::HBox()); - darkFrameFile = Gtk::manage(new Gtk::FileChooserButton(M("TP_DARKFRAME_LABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); + darkFrameFile = Gtk::manage(new MyFileChooserButton(M("TP_DARKFRAME_LABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); dfLabel = Gtk::manage(new Gtk::Label(M("GENERAL_FILE"))); btnReset = Gtk::manage(new Gtk::Button()); btnReset->set_image (*Gtk::manage(new Gtk::Image (Gtk::StockID("gtk-cancel"), Gtk::ICON_SIZE_BUTTON))); diff --git a/rtgui/darkframe.h b/rtgui/darkframe.h index 7ebe93bd7..717c64b58 100644 --- a/rtgui/darkframe.h +++ b/rtgui/darkframe.h @@ -22,6 +22,7 @@ #include #include #include +#include class DFProvider { public: @@ -33,8 +34,7 @@ class DarkFrame : public Gtk::VBox, public FoldableToolPanel { protected: - Gtk::ComboBoxText* darkFrameMethod; - Gtk::FileChooserButton *darkFrameFile; + MyFileChooserButton *darkFrameFile; Gtk::HBox *hbdf; Gtk::Button *btnReset; Gtk::Label *dfLabel; diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc index 3b0a6dac2..1c112c4c4 100644 --- a/rtgui/exifpanel.cc +++ b/rtgui/exifpanel.cc @@ -18,6 +18,7 @@ */ #include #include +#include using namespace rtengine; using namespace rtengine::procparams; @@ -26,7 +27,7 @@ extern Glib::ustring argv0; ExifPanel::ExifPanel () : idata(NULL) { - recursiveOp = true; + recursiveOp = true; exifTree = Gtk::manage(new Gtk::TreeView()); scrolledWindow = Gtk::manage(new Gtk::ScrolledWindow()); @@ -366,7 +367,7 @@ void ExifPanel::addPressed () { Gtk::HBox* hb2 = new Gtk::HBox (); Gtk::Label* tlabel = new Gtk::Label (M("EXIFPANEL_ADDTAGDLG_SELECTTAG")+":"); - Gtk::ComboBoxText* tcombo = new Gtk::ComboBoxText (); + MyComboBoxText* tcombo = new MyComboBoxText (); tcombo->append_text ("Artist"); tcombo->append_text ("Copyright"); diff --git a/rtgui/flatfield.cc b/rtgui/flatfield.cc index f4f82f101..9213cf7d8 100644 --- a/rtgui/flatfield.cc +++ b/rtgui/flatfield.cc @@ -28,7 +28,7 @@ using namespace rtengine::procparams; FlatField::FlatField () : Gtk::VBox(), FoldableToolPanel(this) { hbff = Gtk::manage(new Gtk::HBox()); - flatFieldFile = Gtk::manage(new Gtk::FileChooserButton(M("TP_FLATFIELD_LABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); + flatFieldFile = Gtk::manage(new MyFileChooserButton(M("TP_FLATFIELD_LABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); ffLabel = Gtk::manage(new Gtk::Label(M("GENERAL_FILE"))); flatFieldFileReset = Gtk::manage(new Gtk::Button()); flatFieldFileReset->set_image (*Gtk::manage(new Gtk::Image (Gtk::StockID("gtk-cancel"), Gtk::ICON_SIZE_BUTTON))); @@ -45,7 +45,7 @@ FlatField::FlatField () : Gtk::VBox(), FoldableToolPanel(this) Gtk::HBox* hbffbt = Gtk::manage (new Gtk::HBox ()); hbffbt->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_FLATFIELD_BLURTYPE") +": "))); - flatFieldBlurType = Gtk::manage (new Gtk::ComboBoxText ()); + flatFieldBlurType = Gtk::manage (new MyComboBoxText ()); flatFieldBlurType->append_text(M("TP_FLATFIELD_BT_AREA")); flatFieldBlurType->append_text(M("TP_FLATFIELD_BT_VERTICAL")); flatFieldBlurType->append_text(M("TP_FLATFIELD_BT_HORIZONTAL")); diff --git a/rtgui/flatfield.h b/rtgui/flatfield.h index db1e8de4e..ada9040bc 100644 --- a/rtgui/flatfield.h +++ b/rtgui/flatfield.h @@ -23,6 +23,7 @@ #include #include #include +#include class FFProvider { public: @@ -34,13 +35,13 @@ class FlatField : public Gtk::VBox, public AdjusterListener, public FoldableTool protected: - Gtk::FileChooserButton *flatFieldFile; + MyFileChooserButton *flatFieldFile; Gtk::Label *ffLabel; Gtk::Label *ffInfo; Gtk::Button *flatFieldFileReset; Gtk::CheckButton* flatFieldAutoSelect; Adjuster* flatFieldBlurRadius; - Gtk::ComboBoxText* flatFieldBlurType; + MyComboBoxText* flatFieldBlurType; Gtk::HBox *hbff; bool ffChanged; bool lastFFAutoSelect; diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 496c1c690..db42c6c5b 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -227,3 +227,89 @@ void drawCrop (Cairo::RefPtr cr, int imx, int imy, int imw, int } cr->reset_clip (); } + + +/* + * + * Derived class of some widgets to properly handle the scroll wheel ; + * the user has to use the Shift key to be able to change the widget's value, + * otherwise the mouse wheel will scroll the editor's tabs content. + * + */ +MyComboBoxText::MyComboBoxText () { + set_size_request(40, -1); +} + +bool MyComboBoxText::on_scroll_event (GdkEventScroll* event) { + + // If Shift is pressed, the widget is modified + if (event->state & GDK_SHIFT_MASK) { + Gtk::ComboBoxText::on_scroll_event(event); + return true; + } + // ... otherwise the scroll event is sent back to an upper level + return false; +} + +MyComboBox::MyComboBox () { + set_size_request(40, -1); +} + +bool MyComboBox::on_scroll_event (GdkEventScroll* event) { + + // If Shift is pressed, the widget is modified + if (event->state & GDK_SHIFT_MASK) { + Gtk::ComboBox::on_scroll_event(event); + return true; + } + // ... otherwise the scroll event is sent back to an upper level + return false; +} + +MySpinButton::MySpinButton () { + set_size_request(50, -1); + Gtk::Border border; + border.bottom = 0; + border.top = 0; + border.left = 0; + border.right = 0; + set_inner_border(border); +} + +bool MySpinButton::on_scroll_event (GdkEventScroll* event) { + + // If Shift is pressed, the widget is modified + if (event->state & GDK_SHIFT_MASK) { + Gtk::SpinButton::on_scroll_event(event); + return true; + } + // ... otherwise the scroll event is sent back to an upper level + return false; +} + +bool MyHScale::on_scroll_event (GdkEventScroll* event) { + + // If Shift is pressed, the widget is modified + if (event->state & GDK_SHIFT_MASK) { + Gtk::HScale::on_scroll_event(event); + return true; + } + // ... otherwise the scroll event is sent back to an upper level + return false; +} + +MyFileChooserButton::MyFileChooserButton (const Glib::ustring& title, Gtk::FileChooserAction action) : Gtk::FileChooserButton(title, action) { + set_size_request(20, -1); +}; + +// For an unknown reason (a bug ?), it doesn't work when action = FILE_CHOOSER_ACTION_SELECT_FOLDER ! +bool MyFileChooserButton::on_scroll_event (GdkEventScroll* event) { + + // If Shift is pressed, the widget is modified + if (event->state & GDK_SHIFT_MASK) { + Gtk::FileChooserButton::on_scroll_event(event); + return true; + } + // ... otherwise the scroll event is sent back to an upper level + return false; +} diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index 126733a64..a52366a4e 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -71,4 +71,42 @@ public: } }; +class MyComboBox : public Gtk::ComboBox { + + bool on_scroll_event (GdkEventScroll* event); + +public: + MyComboBox (); +}; + +class MyComboBoxText : public Gtk::ComboBoxText { + + bool on_scroll_event (GdkEventScroll* event); + +public: + MyComboBoxText (); +}; + +class MySpinButton : public Gtk::SpinButton { + + bool on_scroll_event (GdkEventScroll* event); + +public: + MySpinButton (); +}; + +class MyHScale : public Gtk::HScale { + + bool on_scroll_event (GdkEventScroll* event); +}; + +class MyFileChooserButton : public Gtk::FileChooserButton { + +protected: + bool on_scroll_event (GdkEventScroll* event); + +public: + MyFileChooserButton (const Glib::ustring& title, Gtk::FileChooserAction action=Gtk::FILE_CHOOSER_ACTION_OPEN); +}; + #endif diff --git a/rtgui/hlrec.cc b/rtgui/hlrec.cc index d5c18422e..5885c517c 100644 --- a/rtgui/hlrec.cc +++ b/rtgui/hlrec.cc @@ -28,7 +28,7 @@ HLRecovery::HLRecovery () : Gtk::VBox(), FoldableToolPanel(this) { enabled->set_active (false); pack_start (*enabled); - method = Gtk::manage (new Gtk::ComboBoxText ()); + method = Gtk::manage (new MyComboBoxText ()); method->append_text (M("TP_HLREC_LUMINANCE")); method->append_text (M("TP_HLREC_CIELAB")); method->append_text (M("TP_HLREC_COLOR")); diff --git a/rtgui/hlrec.h b/rtgui/hlrec.h index e282c04cd..f5e42b454 100644 --- a/rtgui/hlrec.h +++ b/rtgui/hlrec.h @@ -21,12 +21,13 @@ #include #include +#include class HLRecovery : public Gtk::VBox, public FoldableToolPanel { protected: Gtk::CheckButton* enabled; - Gtk::ComboBoxText* method; + MyComboBoxText* method; sigc::connection methconn; sigc::connection enaconn; bool lastEnabled; diff --git a/rtgui/hsvequalizer.h b/rtgui/hsvequalizer.h index 40a4251d3..0877f2920 100644 --- a/rtgui/hsvequalizer.h +++ b/rtgui/hsvequalizer.h @@ -35,7 +35,6 @@ class HSVEqualizer : public Gtk::VBox, public AdjusterListener, public FoldableT protected: Gtk::CheckButton * enabled; - Gtk::ComboBoxText* hsvchannel; CurveEditorGroup* curveEditorG; FlatCurveEditor* hshape; diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index 81af08cdf..0598b08a3 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -33,7 +33,7 @@ ICMPanel::ICMPanel () : Gtk::VBox(), FoldableToolPanel(this), iunchanged(NULL), // set_border_width (4); - ipDialog = Gtk::manage (new Gtk::FileChooserButton (M("TP_ICM_INPUTDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); + ipDialog = Gtk::manage (new MyFileChooserButton (M("TP_ICM_INPUTDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); Gtk::Label* ilab = Gtk::manage (new Gtk::Label ()); ilab->set_alignment (0.0, 0.5); @@ -86,7 +86,7 @@ ICMPanel::ICMPanel () : Gtk::VBox(), FoldableToolPanel(this), iunchanged(NULL), wlab->set_markup (Glib::ustring("") + M("TP_ICM_WORKINGPROFILE") + ""); pack_start (*wlab, Gtk::PACK_SHRINK, 4); - wnames = Gtk::manage (new Gtk::ComboBoxText ()); + wnames = Gtk::manage (new MyComboBoxText ()); pack_start (*wnames, Gtk::PACK_SHRINK, 4); Gtk::HSeparator* hsep2 = Gtk::manage (new Gtk::HSeparator ()); @@ -97,7 +97,7 @@ ICMPanel::ICMPanel () : Gtk::VBox(), FoldableToolPanel(this), iunchanged(NULL), olab->set_markup (Glib::ustring("") + M("TP_ICM_OUTPUTPROFILE") + ""); pack_start (*olab, Gtk::PACK_SHRINK, 4); - onames = Gtk::manage (new Gtk::ComboBoxText ()); + onames = Gtk::manage (new MyComboBoxText ()); pack_start (*onames, Gtk::PACK_SHRINK, 4); std::vector wpnames = rtengine::getWorkingProfiles (); @@ -113,7 +113,7 @@ ICMPanel::ICMPanel () : Gtk::VBox(), FoldableToolPanel(this), iunchanged(NULL), galab->set_markup (Glib::ustring("") + M("TP_GAMMA_OUTPUT") + ""); pack_start (*galab, Gtk::PACK_SHRINK, 4); - wgamma = Gtk::manage (new Gtk::ComboBoxText ()); + wgamma = Gtk::manage (new MyComboBoxText ()); pack_start (*wgamma, Gtk::PACK_SHRINK, 4); Gtk::HSeparator* hsep23 = Gtk::manage (new Gtk::HSeparator ()); diff --git a/rtgui/icmpanel.h b/rtgui/icmpanel.h index e7b6605f4..2dce0b37c 100644 --- a/rtgui/icmpanel.h +++ b/rtgui/icmpanel.h @@ -21,6 +21,7 @@ #include #include +#include #include @@ -48,14 +49,14 @@ class ICMPanel : public Gtk::VBox, public AdjusterListener, public FoldableToolP Gtk::RadioButton* ifromfile; Gtk::CheckButton* igamma; Gtk::CheckButton* ckbBlendCMSMatrix; - Gtk::ComboBoxText* wnames; - Gtk::ComboBoxText* wgamma; + MyComboBoxText* wnames; + MyComboBoxText* wgamma; - Gtk::ComboBoxText* onames; + MyComboBoxText* onames; Gtk::RadioButton* ofromdir; Gtk::RadioButton* ofromfile; Gtk::RadioButton* iunchanged; - Gtk::FileChooserButton* ipDialog; + MyFileChooserButton* ipDialog; Gtk::RadioButton::Group opts; Gtk::Button* saveRef; sigc::connection ipc; diff --git a/rtgui/imagearea.cc b/rtgui/imagearea.cc index 7838c77fc..294d41ef5 100644 --- a/rtgui/imagearea.cc +++ b/rtgui/imagearea.cc @@ -220,11 +220,16 @@ bool ImageArea::on_scroll_event (GdkEventScroll* event) { CropWindow* cw = getCropWindow (event->x, event->y); if (cw) { - if (event->direction==GDK_SCROLL_UP) - cw->zoomIn (); - else - cw->zoomOut (); - return true; + int newCenterX = (int)event->x; + int newCenterY = (int)event->y; + if (event->direction==GDK_SCROLL_UP && !cw->isMaxZoom()) { + cw->findCenter (1, newCenterX, newCenterY); + cw->zoomIn (true, newCenterX, newCenterY); + } + else if (!cw->isMinZoom()) { + cw->findCenter (-1, newCenterX, newCenterY); + cw->zoomOut (true, newCenterX, newCenterY); + } } return true; } diff --git a/rtgui/iptcpanel.h b/rtgui/iptcpanel.h index 1a3e0e675..3fdfbe8e0 100644 --- a/rtgui/iptcpanel.h +++ b/rtgui/iptcpanel.h @@ -21,6 +21,7 @@ #include #include +#include class IPTCPanel : public Gtk::VBox, public ToolPanel { diff --git a/rtgui/labcurve.cc b/rtgui/labcurve.cc index 87098797b..d61fa1fc6 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -290,26 +290,6 @@ void LCurve::adjusterChanged (Adjuster* a, double newval) { listener->panelChanged (EvLSatLimit, costr); } -//attempt to hide unused channels -/*void LCurve::channel_changed () { - - removeIfThere (this, lcurve, false); - removeIfThere (this, acurve, false); - removeIfThere (this, bcurve, false); - - if (channel->get_active_row_number()==0) - pack_start (*lcurve); - else if (channel->get_active_row_number()==1) - pack_start (*acurve); - else if (method->get_active_row_number()==2) - pack_start (*bcurve); - - - if (listener && enabled->get_active ()) - listener->panelChanged (EvLabCurvetype, channel->get_active_text ()); - -}*/ - void LCurve::colorForValue (double valX, double valY) { CurveEditor* ce = curveEditorG->getDisplayedCurve(); diff --git a/rtgui/labcurve.h b/rtgui/labcurve.h index 226b832e1..109dfc76e 100644 --- a/rtgui/labcurve.h +++ b/rtgui/labcurve.h @@ -29,8 +29,6 @@ class LCurve : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel, public CurveListener, public ColorProvider { protected: - Gtk::ComboBoxText* channel; - CurveEditorGroup* curveEditorG; Adjuster* brightness; Adjuster* contrast; diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index 3d7a63afd..a73d65295 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -32,7 +32,7 @@ ProfilePanel::ProfilePanel () { tpc = NULL; - profiles = Gtk::manage (new Gtk::ComboBoxText ()); + profiles = Gtk::manage (new MyComboBoxText ()); Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); hbox->show (); // pack_start (*profiles, Gtk::PACK_SHRINK, 4); diff --git a/rtgui/profilepanel.h b/rtgui/profilepanel.h index 2d8139a3e..55eab03e1 100644 --- a/rtgui/profilepanel.h +++ b/rtgui/profilepanel.h @@ -24,6 +24,7 @@ #include #include #include +#include class ProfilePanel : public Gtk::VBox, public PParamsChangeListener { @@ -33,7 +34,7 @@ class ProfilePanel : public Gtk::VBox, public PParamsChangeListener { Gtk::Button* load; Gtk::Button* copy; Gtk::Button* paste; - Gtk::ComboBoxText* profiles; + MyComboBoxText* profiles; std::vector pparams; rtengine::procparams::ProcParams* custom; rtengine::procparams::ProcParams* lastsaved; diff --git a/rtgui/rawprocess.cc b/rtgui/rawprocess.cc index c08696ec2..2947a7b03 100644 --- a/rtgui/rawprocess.cc +++ b/rtgui/rawprocess.cc @@ -26,7 +26,7 @@ RawProcess::RawProcess () : Gtk::VBox(), FoldableToolPanel(this) { Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_DMETHOD") +": ")),Gtk::PACK_SHRINK, 4); - dmethod = Gtk::manage (new Gtk::ComboBoxText ()); + dmethod = Gtk::manage (new MyComboBoxText ()); for( size_t i=0; i< procparams::RAWParams::numMethods;i++) dmethod->append_text(procparams::RAWParams::methodstring[i]); diff --git a/rtgui/rawprocess.h b/rtgui/rawprocess.h index d993fc497..7626a7c9b 100644 --- a/rtgui/rawprocess.h +++ b/rtgui/rawprocess.h @@ -21,6 +21,7 @@ #include #include +#include #include @@ -28,7 +29,7 @@ class RawProcess : public Gtk::VBox, public AdjusterListener, public FoldableToo protected: - Gtk::ComboBoxText* dmethod; + MyComboBoxText* dmethod; Gtk::Label* methodl; Adjuster* ccSteps; Gtk::VBox *dcbOptions; diff --git a/rtgui/recentbrowser.cc b/rtgui/recentbrowser.cc index 2054f7f4a..337d21417 100644 --- a/rtgui/recentbrowser.cc +++ b/rtgui/recentbrowser.cc @@ -19,9 +19,11 @@ #include #include +using namespace rtengine; + RecentBrowser::RecentBrowser () : listener (NULL) { - recentDirs = Gtk::manage (new Gtk::ComboBoxText ()); + recentDirs = Gtk::manage (new MyComboBoxText ()); Gtk::Frame* frame = Gtk::manage (new Gtk::Frame (M("MAIN_FRAME_RECENT"))); frame->add (*recentDirs); diff --git a/rtgui/recentbrowser.h b/rtgui/recentbrowser.h index 3c2908dc3..d907c1449 100644 --- a/rtgui/recentbrowser.h +++ b/rtgui/recentbrowser.h @@ -23,10 +23,11 @@ #include #include #include +#include class RecentBrowser : public Gtk::VBox, public DirSelectionListener { - Gtk::ComboBoxText* recentDirs; + Gtk::ComboBoxText* recentDirs; sigc::connection conn; DirBrowserRemoteInterface* listener; diff --git a/rtgui/renamedlg.cc b/rtgui/renamedlg.cc index 75b72c3f0..9f790ac3b 100644 --- a/rtgui/renamedlg.cc +++ b/rtgui/renamedlg.cc @@ -38,7 +38,7 @@ RenameDialog::RenameDialog (Gtk::Window* parent) Gtk::HBox* tbox = Gtk::manage (new Gtk::HBox()); useTmpl = Gtk::manage (new Gtk::CheckButton (M("FILEBROWSER_USETEMPLATE"))); - templates = Gtk::manage (new Gtk::ComboBox ()); + templates = Gtk::manage (new MyComboBox ()); templateModel = Gtk::ListStore::create (templateColumns); templates->set_model (templateModel); templates->pack_start (templateColumns.tmplName); diff --git a/rtgui/renamedlg.h b/rtgui/renamedlg.h index ab9b23029..5209d45e8 100644 --- a/rtgui/renamedlg.h +++ b/rtgui/renamedlg.h @@ -21,6 +21,7 @@ #include #include +#include #define RESPONSE_ALL 100 @@ -41,7 +42,7 @@ class RenameDialog : public Gtk::Dialog { Gtk::Label* oldName; Gtk::Entry* newName; Gtk::CheckButton* useTmpl; - Gtk::ComboBox* templates; + MyComboBox* templates; Gtk::Button* all; const CacheImageData* imageData; diff --git a/rtgui/resize.cc b/rtgui/resize.cc index afcc3cc1e..7adc22b5b 100644 --- a/rtgui/resize.cc +++ b/rtgui/resize.cc @@ -34,7 +34,7 @@ Resize::Resize () : Gtk::VBox(), FoldableToolPanel(this), maxw(100000), maxh(100 Gtk::Table* combos = Gtk::manage (new Gtk::Table (2, 2)); - appliesTo = Gtk::manage (new Gtk::ComboBoxText ()); + appliesTo = Gtk::manage (new MyComboBoxText ()); appliesTo->append_text (M("TP_RESIZE_CROPPEDAREA")); appliesTo->append_text (M("TP_RESIZE_FULLIMAGE")); appliesTo->set_active (0); @@ -42,7 +42,7 @@ Resize::Resize () : Gtk::VBox(), FoldableToolPanel(this), maxw(100000), maxh(100 combos->attach (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_APPLIESTO"))), 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); combos->attach (*appliesTo, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - method = Gtk::manage (new Gtk::ComboBoxText ()); + method = Gtk::manage (new MyComboBoxText ()); method->append_text (M("TP_RESIZE_NEAREST")); method->append_text (M("TP_RESIZE_BILINEAR")); method->append_text (M("TP_RESIZE_BICUBIC")); @@ -56,7 +56,7 @@ Resize::Resize () : Gtk::VBox(), FoldableToolPanel(this), maxw(100000), maxh(100 combos->attach (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_METHOD"))), 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK, 2, 2); combos->attach (*method, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - spec = Gtk::manage (new Gtk::ComboBoxText ()); + spec = Gtk::manage (new MyComboBoxText ()); spec->append_text (M("TP_RESIZE_SCALE")); spec->append_text (M("TP_RESIZE_WIDTH")); spec->append_text (M("TP_RESIZE_HEIGHT")); @@ -78,8 +78,8 @@ Resize::Resize () : Gtk::VBox(), FoldableToolPanel(this), maxw(100000), maxh(100 Gtk::HBox* sbox = Gtk::manage (new Gtk::HBox ()); Gtk::HBox* wbox = Gtk::manage (new Gtk::HBox ()); Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); - w = Gtk::manage (new Gtk::SpinButton ()); - h = Gtk::manage (new Gtk::SpinButton ()); + w = Gtk::manage (new MySpinButton ()); + h = Gtk::manage (new MySpinButton ()); wbox->pack_start (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_W"))), Gtk::PACK_SHRINK, 4); wbox->pack_start (*w); hbox->pack_start (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_H"))), Gtk::PACK_SHRINK, 4); diff --git a/rtgui/resize.h b/rtgui/resize.h index 85a795a53..31513a646 100644 --- a/rtgui/resize.h +++ b/rtgui/resize.h @@ -21,7 +21,9 @@ #include #include +#include #include +#include class Resize : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel, public rtengine::SizeListener { @@ -29,11 +31,11 @@ class Resize : public Gtk::VBox, public AdjusterListener, public FoldableToolPan Gtk::CheckButton* enabled; Adjuster* scale; Gtk::VBox* sizeBox; - Gtk::ComboBoxText* appliesTo; - Gtk::ComboBoxText* method; - Gtk::ComboBoxText* spec; - Gtk::SpinButton* w; - Gtk::SpinButton* h; + MyComboBoxText* appliesTo; + MyComboBoxText* method; + MyComboBoxText* spec; + MySpinButton* w; + MySpinButton* h; int maxw, maxh; int cropw, croph; sigc::connection sconn, aconn, wconn, hconn, enaConn; diff --git a/rtgui/saveformatpanel.cc b/rtgui/saveformatpanel.cc index 912b4d117..108b0f30e 100644 --- a/rtgui/saveformatpanel.cc +++ b/rtgui/saveformatpanel.cc @@ -35,7 +35,7 @@ SaveFormatPanel::SaveFormatPanel () : listener (NULL) { Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); Gtk::Label* flab = Gtk::manage (new Gtk::Label (M("SAVEDLG_FILEFORMAT")+":")); hb1->pack_start (*flab, Gtk::PACK_SHRINK,4); - format = Gtk::manage (new Gtk::ComboBoxText ()); + format = Gtk::manage (new MyComboBoxText ()); format->append_text ("JPEG (8 bit)"); format->append_text ("TIFF (8 bit)"); format->append_text ("TIFF (16 bit)"); diff --git a/rtgui/saveformatpanel.h b/rtgui/saveformatpanel.h index 34f6f6309..90f95c409 100644 --- a/rtgui/saveformatpanel.h +++ b/rtgui/saveformatpanel.h @@ -21,6 +21,7 @@ #include #include +#include #include class FormatChangeListener { @@ -36,7 +37,7 @@ class SaveFormatPanel : public Gtk::VBox, public AdjusterListener { Adjuster* jpegqual; Adjuster* pngcompr; Gtk::CheckButton* tiffuncompressed; - Gtk::ComboBoxText* format; + MyComboBoxText* format; Gtk::VBox* formatopts; int oformat; FormatChangeListener* listener; diff --git a/rtgui/sharpening.cc b/rtgui/sharpening.cc index 813028279..9bfa4ebe9 100644 --- a/rtgui/sharpening.cc +++ b/rtgui/sharpening.cc @@ -39,7 +39,7 @@ Sharpening::Sharpening () : Gtk::VBox(), FoldableToolPanel(this) { hb->show (); Gtk::Label* ml = Gtk::manage (new Gtk::Label (M("TP_SHARPENING_METHOD")+":")); ml->show (); - method = Gtk::manage (new Gtk::ComboBoxText ()); + method = Gtk::manage (new MyComboBoxText ()); method->append_text (M("TP_SHARPENING_USM")); method->append_text (M("TP_SHARPENING_RLD")); method->show (); diff --git a/rtgui/sharpening.h b/rtgui/sharpening.h index 82f4774d3..352c83e78 100644 --- a/rtgui/sharpening.h +++ b/rtgui/sharpening.h @@ -21,12 +21,13 @@ #include #include +#include #include class Sharpening : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: - Gtk::ComboBoxText* method; + MyComboBoxText* method; Adjuster* dradius; Adjuster* damount; Adjuster* ddamping; diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index f437de034..d1eae4c7d 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -20,7 +20,6 @@ #include #include #include -#include using namespace rtengine; using namespace rtengine::procparams; @@ -34,7 +33,7 @@ ToneCurve::ToneCurve () : Gtk::VBox(), FoldableToolPanel(this) { autolevels = Gtk::manage (new Gtk::ToggleButton (M("TP_EXPOSURE_AUTOLEVELS"))); autoconn = autolevels->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::autolevels_toggled) ); - sclip = Gtk::manage (new Gtk::SpinButton ()); + sclip = Gtk::manage (new MySpinButton ()); sclip->set_range (0.0, 0.9999); sclip->set_increments (0.001, 0.01); sclip->set_value (0.002); diff --git a/rtgui/tonecurve.h b/rtgui/tonecurve.h index cb86423bf..0b39ee7e4 100644 --- a/rtgui/tonecurve.h +++ b/rtgui/tonecurve.h @@ -25,13 +25,14 @@ #include #include #include +#include class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel, public rtengine::AutoExpListener, public CurveListener { protected: Gtk::HBox* abox; Gtk::ToggleButton* autolevels; - Gtk::SpinButton* sclip; + MySpinButton* sclip; Adjuster* expcomp; Adjuster* brightness; Adjuster* black; diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index 7a8427a65..1e68b946a 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -35,7 +35,7 @@ WhiteBalance::WhiteBalance () : Gtk::VBox(), FoldableToolPanel(this), wbp(NULL), hbox->show (); Gtk::Label* lab = Gtk::manage (new Gtk::Label (M("TP_WBALANCE_METHOD"))); lab->show (); - method = Gtk::manage (new Gtk::ComboBoxText ()); + method = Gtk::manage (new MyComboBoxText ()); method->show (); method->append_text (M("TP_WBALANCE_CAMERA")); method->append_text (M("TP_WBALANCE_AUTO")); @@ -60,7 +60,7 @@ WhiteBalance::WhiteBalance () : Gtk::VBox(), FoldableToolPanel(this), wbp(NULL), Gtk::Label* slab = Gtk::manage (new Gtk::Label (M("TP_WBALANCE_SIZE"))); slab->show (); - spotsize = Gtk::manage (new Gtk::ComboBoxText ()); + spotsize = Gtk::manage (new MyComboBoxText ()); spotsize->show (); spotsize->append_text ("2"); spotsize->append_text ("4"); @@ -69,7 +69,7 @@ WhiteBalance::WhiteBalance () : Gtk::VBox(), FoldableToolPanel(this), wbp(NULL), spotsize->append_text ("32"); spotsize->set_active (2); - spotbox->pack_end (*spotsize, Gtk::PACK_SHRINK, 4); + spotbox->pack_end (*spotsize, Gtk::PACK_EXPAND_WIDGET, 4); spotbox->pack_end (*slab, Gtk::PACK_SHRINK, 4); pack_start (*spotbox, Gtk::PACK_SHRINK, 4); diff --git a/rtgui/whitebalance.h b/rtgui/whitebalance.h index b231cfe9d..f22790980 100644 --- a/rtgui/whitebalance.h +++ b/rtgui/whitebalance.h @@ -22,6 +22,7 @@ #include #include #include +#include #include class SpotWBListener { @@ -33,8 +34,8 @@ class SpotWBListener { class WhiteBalance : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel { protected: - Gtk::ComboBoxText* method; - Gtk::ComboBoxText* spotsize; + MyComboBoxText* method; + MyComboBoxText* spotsize; Adjuster* temp; Adjuster* green; Gtk::Button* spotbutton;