[gnome-control-center] shell: set the follow-state property to TRUE for pixbuf renderers
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] shell: set the follow-state property to TRUE for pixbuf renderers
- Date: Fri, 16 Sep 2011 01:07:50 +0000 (UTC)
commit 855bb77981a841a00790ca056c57451e2419ea28
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Sep 14 17:36:05 2011 -0400
shell: set the follow-state property to TRUE for pixbuf renderers
So that the icon is correctly highlighted when hovered. In order to do
this, we have to stop using gtk_icon_view_set_pixbuf_column() and pack a
cell renderer manually instead.
https://bugzilla.gnome.org/show_bug.cgi?id=658910
shell/cc-shell-category-view.c | 11 ++++++++++-
shell/gnome-control-center.c | 11 ++++++++++-
2 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/shell/cc-shell-category-view.c b/shell/cc-shell-category-view.c
index b2a5ee4..c51ec2a 100644
--- a/shell/cc-shell-category-view.c
+++ b/shell/cc-shell-category-view.c
@@ -141,13 +141,22 @@ cc_shell_category_view_constructed (GObject *object)
{
CcShellCategoryViewPrivate *priv = CC_SHELL_CATEGORY_VIEW (object)->priv;
GtkWidget *iconview, *vbox;
+ GtkCellRenderer *renderer;
iconview = cc_shell_item_view_new ();
gtk_icon_view_set_model (GTK_ICON_VIEW (iconview), priv->model);
vbox = gtk_vbox_new (FALSE, 0);
- gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (iconview), COL_PIXBUF);
+ renderer = gtk_cell_renderer_pixbuf_new ();
+ g_object_set (renderer,
+ "follow-state", TRUE,
+ NULL);
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (iconview),
+ renderer, FALSE);
+ gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (iconview), renderer,
+ "pixbuf", COL_PIXBUF);
+
gtk_icon_view_set_text_column (GTK_ICON_VIEW (iconview), COL_NAME);
gtk_icon_view_set_item_width (GTK_ICON_VIEW (iconview), 100);
cc_shell_item_view_update_cells (CC_SHELL_ITEM_VIEW (iconview));
diff --git a/shell/gnome-control-center.c b/shell/gnome-control-center.c
index c47d5bf..789f970 100644
--- a/shell/gnome-control-center.c
+++ b/shell/gnome-control-center.c
@@ -560,6 +560,7 @@ static void
setup_search (GnomeControlCenter *shell)
{
GtkWidget *search_scrolled, *search_view, *widget;
+ GtkCellRenderer *renderer;
GnomeControlCenterPrivate *priv = shell->priv;
g_return_if_fail (priv->store != NULL);
@@ -580,7 +581,15 @@ setup_search (GnomeControlCenter *shell)
gtk_icon_view_set_spacing (GTK_ICON_VIEW (search_view), 6);
gtk_icon_view_set_model (GTK_ICON_VIEW (search_view),
GTK_TREE_MODEL (priv->search_filter));
- gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (search_view), COL_PIXBUF);
+
+ renderer = gtk_cell_renderer_pixbuf_new ();
+ g_object_set (renderer,
+ "follow-state", TRUE,
+ NULL);
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (search_view),
+ renderer, FALSE);
+ gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (search_view), renderer,
+ "pixbuf", COL_PIXBUF);
search_scrolled = W (priv->builder, "search-scrolled-window");
gtk_container_add (GTK_CONTAINER (search_scrolled), search_view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]