summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/spinbutton.cpp
diff options
context:
space:
mode:
authorJabiertxof <jabier.arraiza@marker.es>2019-06-13 00:24:21 +0000
committerJabiertxof <jabier.arraiza@marker.es>2019-06-13 00:24:32 +0000
commit1442b0b18b3b70e636f4c8d0f5591f1ff1afa55e (patch)
tree098c1eec28dbede627fcc643818d15022023fc5c /src/ui/widget/spinbutton.cpp
parentImprove event handle (diff)
downloadinkscape-1442b0b18b3b70e636f4c8d0f5591f1ff1afa55e.tar.gz
inkscape-1442b0b18b3b70e636f4c8d0f5591f1ff1afa55e.zip
Try to fix issue with focus with thomas and add also stops to combos and unitcombos
Diffstat (limited to 'src/ui/widget/spinbutton.cpp')
-rw-r--r--src/ui/widget/spinbutton.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/ui/widget/spinbutton.cpp b/src/ui/widget/spinbutton.cpp
index a7cde41d5..81f20804b 100644
--- a/src/ui/widget/spinbutton.cpp
+++ b/src/ui/widget/spinbutton.cpp
@@ -25,7 +25,8 @@ SpinButton::connect_signals() {
signal_focus_in_event().connect(sigc::mem_fun(*this, &SpinButton::on_my_focus_in_event));
signal_key_press_event().connect(sigc::mem_fun(*this, &SpinButton::on_my_key_press_event));
gtk_widget_add_events(GTK_WIDGET(gobj()), GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK);
- signal_scroll_event().connect(sigc::mem_fun(*this, &SpinButton::on_my_scroll_event));
+ signal_scroll_event().connect(sigc::mem_fun(*this, &SpinButton::on_scroll_event));
+ set_focus_on_click(true);
};
int SpinButton::on_input(double* newvalue)
@@ -66,16 +67,18 @@ bool SpinButton::on_my_focus_in_event(GdkEventFocus* /*event*/)
return false; // do not consume the event
}
-bool SpinButton::on_my_scroll_event(GdkEventScroll* event)
+
+
+bool SpinButton::on_scroll_event(GdkEventScroll *event)
{
- if (!property_has_focus()) {
+ if (!is_focus()) {
return false;
}
double step, page;
get_increments(step, page);
- if (event->state & GDK_CONTROL_MASK) {
- step = page;
- }
+ /*if (event->state & GDK_CONTROL_MASK) {
+ page = step;
+ } */
double change = 0.0;
if (event->direction == GDK_SCROLL_UP) {
change = step;