[gnome-control-center] shell: Use GdHeaderBar in the shell
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] shell: Use GdHeaderBar in the shell
- Date: Mon, 18 Feb 2013 15:41:15 +0000 (UTC)
commit 8bee6c94614325496fd2ba4aaa1cadcffe3ad44c
Author: William Jon McCann <jmccann redhat com>
Date: Sun Feb 17 10:21:59 2013 -0500
shell: Use GdHeaderBar in the shell
https://bugzilla.gnome.org/show_bug.cgi?id=692174
configure.ac | 2 +-
libgd | 2 +-
shell/cc-window.c | 39 ++++++++-------------------------------
3 files changed, 10 insertions(+), 33 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0f512c3..97e40f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -120,7 +120,7 @@ COMMON_MODULES="gtk+-3.0 >= $GTK_REQUIRED_VERSION
gsettings-desktop-schemas >= $SCHEMAS_REQUIRED_VERSION
libnotify >= $LIBNOTIFY_REQUIRED_VERSION"
-LIBGD_INIT([_view-common static])
+LIBGD_INIT([_view-common main-toolbar header-bar static])
PKG_CHECK_MODULES(LIBLANGUAGE, $COMMON_MODULES gnome-desktop-3.0 fontconfig)
PKG_CHECK_MODULES(LIBSHORTCUTS, $COMMON_MODULES x11)
diff --git a/libgd b/libgd
index 680a9f7..1098bdd 160000
--- a/libgd
+++ b/libgd
@@ -1 +1 @@
-Subproject commit 680a9f72a0c3019cf4013ed026270ee7b9f1abc9
+Subproject commit 1098bdd6835baf4cd0342eca686528024d6c0839
diff --git a/shell/cc-window.c b/shell/cc-window.c
index 1ae8da2..695462f 100644
--- a/shell/cc-window.c
+++ b/shell/cc-window.c
@@ -31,6 +31,7 @@
#include <gdk/gdkx.h>
#include <string.h>
#include <libgd/gd-styled-text-renderer.h>
+#include <libgd/gd-header-bar.h>
#include "cc-panel.h"
#include "cc-shell.h"
@@ -1371,36 +1372,11 @@ create_header (CcWindow *self)
{
CcWindowPrivate *priv = self->priv;
GtkWidget *button;
- GtkWidget *box;
GtkWidget *image;
- GtkWidget *frame;
- GtkWidget *alignment;
- GtkToolItem *item;
AtkObject *accessible;
GtkStyleContext *context;
- priv->header = gtk_toolbar_new ();
-
- context = gtk_widget_get_style_context (priv->header);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_MENUBAR);
-
- item = gtk_tool_item_new ();
- gtk_toolbar_insert (GTK_TOOLBAR (priv->header), item, -1);
- gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), TRUE);
-
- box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_widget_set_margin_left (box, 10);
- gtk_widget_set_margin_right (box, 5);
- gtk_widget_set_margin_top (box, 5);
- gtk_widget_set_margin_bottom (box, 5);
- gtk_container_add (GTK_CONTAINER (item), box);
-
- frame = gtk_aspect_frame_new (NULL, 0, 0.5, 1, FALSE);
- gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
- gtk_widget_set_hexpand (frame, TRUE);
- gtk_container_add (GTK_CONTAINER (box), frame);
- if (gtk_widget_get_direction (frame) == GTK_TEXT_DIR_RTL)
- g_object_set (frame, "xalign", 1.0, NULL);
+ priv->header = gd_header_bar_new ();
image = gtk_image_new_from_icon_name ("view-grid-symbolic", GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
@@ -1409,14 +1385,13 @@ create_header (CcWindow *self)
gtk_widget_set_no_show_all (button, TRUE);
accessible = gtk_widget_get_accessible (button);
atk_object_set_name (accessible, _("All Settings"));
- gtk_container_add (GTK_CONTAINER (frame), button);
+ gd_header_bar_pack_start (GD_HEADER_BAR (priv->header), button);
g_signal_connect (button, "clicked", G_CALLBACK (home_button_clicked_cb), self);
-
- alignment = gtk_alignment_new (0, 1, 0, 0);
- gtk_container_add (GTK_CONTAINER (box), alignment);
+ context = gtk_widget_get_style_context (priv->home_button);
+ gtk_style_context_add_class (context, "raised");
priv->top_right_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_container_add (GTK_CONTAINER (alignment), priv->top_right_box);
+ gd_header_bar_pack_end (GD_HEADER_BAR (priv->header), priv->top_right_box);
priv->search_entry = gtk_search_entry_new ();
gtk_container_add (GTK_CONTAINER (priv->top_right_box), priv->search_entry);
@@ -1428,6 +1403,8 @@ create_header (CcWindow *self)
priv->lock_button = gtk_lock_button_new (NULL);
gtk_widget_set_no_show_all (button, TRUE);
gtk_container_add (GTK_CONTAINER (priv->top_right_box), priv->lock_button);
+ context = gtk_widget_get_style_context (priv->lock_button);
+ gtk_style_context_add_class (context, "raised");
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]