mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Add GPS icon to the location column for dive sites where we have GPS data
This replaces the really lame "italics text" from commit abe810ca1a29
("Mark locations that have GPS location data attached") with a marginally
less lame GPS icon.There's a reason why I am not making a living as
graphics artist. But I think this is a huge step forward from what we had
before...
The satellite.svg file is very loosely based on a different icon that I
found as public domain here http://www.clker.com/clipart-30400.html.
From that I created the PNG and then that was converted into the
GdkPixdata via gdk-pixbuf-csource; a rule for that was added to
the Makefile but commented out as I don't know if this tool will always be
available in the path. Having this icon included in the sources avoids
locating yet another icon file.
Better icons are certainly welcome!
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
			
			
This commit is contained in:
		
							parent
							
								
									c02f1b88ab
								
							
						
					
					
						commit
						713c845e5a
					
				
					 7 changed files with 252 additions and 21 deletions
				
			
		
							
								
								
									
										14
									
								
								gtk-gui.c
									
										
									
									
									
								
							
							
						
						
									
										14
									
								
								gtk-gui.c
									
										
									
									
									
								
							|  | @ -343,6 +343,15 @@ void quit(GtkWidget *w, gpointer data) | |||
| 	} | ||||
| } | ||||
| 
 | ||||
| GtkTreeViewColumn *tree_view_column_add_pixbuf(GtkWidget *tree_view, data_func_t data_func, GtkTreeViewColumn *col) | ||||
| { | ||||
| 	GtkCellRenderer *renderer = gtk_cell_renderer_pixbuf_new(); | ||||
| 	gtk_tree_view_column_pack_start(col, renderer, FALSE); | ||||
| 	gtk_tree_view_column_set_cell_data_func(col, renderer, data_func, NULL, NULL); | ||||
| 	g_signal_connect(tree_view, "button-press-event", G_CALLBACK(icon_click_cb), col); | ||||
| 	return col; | ||||
| } | ||||
| 
 | ||||
| GtkTreeViewColumn *tree_view_column(GtkWidget *tree_view, int index, const char *title, | ||||
| 				data_func_t data_func, unsigned int flags) | ||||
| { | ||||
|  | @ -370,7 +379,10 @@ GtkTreeViewColumn *tree_view_column(GtkWidget *tree_view, int index, const char | |||
| 	if (!(flags & UNSORTABLE)) | ||||
| 		gtk_tree_view_column_set_sort_column_id(col, index); | ||||
| 	gtk_tree_view_column_set_resizable(col, TRUE); | ||||
| 	gtk_tree_view_column_pack_start(col, renderer, TRUE); | ||||
| 	/* all but one column have only one renderer - so packing from the end
 | ||||
| 	 * makes no difference; for the location column we want to be able to | ||||
| 	 * prepend the icon in front of the text - so this works perfectly */ | ||||
| 	gtk_tree_view_column_pack_end(col, renderer, TRUE); | ||||
| 	if (data_func) | ||||
| 		gtk_tree_view_column_set_cell_data_func(col, renderer, data_func, (void *)(long)index, NULL); | ||||
| 	else | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue