aboutsummaryrefslogtreecommitdiff
path: root/libmap/cc-timezone-map.c
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2011-06-22 11:12:53 -0400
committerKen VanDine <ken.vandine@canonical.com>2011-06-22 11:12:53 -0400
commitbe0557bd3630b3efe189f299d26aa3db9a358798 (patch)
tree51aa069c725606e9635b14091c4b6c5ddd7b48a4 /libmap/cc-timezone-map.c
parent5b1027bd6f7e193639a895c9c0d63462443d4566 (diff)
parentd84d6a67d0c63d270462cade09d33efc9d2b6de8 (diff)
downloadayatana-indicator-datetime-be0557bd3630b3efe189f299d26aa3db9a358798.tar.gz
ayatana-indicator-datetime-be0557bd3630b3efe189f299d26aa3db9a358798.tar.bz2
ayatana-indicator-datetime-be0557bd3630b3efe189f299d26aa3db9a358798.zip
* New upstream release.
- Set minimum width for appointments to prevent continuous resizing when the calendar is hiden and ensure there is enough of the event description visible (LP: #762976) - ellipsize long appointment descriptions (LP: #750671) - GTK3 build * Dropping debian/patches/lp_762976.patch and debian/patches/lp_750671.patch as merged upstream. * debian/control: Switching dep to libedataserverui-3.0-dev * Upstream Merge * Ellipsize calendar entries that are too long (LP: #750671)
Diffstat (limited to 'libmap/cc-timezone-map.c')
-rw-r--r--libmap/cc-timezone-map.c52
1 files changed, 9 insertions, 43 deletions
diff --git a/libmap/cc-timezone-map.c b/libmap/cc-timezone-map.c
index 7b7d704..5ce1354 100644
--- a/libmap/cc-timezone-map.c
+++ b/libmap/cc-timezone-map.c
@@ -601,7 +601,6 @@ cc_timezone_map_finalize (GObject *object)
}
/* GtkWidget functions */
-#ifdef CCGTK3
static void
cc_timezone_map_get_preferred_width (GtkWidget *widget,
gint *minimum,
@@ -634,25 +633,6 @@ cc_timezone_map_get_preferred_height (GtkWidget *widget,
*natural = size;
}
-#else
-
-static void
-cc_timezone_map_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (widget)->priv;
-
- if (!requisition)
- return;
-
- /* The + 20 here is a slight tweak to make the map fill the
- * panel better without causing horizontal growing
- */
- requisition->height = 300 * gdk_pixbuf_get_height (priv->orig_background) / gdk_pixbuf_get_width (priv->orig_background) + 20;
- requisition->width = 300;
-}
-#endif
-
static void
cc_timezone_map_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
@@ -853,21 +833,6 @@ cc_timezone_map_draw (GtkWidget *widget,
return TRUE;
}
-#ifndef CCGTK3
-static gboolean
-cc_timezone_map_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
-{
- gboolean rv;
- cairo_t *cr;
- cr = gdk_cairo_create (widget->window);
- rv = cc_timezone_map_draw (widget, cr);
- cairo_destroy (cr);
- return rv;
-}
-#endif
-
-
static void
cc_timezone_map_class_init (CcTimezoneMapClass *klass)
{
@@ -881,19 +846,11 @@ cc_timezone_map_class_init (CcTimezoneMapClass *klass)
object_class->dispose = cc_timezone_map_dispose;
object_class->finalize = cc_timezone_map_finalize;
-#ifdef CCGTK3
widget_class->get_preferred_width = cc_timezone_map_get_preferred_width;
widget_class->get_preferred_height = cc_timezone_map_get_preferred_height;
-#else
- widget_class->size_request = cc_timezone_map_size_request;
-#endif
widget_class->size_allocate = cc_timezone_map_size_allocate;
widget_class->realize = cc_timezone_map_realize;
-#ifdef CCGTK3
widget_class->draw = cc_timezone_map_draw;
-#else
- widget_class->expose_event = cc_timezone_map_expose_event;
-#endif
signals[LOCATION_CHANGED] = g_signal_new ("location-changed",
CC_TYPE_TIMEZONE_MAP,
@@ -1015,6 +972,13 @@ button_press_event (GtkWidget *widget,
}
static void
+state_flags_changed (GtkWidget *widget)
+{
+ // To catch sensitivity changes
+ gtk_widget_queue_draw (widget);
+}
+
+static void
load_backward_tz (CcTimezoneMap *self)
{
GError *error = NULL;
@@ -1108,6 +1072,8 @@ cc_timezone_map_init (CcTimezoneMap *self)
g_signal_connect (self, "button-press-event", G_CALLBACK (button_press_event),
NULL);
+ g_signal_connect (self, "state-flags-changed", G_CALLBACK (state_flags_changed),
+ NULL);
load_backward_tz (self);
}