@@ -535,7 +535,7 @@ static gboolean _refresh_display_track(const gboolean active, const int segid, d
535535 return grow ;
536536}
537537
538- static void _refresh_display_all_tracks (dt_lib_module_t * self )
538+ static void _refresh_display_all_tracks (GtkWidget * widget , dt_lib_module_t * self )
539539{
540540 dt_lib_geotagging_t * d = self -> data ;
541541 GtkTreeModel * model = gtk_tree_view_get_model (GTK_TREE_VIEW (d -> map .gpx_view ));
@@ -558,6 +558,15 @@ static void _refresh_display_all_tracks(dt_lib_module_t *self)
558558 _refresh_displayed_images (self );
559559}
560560
561+ static gboolean _click_for_entire_track (GtkEntry * spin , GdkEventButton * event , dt_lib_module_t * self )
562+ {
563+ if (event -> button == 1 && event -> type == GDK_2BUTTON_PRESS )
564+ {
565+ _refresh_display_all_tracks (NULL , self );
566+ }
567+ return FALSE;
568+ }
569+
561570static void _track_seg_toggled (GtkCellRendererToggle * cell_renderer , gchar * path_str , dt_lib_module_t * self )
562571{
563572 dt_lib_geotagging_t * d = self -> data ;
@@ -715,7 +724,7 @@ static void _show_gpx_tracks(dt_lib_module_t *self)
715724 gtk_tree_view_column_set_clickable (d -> map .sel_tracks , TRUE);
716725 _update_nb_images (self );
717726 _update_buttons (self );
718- _refresh_display_all_tracks (self );
727+ _refresh_display_all_tracks (NULL , self );
719728}
720729
721730static void _apply_gpx (GtkWidget * widget , dt_lib_module_t * self )
@@ -1899,13 +1908,27 @@ void gui_init(dt_lib_module_t *self)
18991908
19001909 g_object_set (G_OBJECT (d -> map .gpx_view ), "has-tooltip" , TRUE, NULL );
19011910 g_signal_connect (G_OBJECT (d -> map .gpx_view ), "query-tooltip" , G_CALLBACK (_row_tooltip_setup ), self );
1911+ g_signal_connect (G_OBJECT (d -> map .gpx_view ), "button-press-event" , G_CALLBACK (_click_for_entire_track ), self );
19021912
19031913 // avoid ugly console pixman messages due to headers
19041914 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (d -> map .gpx_view ), FALSE);
19051915 GtkWidget * w = dt_ui_resize_wrap (GTK_WIDGET (d -> map .gpx_view ), 100 , "plugins/lighttable/geotagging/heighttracklist" );
19061916 gtk_widget_set_size_request (w , -1 , 100 );
19071917 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (d -> map .gpx_view ), TRUE);
1908- gtk_box_pack_start (GTK_BOX (d -> map .gpx_section ), w , TRUE, TRUE, 0 );
1918+
1919+ // the gpx_view_button is invisible and the label and tooltip of cannot be displayed on GUI.
1920+ // but label is use in "shortcuts" dialog.
1921+ GtkWidget * gpx_view_button = dt_action_button_new (self , N_ ("view entire track" ), _refresh_display_all_tracks , self ,
1922+ _ ("refresh map to view entire selected track segments" ), 0 , 0 );
1923+ gtk_widget_set_opacity (gpx_view_button , 0 );
1924+ gtk_widget_set_valign (gpx_view_button , GTK_ALIGN_START );
1925+ gtk_widget_set_margin_start (gpx_view_button , DT_PIXEL_APPLY_DPI (25 ));
1926+ gtk_widget_set_size_request (gpx_view_button , -1 , DT_PIXEL_APPLY_DPI (25 ));
1927+ GtkWidget * overlay = gtk_overlay_new ();
1928+ gtk_container_add (GTK_CONTAINER (overlay ), w );
1929+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay ), GTK_WIDGET (gpx_view_button ));
1930+ gtk_container_add (GTK_CONTAINER (d -> map .gpx_section ),overlay );
1931+ gtk_box_pack_start (GTK_BOX (d -> map .gpx_section ), overlay , TRUE, TRUE, 0 );
19091932
19101933 grid = GTK_GRID (gtk_grid_new ());
19111934 gtk_grid_set_column_spacing (grid , DT_PIXEL_APPLY_DPI (5 ));
0 commit comments