Revert GDK_SCROLL_SMOOTH scrolling of Toolbars to a fixed step
also remove GUI space in "FileBrowser" widget see #4035
This commit is contained in:
parent
b226c125ce
commit
98fc85b68d
@ -62,7 +62,6 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) :
|
|||||||
inTabMode = false;
|
inTabMode = false;
|
||||||
|
|
||||||
set_name ("FileBrowser");
|
set_name ("FileBrowser");
|
||||||
set_spacing (2);
|
|
||||||
|
|
||||||
// construct and initialize thumbnail browsers
|
// construct and initialize thumbnail browsers
|
||||||
fileBrowser = Gtk::manage( new FileBrowser() );
|
fileBrowser = Gtk::manage( new FileBrowser() );
|
||||||
|
@ -1008,48 +1008,26 @@ bool MyScrolledToolbar::on_scroll_event (GdkEventScroll* event)
|
|||||||
double value2 = 0.;
|
double value2 = 0.;
|
||||||
|
|
||||||
if (event->direction == GDK_SCROLL_DOWN) {
|
if (event->direction == GDK_SCROLL_DOWN) {
|
||||||
value2 = value + step;
|
value2 = rtengine::min<double>(value + step, upper);
|
||||||
|
|
||||||
if (value2 > upper) {
|
|
||||||
value2 = upper;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (value2 != value) {
|
if (value2 != value) {
|
||||||
scroll->set_value(value2);
|
scroll->set_value(value2);
|
||||||
}
|
}
|
||||||
} else if (event->direction == GDK_SCROLL_UP) {
|
} else if (event->direction == GDK_SCROLL_UP) {
|
||||||
value2 = value - step;
|
value2 = rtengine::max<double>(value - step, lower);
|
||||||
|
|
||||||
if (value2 < lower) {
|
|
||||||
value2 = lower;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (value2 != value) {
|
if (value2 != value) {
|
||||||
scroll->set_value(value2);
|
scroll->set_value(value2);
|
||||||
}
|
}
|
||||||
} else if (event->direction == GDK_SCROLL_SMOOTH) {
|
} else if (event->direction == GDK_SCROLL_SMOOTH) {
|
||||||
step = 0.;
|
|
||||||
if (event->delta_x) { // if the user use a pad, it can scroll horizontally
|
if (event->delta_x) { // if the user use a pad, it can scroll horizontally
|
||||||
step = event->delta_x;
|
value2 = rtengine::LIM<double>(value + (event->delta_x > 0 ? 30 : -30), lower, upper);
|
||||||
} else if (event->delta_y) {
|
} else if (event->delta_y) {
|
||||||
step = event->delta_y;
|
value2 = rtengine::LIM<double>(value + (event->delta_y > 0 ? 30 : -30), lower, upper);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (step != 0.) {
|
|
||||||
value2 = value + step /* * 2 */; // we could use a multiplicator here
|
|
||||||
|
|
||||||
if (value2 < lower) {
|
|
||||||
value2 = lower;
|
|
||||||
} else if (value2 > upper) {
|
|
||||||
value2 = upper;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (value2 != value) {
|
if (value2 != value) {
|
||||||
scroll->set_value(value2);
|
scroll->set_value(value2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user