[gnome-control-center/gnome-3-8] cc-window: use GdHeaderSimpleButton for the Back button



commit 6b14730770c052b6b8c44c81125de3e4b2a232e3
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Mar 19 11:39:30 2013 -0400

    cc-window: use GdHeaderSimpleButton for the Back button
    
    Simplifies code and ensures consistency with the other applications.

 shell/cc-window.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/shell/cc-window.c b/shell/cc-window.c
index 8828702..b184ebf 100644
--- a/shell/cc-window.c
+++ b/shell/cc-window.c
@@ -30,9 +30,7 @@
 #include <gdk/gdkkeysyms.h>
 #include <gdk/gdkx.h>
 #include <string.h>
-#include <libgd/gd-styled-text-renderer.h>
-#include <libgd/gd-header-bar.h>
-#include <libgd/gd-stack.h>
+#include <libgd/gd.h>
 
 #include "cc-panel.h"
 #include "cc-shell.h"
@@ -1398,23 +1396,18 @@ create_header (CcWindow *self)
 {
   CcWindowPrivate *priv = self->priv;
   GtkWidget *button;
-  GtkWidget *image;
   AtkObject *accessible;
-  GtkStyleContext *context;
 
   priv->header = gd_header_bar_new ();
 
-  image = gtk_image_new_from_icon_name ("go-previous-symbolic", GTK_ICON_SIZE_MENU);
-  gtk_widget_show (image);
-  priv->previous_button = button = gtk_button_new ();
-  gtk_button_set_image (GTK_BUTTON (button), image);
+  priv->previous_button = button = gd_header_simple_button_new ();
+  gd_header_button_set_symbolic_icon_name (GD_HEADER_BUTTON (button),
+                                           "go-previous-symbolic");
   gtk_widget_set_no_show_all (button, TRUE);
   accessible = gtk_widget_get_accessible (button);
   atk_object_set_name (accessible, _("All Settings"));
   gd_header_bar_pack_start (GD_HEADER_BAR (priv->header), button);
   g_signal_connect (button, "clicked", G_CALLBACK (previous_button_clicked_cb), self);
-  context = gtk_widget_get_style_context (priv->previous_button);
-  gtk_style_context_add_class (context, "image-button");
 
   priv->top_right_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
   gd_header_bar_pack_end (GD_HEADER_BAR (priv->header), priv->top_right_box);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]