[cheese/wip/trad-title-bar: 1/2] Use avatar chooser headerbar only when requested
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese/wip/trad-title-bar: 1/2] Use avatar chooser headerbar only when requested
- Date: Thu, 24 Apr 2014 13:23:16 +0000 (UTC)
commit c002ffea1cb213db5ceb9991b05416e4857f8a4b
Author: Iain Lane <iain lane canonical com>
Date: Thu Apr 24 12:14:04 2014 +0100
Use avatar chooser headerbar only when requested
Use headerbar in the avatar chooser dialog only when necessary according
to the "gtk-shell-shows-menubar" setting.
https://bugzilla.gnome.org/show_bug.cgi?id=728866
libcheese/cheese-avatar-chooser.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/libcheese/cheese-avatar-chooser.c b/libcheese/cheese-avatar-chooser.c
index 9aabad1..4a63f0f 100644
--- a/libcheese/cheese-avatar-chooser.c
+++ b/libcheese/cheese-avatar-chooser.c
@@ -153,6 +153,21 @@ cheese_avatar_chooser_class_init (CheeseAvatarChooserClass *klass)
g_object_class_install_properties (object_class, PROP_LAST, properties);
}
+static gboolean
+application_has_traditional_menus (void)
+{
+ GtkSettings *settings;
+ gboolean show_menubar;
+
+ settings = gtk_settings_get_default ();
+
+ g_object_get (G_OBJECT (settings),
+ "gtk-shell-shows-menubar", &show_menubar,
+ NULL);
+
+ return show_menubar;
+}
+
/**
* cheese_avatar_chooser_new:
*
@@ -163,7 +178,8 @@ cheese_avatar_chooser_class_init (CheeseAvatarChooserClass *klass)
GtkWidget *
cheese_avatar_chooser_new (void)
{
- return g_object_new (CHEESE_TYPE_AVATAR_CHOOSER, "use-header-bar", TRUE, NULL);
+ return g_object_new (CHEESE_TYPE_AVATAR_CHOOSER, "use-header-bar",
+ application_has_traditional_menus (), NULL);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]