return true;
}
+ if (ev->y < 0 || ev->y > get_height ()) {
+ return true;
+ }
+
grab_y = ev->y;
if (ev->state & Keyboard::PrimaryModifier) {
/* Then we handle zoom, which is dragging horizontally. We zoom around the area that is
* the current y pointer value, not from the area that was the start of the drag.
- * the point of zoom must have the same
+ * We don't start doing zoom until we are at least one scroomer width outside the scroomer's
+ * area.
*/
- if (ev->x > get_width()) {
+ if (ev->x > (get_width() * 2)) {
zoom = ev->x - get_width();
double higher = unzoomed_val + unzoomed_page - half_min_page - val_at_pointer;
val = unzoomed_val;
page = unzoomed_page;
}
-
- adj.set_page_size(page);
- adj.set_value(val);
+
+ /* Round these values to stop the scroomer handlers quivering about during drags */
+ adj.set_page_size (rint (page));
+ adj.set_value (rint (val));
adj.value_changed();
return true;
{
switch (ev->direction) {
case GDK_SCROLL_UP:
- adj.set_value (adj.get_value() - adj.get_page_size()/10.0);
+ adj.set_value (adj.get_value() + adj.get_page_size() / 10.0);
break;
case GDK_SCROLL_DOWN:
- adj.set_value (adj.get_value() + adj.get_page_size()/10.0);
+ adj.set_value (adj.get_value() - adj.get_page_size() / 10.0);
break;
default:
return false;
} else {
pinch = false;
}
+
+ DragStarting (); /* EMIT SIGNAL */
}
+ if (ev->type == GDK_2BUTTON_PRESS && ev->button == 1) {
+ DoubleClicked();
+ }
+
return false;
}
grab_comp = None;
remove_modal_grab();
+ DragFinishing (); /* EMIT SIGNAL */
return true;
}
rect.set_height(position[BottomBase] - old_pos[Handle2]);
win->invalidate_rect(rect, false);
}
-
- win->process_updates(false);
}
-std::string
-Scroomer::get_comp_name(Component c)
-{
- switch (c) {
- case TopBase:
- return "TopBase";
- case Handle1:
- return "Handle1";
- case Slider:
- return "Slider";
- case Handle2:
- return "Handle2";
- case BottomBase:
- return "BottomBase";
- case Total:
- return "Total";
- case None:
- return "None";
- default:
- return "ERROR";
- }
-}