aboutsummaryrefslogtreecommitdiff
path: root/src/datetime-prefs-locations.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-03-30 17:00:38 -0500
committerTed Gould <ted@gould.cx>2011-03-30 17:00:38 -0500
commit51f85a5e06af1dec9fcbd25901b4a65ead6aa2cd (patch)
tree5665b0bf9bd408eec3c3329147497e6828894fe4 /src/datetime-prefs-locations.c
parent1938dedac5125874252e0bdd24f96b30206d43a7 (diff)
parent642c67ed942d7ce49ab48303ba611b7f21d7e1d5 (diff)
downloadayatana-indicator-datetime-51f85a5e06af1dec9fcbd25901b4a65ead6aa2cd.tar.gz
ayatana-indicator-datetime-51f85a5e06af1dec9fcbd25901b4a65ead6aa2cd.tar.bz2
ayatana-indicator-datetime-51f85a5e06af1dec9fcbd25901b4a65ead6aa2cd.zip
Fix up icons and give them tool tips
Diffstat (limited to 'src/datetime-prefs-locations.c')
-rw-r--r--src/datetime-prefs-locations.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/datetime-prefs-locations.c b/src/datetime-prefs-locations.c
index 2862022..9c23a40 100644
--- a/src/datetime-prefs-locations.c
+++ b/src/datetime-prefs-locations.c
@@ -154,6 +154,27 @@ timezone_selected (GtkEntryCompletion * widget, GtkTreeModel * model,
return FALSE; // Do normal action too
}
+static gboolean
+query_tooltip (GtkTreeView * tree, gint x, gint y, gboolean keyboard_mode,
+ GtkTooltip * tooltip, GtkCellRenderer * cell)
+{
+ GtkTreeModel * model;
+ GtkTreeIter iter;
+ if (!gtk_tree_view_get_tooltip_context (tree, &x, &y, keyboard_mode,
+ &model, NULL, &iter))
+ return FALSE;
+
+ const gchar * icon;
+ gtk_tree_model_get (model, &iter, COL_ICON, &icon, -1);
+ if (icon == NULL)
+ return FALSE;
+
+ GtkTreeViewColumn * col = gtk_tree_view_get_column (tree, 0);
+ gtk_tree_view_set_tooltip_cell (tree, tooltip, NULL, col, cell);
+ gtk_tooltip_set_text (tooltip, _("You need to complete this location for it to appear in the menu."));
+ return TRUE;
+}
+
static void
handle_edit_started (GtkCellRendererText * renderer, GtkCellEditable * editable,
gchar * path, TimezoneCompletion * completion)
@@ -371,6 +392,9 @@ datetime_setup_locations_dialog (CcTimezoneMap * map)
gtk_tree_view_column_pack_start (loc_col, cell, FALSE);
gtk_tree_view_column_add_attribute (loc_col, cell, "icon-name", COL_ICON);
+ gtk_widget_set_has_tooltip (tree, TRUE);
+ g_signal_connect (tree, "query-tooltip", G_CALLBACK (query_tooltip), cell);
+
cell = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree), -1,
_("Time"), cell,