[gtk+/filesystemmodel] Factor out function to set a fixed size for the icon cell renderers
- From: Federico Mena Quintero <federico src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/filesystemmodel] Factor out function to set a fixed size for the icon cell renderers
- Date: Fri, 11 Sep 2009 21:14:54 +0000 (UTC)
commit b2cc6279b23447a90a7a15dfe237febc4fa27a8c
Author: Federico Mena Quintero <federico novell com>
Date: Fri Sep 11 13:14:49 2009 -0500
Factor out function to set a fixed size for the icon cell renderers
Signed-off-by: Federico Mena Quintero <federico novell com>
gtk/gtkfilechooserdefault.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 95b5d24..df10412 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -4352,6 +4352,14 @@ file_list_query_tooltip_cb (GtkWidget *widget,
return TRUE;
}
+static void
+set_icon_cell_renderer_fixed_size (GtkFileChooserDefault *impl, GtkCellRenderer *renderer)
+{
+ gtk_cell_renderer_set_fixed_size (renderer,
+ renderer->xpad * 2 + impl->icon_size,
+ renderer->ypad * 2 + impl->icon_size);
+}
+
/* Creates the widgets for the file list */
static GtkWidget *
create_file_list (GtkFileChooserDefault *impl)
@@ -4430,9 +4438,7 @@ create_file_list (GtkFileChooserDefault *impl)
renderer = gtk_cell_renderer_pixbuf_new ();
/* We set a fixed size so that we get an empty slot even if no icons are loaded yet */
- gtk_cell_renderer_set_fixed_size (renderer,
- renderer->xpad * 2 + impl->icon_size,
- renderer->ypad * 2 + impl->icon_size);
+ set_icon_cell_renderer_fixed_size (impl, renderer);
gtk_tree_view_column_pack_start (impl->list_name_column, renderer, FALSE);
impl->list_name_renderer = gtk_cell_renderer_text_new ();
@@ -5654,9 +5660,7 @@ change_icon_theme (GtkFileChooserDefault *impl)
cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (
gtk_tree_view_get_column (GTK_TREE_VIEW (impl->browse_files_tree_view), 0)));
renderer = GTK_CELL_RENDERER (cells->data);
- gtk_cell_renderer_set_fixed_size (renderer,
- renderer->xpad * 2 + impl->icon_size,
- renderer->ypad * 2 + impl->icon_size);
+ set_icon_cell_renderer_fixed_size (impl, renderer);
g_list_free (cells);
if (impl->browse_files_model)
_gtk_file_system_model_clear_cache (impl->browse_files_model, MODEL_COL_PIXBUF);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]