[gimp/gtk3-port: 122/229] app: port gimp_get_icon_size() to GtkStyleContext
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 122/229] app: port gimp_get_icon_size() to GtkStyleContext
- Date: Sat, 5 Jul 2014 01:27:27 +0000 (UTC)
commit bf3bd371c0a6b4fa5c42dd77b771d5f62b2c50c7
Author: Michael Natterer <mitch gimp org>
Date: Sun Dec 19 14:17:06 2010 +0100
app: port gimp_get_icon_size() to GtkStyleContext
app/widgets/gimpwidgets-utils.c | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c
index 9d447a0..93172c2 100644
--- a/app/widgets/gimpwidgets-utils.c
+++ b/app/widgets/gimpwidgets-utils.c
@@ -420,24 +420,26 @@ gimp_get_icon_size (GtkWidget *widget,
gint width,
gint height)
{
- GtkIconSet *icon_set;
- GtkIconSize *sizes;
- gint n_sizes;
- gint i;
- gint width_diff = 1024;
- gint height_diff = 1024;
- gint max_width;
- gint max_height;
- GtkIconSize icon_size = GTK_ICON_SIZE_MENU;
- GtkSettings *settings;
+ GtkStyleContext *style;
+ GtkIconSet *icon_set;
+ GtkIconSize *sizes;
+ gint n_sizes;
+ gint i;
+ gint width_diff = 1024;
+ gint height_diff = 1024;
+ gint max_width;
+ gint max_height;
+ GtkIconSize icon_size = GTK_ICON_SIZE_MENU;
+ GtkSettings *settings;
g_return_val_if_fail (GTK_IS_WIDGET (widget), icon_size);
g_return_val_if_fail (icon_name != NULL, icon_size);
g_return_val_if_fail (width > 0, icon_size);
g_return_val_if_fail (height > 0, icon_size);
- icon_set = gtk_style_lookup_icon_set (gtk_widget_get_style (widget),
- icon_name);
+ style = gtk_widget_get_style_context (widget);
+
+ icon_set = gtk_style_context_lookup_icon_set (style, icon_name);
if (! icon_set)
return GTK_ICON_SIZE_INVALID;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]