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 <guiutils.h>).

Known bug: The MyFileChooserButton thas is a FILE_CHOOSER_ACTION_SELECT_FOLDER
does not respond correctly to the new behaviour.
This commit is contained in:
natureh
2011-09-02 15:16:30 +02:00
parent aaaccfa451
commit 42ba3169e0
42 changed files with 309 additions and 141 deletions

View File

@@ -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);