_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_X)
- pns=-PAN_UNITS;
- else if (event->x>(_screen_width_pixels-MAP_THUMB_MARGIN_X))
- pns=PAN_UNITS;
-
- if (event->y<MAP_THUMB_MARGIN_Y)
- pew=-PAN_UNITS;
- else if (event->y>(_screen_height_pixels-MAP_THUMB_MARGIN_Y))
- pew=PAN_UNITS;
-
- if (pns!=0 || pew!=0) {
- map_pan(pns, pew);
- g_debug("MPAN: %d, %d", pns, pew);
- return FALSE;
- }
-}
-
switch (event->button) {
case 1:
if (event->type==GDK_2BUTTON_PRESS) {
return FALSE;
}
+static void
+map_pan_click_check(gint x, gint y)
+{
+gint pns=0, pew=0;
+
+if (x<MAP_THUMB_MARGIN_X)
+ pns=-PAN_UNITS;
+else if (x>(_screen_width_pixels-MAP_THUMB_MARGIN_X))
+ pns=PAN_UNITS;
+
+if (y<MAP_THUMB_MARGIN_Y)
+ pew=-PAN_UNITS;
+else if (y>(_screen_height_pixels-MAP_THUMB_MARGIN_Y))
+ pew=PAN_UNITS;
+
+if (pns!=0 || pew!=0) {
+ map_pan(pns, pew);
+ g_debug("MPAN: %d, %d", pns, pew);
+ return TRUE;
+}
+return FALSE;
+}
+
static gboolean
map_cb_button_release(GtkWidget *widget, GdkEventButton *event)
{
guint poi_id;
gint ux, uy;
-#if defined(WITH_HILDON_NEW)
-if (hildon_helper_event_button_is_finger(event)) {
- g_debug("Thumb up");
- return FALSE;
-}
-#endif
-
switch (event->button) {
case 1:
- if (_center_mode>0)
- set_action_activate("autocenter_none", TRUE);
+
+#if defined(WITH_HILDON_NEW)
+ if (hildon_helper_event_button_is_finger(event)) {
+ g_debug("Thumb down");
+ if (map_pan_click_check(event->x, event->y))
+ return FALSE;
+ }
+#endif
switch (map_mode) {
case MAP_MODE_DRAW_TRACK:
map_render_data();
g_idle_add_full(G_PRIORITY_HIGH_IDLE,(GSourceFunc)map_update_location_from_center, NULL, NULL);
}
+ if (_center_mode>0)
+ set_action_activate("autocenter_none", TRUE);
map_drag_stop(event->x, event->y);
break;
}
break;
case 2:
- /* */
+ map_pan_click_check(event->x, event->y);
+ return FALSE;
break;
case 3:
+ /* */
break;
}