[gimp/gtk3-port: 169/233] app: port GimpToolEditor to GtkStyleContext
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 169/233] app: port GimpToolEditor to GtkStyleContext
- Date: Sat, 28 Apr 2018 01:15:56 +0000 (UTC)
commit 7a6d08996041be7a11a076164b033b1b1c204bcc
Author: Michael Natterer <mitch gimp org>
Date: Mon Jan 3 14:45:32 2011 +0100
app: port GimpToolEditor to GtkStyleContext
app/widgets/gimptooleditor.c | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/app/widgets/gimptooleditor.c b/app/widgets/gimptooleditor.c
index 0a3eff6..5780753 100644
--- a/app/widgets/gimptooleditor.c
+++ b/app/widgets/gimptooleditor.c
@@ -255,21 +255,25 @@ gimp_tool_editor_new (GimpContainer *container,
{
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (tool_editor);
GtkWidget *tree_widget = GTK_WIDGET (tree_view);
- GtkStyle *tree_style = gtk_widget_get_style (tree_widget);
+ GtkStyleContext *tree_style;
GtkTreeViewColumn *column;
GtkCellRenderer *eye_cell;
+ GtkBorder border;
GtkIconSize icon_size;
- column = gtk_tree_view_column_new ();
+ tree_style = gtk_widget_get_style_context (tree_widget);
+ gtk_style_context_get_border (tree_style, 0, &border);
+
+ column = gtk_tree_view_column_new ();
gtk_tree_view_insert_column (tree_view->view, column, 0);
- eye_cell = gimp_cell_renderer_toggle_new (GIMP_ICON_VISIBLE);
+
+ eye_cell = gimp_cell_renderer_toggle_new (GIMP_ICON_VISIBLE);
+
icon_size = gimp_get_icon_size (GTK_WIDGET (tool_editor),
GIMP_ICON_VISIBLE,
GTK_ICON_SIZE_BUTTON,
- view_size -
- 2 * tree_style->xthickness,
- view_size -
- 2 * tree_style->ythickness);
+ view_size - (border.left + border.right),
+ view_size - (border.top + border.bottom));
g_object_set (eye_cell, "stock-size", icon_size, NULL);
gtk_tree_view_column_pack_start (column, eye_cell, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]