From 44cde00066303e185b615cd1efb0d3bb1ffb0071 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Wed, 23 Mar 2011 16:24:34 -0500 Subject: add bevel above location buttons --- data/datetime-dialog.ui | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/data/datetime-dialog.ui b/data/datetime-dialog.ui index 7545227..ead11d1 100644 --- a/data/datetime-dialog.ui +++ b/data/datetime-dialog.ui @@ -7,11 +7,6 @@ 86400 864000 - - 1.8446744073709552e+19 - 60 - 3600 - False Locations @@ -46,6 +41,17 @@ 0 + + + True + False + + + False + True + 1 + + True @@ -55,7 +61,6 @@ True True True - Add a Location… False @@ -76,7 +81,6 @@ True True True - Remove This Location False @@ -96,7 +100,7 @@ False True - 1 + 2 @@ -112,6 +116,11 @@ + + 1.8446744073709552e+19 + 60 + 3600 + False 5 -- cgit v1.2.3 From 2021a9554f85a9f78f1b65de30cb78572dab2752 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Wed, 23 Mar 2011 16:37:20 -0500 Subject: add utc to relevant results --- src/timezone-completion.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/timezone-completion.c b/src/timezone-completion.c index a2fa643..c1ffb42 100644 --- a/src/timezone-completion.c +++ b/src/timezone-completion.c @@ -229,6 +229,20 @@ json_parse_ready (GObject *object, GAsyncResult *res, gpointer user_data) json_reader_end_element (reader); } + if (strlen (priv->request_text) < 4) { + gchar * lower_text = g_ascii_strdown (priv->request_text, -1); + if (g_strcmp0 (lower_text, "ut") == 0 || + g_strcmp0 (lower_text, "utc") == 0) { + GtkTreeIter iter; + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + TIMEZONE_COMPLETION_ZONE, "UTC", + TIMEZONE_COMPLETION_NAME, "UTC", + -1); + } + g_free (lower_text); + } + save_and_use_model (completion, GTK_TREE_MODEL (store)); g_object_unref (G_OBJECT (reader)); } @@ -372,6 +386,13 @@ get_initial_model (void) g_free (name); } + GtkTreeIter iter; + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + TIMEZONE_COMPLETION_ZONE, "UTC", + TIMEZONE_COMPLETION_NAME, "UTC", + -1); + tz_db_free (db); return store; } @@ -389,7 +410,9 @@ data_func (GtkCellLayout *cell_layout, GtkCellRenderer *cell, -1); gchar * user_name; - if (admin1 == NULL || admin1[0] == 0) { + if (country == NULL || country[0] == 0) { + user_name = g_strdup (name); + } else if (admin1 == NULL || admin1[0] == 0) { user_name = g_strdup_printf ("%s (%s)", name, country); } else { user_name = g_strdup_printf ("%s (%s, %s)", name, admin1, country); -- cgit v1.2.3 From f76208b252ab4eeec71b9ac305ff5dd8283571d5 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Thu, 24 Mar 2011 07:25:30 -0500 Subject: drop debugging line and update times when user selects a zone --- src/datetime-prefs-locations.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/datetime-prefs-locations.c b/src/datetime-prefs-locations.c index 5e93a56..b8d9f8f 100644 --- a/src/datetime-prefs-locations.c +++ b/src/datetime-prefs-locations.c @@ -39,6 +39,8 @@ with this program. If not, see . #define COL_TIME 1 #define COL_ZONE 2 +static gboolean update_times (TimezoneCompletion * completion); + static void handle_add (GtkWidget * button, GtkTreeView * tree) { @@ -103,8 +105,6 @@ timezone_selected (GtkEntryCompletion * widget, GtkTreeModel * model, TIMEZONE_COMPLETION_NAME, &name, -1); - g_debug("match selected: %s, %s", name, zone); - if (zone == NULL || zone[0] == 0) { const gchar * strlon, * strlat; gdouble lon = 0.0, lat = 0.0; @@ -132,6 +132,8 @@ timezone_selected (GtkEntryCompletion * widget, GtkTreeModel * model, gtk_list_store_set (store, store_iter, COL_NAME, name, COL_ZONE, zone, -1); } + update_times (TIMEZONE_COMPLETION (widget)); + return FALSE; // Do normal action too } -- cgit v1.2.3 From cbc7a7cd54130c3f68565a6738e5471807f43df5 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Thu, 24 Mar 2011 08:26:53 -0500 Subject: make map look insensitive if it is --- libmap/cc-timezone-map.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libmap/cc-timezone-map.c b/libmap/cc-timezone-map.c index ec12c84..8e4a5b8 100644 --- a/libmap/cc-timezone-map.c +++ b/libmap/cc-timezone-map.c @@ -788,6 +788,13 @@ cc_timezone_map_draw (GtkWidget *widget, } if (!priv->location) { + /* Check if insensitive */ + if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE) { + cairo_set_source_rgba(cr, 1, 1, 1, 0.5); + cairo_rectangle(cr, 0, 0, alloc.width, alloc.height); + cairo_fill(cr); + } + return TRUE; } @@ -840,6 +847,13 @@ cc_timezone_map_draw (GtkWidget *widget, g_object_unref (pin); } + /* Check if insensitive */ + if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE) { + cairo_set_source_rgba(cr, 1, 1, 1, 0.5); + cairo_rectangle(cr, 0, 0, alloc.width, alloc.height); + cairo_fill(cr); + } + return TRUE; } -- cgit v1.2.3 From 143f495ab94cb006954c036cf29079cbb49d584b Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Tue, 29 Mar 2011 12:14:40 -0400 Subject: use background color for insensitive map --- libmap/cc-timezone-map.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/libmap/cc-timezone-map.c b/libmap/cc-timezone-map.c index 8e4a5b8..7b7d704 100644 --- a/libmap/cc-timezone-map.c +++ b/libmap/cc-timezone-map.c @@ -766,13 +766,23 @@ cc_timezone_map_draw (GtkWidget *widget, gchar *file; GError *err = NULL; gdouble pointx, pointy; + gdouble alpha = 1.0; + GtkStyle *style; char buf[16]; gtk_widget_get_allocation (widget, &alloc); + style = gtk_widget_get_style (widget); + + /* Check if insensitive */ + if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE) + alpha = 0.5; + /* paint background */ - gdk_cairo_set_source_pixbuf (cr, priv->background, 0, 0); + gdk_cairo_set_source_color (cr, &style->bg[gtk_widget_get_state (widget)]); cairo_paint (cr); + gdk_cairo_set_source_pixbuf (cr, priv->background, 0, 0); + cairo_paint_with_alpha (cr, alpha); /* paint watermark */ if (priv->watermark) { @@ -788,13 +798,6 @@ cc_timezone_map_draw (GtkWidget *widget, } if (!priv->location) { - /* Check if insensitive */ - if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE) { - cairo_set_source_rgba(cr, 1, 1, 1, 0.5); - cairo_rectangle(cr, 0, 0, alloc.width, alloc.height); - cairo_fill(cr); - } - return TRUE; } @@ -820,7 +823,7 @@ cc_timezone_map_draw (GtkWidget *widget, alloc.height, GDK_INTERP_BILINEAR); gdk_cairo_set_source_pixbuf (cr, hilight, 0, 0); - cairo_paint (cr); + cairo_paint_with_alpha (cr, alpha); g_object_unref (hilight); g_object_unref (orig_hilight); } @@ -843,17 +846,10 @@ cc_timezone_map_draw (GtkWidget *widget, if (pin) { gdk_cairo_set_source_pixbuf (cr, pin, pointx - 8, pointy - 14); - cairo_paint (cr); + cairo_paint_with_alpha (cr, alpha); g_object_unref (pin); } - /* Check if insensitive */ - if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE) { - cairo_set_source_rgba(cr, 1, 1, 1, 0.5); - cairo_rectangle(cr, 0, 0, alloc.width, alloc.height); - cairo_fill(cr); - } - return TRUE; } -- cgit v1.2.3