[gimp/gtk3-port: 121/227] app: port GimpContainerTreeView to GtkStyleContext
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 121/227] app: port GimpContainerTreeView to GtkStyleContext
- Date: Mon, 11 Jun 2012 23:12:36 +0000 (UTC)
commit 68e7c552fc47d95f09549daa60f63cf88307f5a0
Author: Michael Natterer <mitch gimp org>
Date: Sun Dec 19 13:10:51 2010 +0100
app: port GimpContainerTreeView to GtkStyleContext
app/widgets/gimpcontainertreeview.c | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/app/widgets/gimpcontainertreeview.c b/app/widgets/gimpcontainertreeview.c
index eb097a1..26d3521 100644
--- a/app/widgets/gimpcontainertreeview.c
+++ b/app/widgets/gimpcontainertreeview.c
@@ -393,10 +393,13 @@ gimp_container_tree_view_menu_position (GtkMenu *menu,
}
else
{
- GtkStyle *style = gtk_widget_get_style (widget);
+ GtkStyleContext *style = gtk_widget_get_style_context (widget);
+ GtkBorder border;
- *x += style->xthickness;
- *y += style->ythickness;
+ gtk_style_context_get_border (style, 0, &border);
+
+ *x += border.left;
+ *y += border.top;
}
gimp_menu_position (menu, x, y);
@@ -789,15 +792,21 @@ gimp_container_tree_view_set_view_size (GimpContainerView *view)
if (stock_id)
{
- GtkStyle *style = gtk_widget_get_style (tree_widget);
+ GtkStyleContext *style = gtk_widget_get_style_context (tree_widget);
+ GtkBorder border;
+
+ gtk_style_context_save (style);
+ gtk_style_context_add_class (style, GTK_STYLE_CLASS_BUTTON);
+ gtk_style_context_get_border (style, 0, &border);
+ gtk_style_context_restore (style);
icon_size = gimp_get_icon_size (tree_widget,
stock_id,
GTK_ICON_SIZE_BUTTON,
view_size -
- 2 * style->xthickness,
+ (border.left + border.right),
view_size -
- 2 * style->ythickness);
+ (border.top + border.bottom));
g_object_set (list->data, "stock-size", icon_size, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]