aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2013-07-09 11:24:33 +0100
committerJussi Kukkonen <jussi.kukkonen@intel.com>2016-04-25 13:57:54 +0300
commit547e5d593daf7e0f300e6c444a32cdd878b96db7 (patch)
tree4f0c7f7d08c2aad7f25fdc4dfccfe4b17a0c2694
parentce7506fbcd3e34412aa349784cb2fa5fdd486e75 (diff)
downloadmatchbox-panel-2-547e5d593daf7e0f300e6c444a32cdd878b96db7.tar.gz
matchbox-panel-2-547e5d593daf7e0f300e6c444a32cdd878b96db7.tar.bz2
matchbox-panel-2-547e5d593daf7e0f300e6c444a32cdd878b96db7.zip
scaling-image: port to GTK+ 3 API
-rw-r--r--matchbox-panel/mb-panel-scaling-image.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/matchbox-panel/mb-panel-scaling-image.c b/matchbox-panel/mb-panel-scaling-image.c
index dc76b06..56d2d78 100644
--- a/matchbox-panel/mb-panel-scaling-image.c
+++ b/matchbox-panel/mb-panel-scaling-image.c
@@ -240,16 +240,16 @@ find_icon (GtkIconTheme *icon_theme,
static void
reload_icon (MBPanelScalingImage *image, gboolean force)
{
+ GtkAllocation alloc;
int size;
char *file;
GdkPixbuf *pixbuf;
GError *error;
/* Determine the required icon size */
- if (image->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
- size = GTK_WIDGET (image)->allocation.height;
- else
- size = GTK_WIDGET (image)->allocation.width;
+ gtk_widget_get_allocation (GTK_WIDGET (image), &alloc);
+ size = image->priv->orientation == GTK_ORIENTATION_HORIZONTAL
+ ? alloc.height : alloc.width;
if (!force && size == image->priv->size) {
return;
@@ -302,7 +302,9 @@ static void
icon_theme_changed_cb (GtkIconTheme *icon_theme,
MBPanelScalingImage *image)
{
- if (!gtk_widget_get_realized (GTK_WIDGET (image)))
+ GtkWidget *widget = GTK_WIDGET (image);
+
+ if (!gtk_widget_get_realized (widget))
return;
clear_cache (image);
@@ -320,7 +322,9 @@ mb_panel_scaling_image_size_allocate (GtkWidget *widget,
widget_class = GTK_WIDGET_CLASS (mb_panel_scaling_image_parent_class);
widget_class->size_allocate (widget, allocation);
- reload_icon (image, FALSE);
+ if (gtk_widget_get_realized (widget)) {
+ reload_icon (image, FALSE);
+ }
}
static void