[gtksourceview] Set fixed width for completion proposal icon cell renderer
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtksourceview] Set fixed width for completion proposal icon cell renderer
- Date: Sun, 3 Jan 2010 11:43:10 +0000 (UTC)
commit e773e9c57e99070cfae1e39327de923919ae1977
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date: Sun Jan 3 12:43:01 2010 +0100
Set fixed width for completion proposal icon cell renderer
gtksourceview/gtksourcecompletion.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index 441679c..3df1eec 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -119,6 +119,7 @@ struct _GtkSourceCompletionPrivate
GtkWidget *image_info;
GtkTreeViewColumn *tree_view_column_accelerator;
GtkCellRenderer *cell_renderer_accelerator;
+ GtkCellRenderer *cell_renderer_icon;
GtkWidget *tree_view_proposals;
GtkSourceCompletionModel *model_proposals;
@@ -1154,6 +1155,8 @@ update_column_sizes (GtkSourceCompletion *completion)
gint xpad;
gint separator;
GtkStyle *style;
+ gint icon_width;
+ gint icon_height;
/* Resize tree view columns accordingly */
g_object_get (completion->priv->cell_renderer_accelerator,
@@ -1173,6 +1176,11 @@ update_column_sizes (GtkSourceCompletion *completion)
set_column_width (tv, 0, completion->priv->tree_view_proposals->allocation.width - cwidth);
set_column_width (tv, 1, cwidth);
+
+ gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &icon_width, &icon_height);
+ gtk_cell_renderer_set_fixed_size (completion->priv->cell_renderer_icon,
+ icon_width,
+ icon_height);
}
static void
@@ -2881,9 +2889,12 @@ initialize_ui (GtkSourceCompletion *completion)
column = GTK_TREE_VIEW_COLUMN (gtk_builder_get_object (builder,
"tree_view_column_proposal"));
+
+ completion->priv->cell_renderer_icon = GTK_CELL_RENDERER (gtk_builder_get_object (builder,
+ "cell_renderer_icon"));
+
gtk_tree_view_column_set_cell_data_func (column,
- GTK_CELL_RENDERER (gtk_builder_get_object (builder,
- "cell_renderer_icon")),
+ completion->priv->cell_renderer_icon,
(GtkTreeCellDataFunc)render_proposal_icon_func,
completion,
NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]