_cmenu_position_x = event->x + 0.5;
_cmenu_position_y = event->y + 0.5;
+/* Handle map panning using clicks, use thumb on tablets and middle button on non-tablets */
#if defined(WITH_HILDON_NEW)
if (hildon_helper_event_button_is_finger(event)) {
g_debug("Thumb down");
-
+#else
+if (event->button==2) {
+#endif
+ gint pns=0, pew=0;
if (event->x<MAP_THUMB_MARGIN)
- map_pan(-PAN_UNITS, 0);
-
- if (event->x>(_screen_width_pixels-MAP_THUMB_MARGIN))
- map_pan(PAN_UNITS, 0);
+ pns=-PAN_UNITS;
+ else if (event->x>(_screen_width_pixels-MAP_THUMB_MARGIN))
+ pns=PAN_UNITS;
if (event->y<MAP_THUMB_MARGIN)
- map_pan(0, -PAN_UNITS);
-
- if (event->y>(_screen_height_pixels-MAP_THUMB_MARGIN))
- map_pan(0, PAN_UNITS);
+ pew=-PAN_UNITS;
+ else if (event->y>(_screen_height_pixels-MAP_THUMB_MARGIN))
+ pew=PAN_UNITS;
- return FALSE;
+ if (pns!=0 || pew!=0) {
+ map_pan(pns, pew);
+ return FALSE;
+ }
}
-#endif
switch (event->button) {
case 1: