[gnome-calendar] window: added New Event item to menu button
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] window: added New Event item to menu button
- Date: Thu, 4 Dec 2014 22:39:35 +0000 (UTC)
commit 8e066850a37c5fd771f1b1e77adbbbe8ae050612
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Tue Oct 21 01:28:44 2014 -0400
window: added New Event item to menu button
Updated label on app-menu action.
data/ui/menus.ui | 10 +++++++++-
src/gcal-window.c | 25 +++++++++++++++++++++++--
2 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/data/ui/menus.ui b/data/ui/menus.ui
index bda2e82..f85deee 100644
--- a/data/ui/menus.ui
+++ b/data/ui/menus.ui
@@ -3,7 +3,7 @@
<menu id="appmenu">
<section>
<item>
- <attribute name="label" translatable="yes">_New</attribute>
+ <attribute name="label" translatable="yes">_New Event</attribute>
<attribute name="action">app.new</attribute>
<attribute name="accel"><Primary>n</attribute>
</item>
@@ -26,4 +26,12 @@
</item>
</section>
</menu>
+ <menu id="winmenu">
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_New Event</attribute>
+ <attribute name="action">app.new</attribute>
+ </item>
+ </section>
+ </menu>
</interface>
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 7e42f20..a945a6c 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -869,7 +869,10 @@ gcal_window_constructed (GObject *object)
GtkWidget *box;
GtkWidget *search_button;
+
GtkWidget *menu_button;
+ GtkBuilder *builder;
+ GMenuModel *winmenu;
gint i;
@@ -896,8 +899,26 @@ gcal_window_constructed (GObject *object)
priv->views_switcher);
/* header_bar: menu */
- menu_button = gtk_button_new_from_icon_name ("open-menu-symbolic", GTK_ICON_SIZE_MENU);
- gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->header_bar), menu_button);
+ menu_button = gtk_menu_button_new ();
+ gtk_menu_button_set_use_popover (GTK_MENU_BUTTON (menu_button),
+ TRUE);
+ gtk_button_set_image (
+ GTK_BUTTON (menu_button),
+ gtk_image_new_from_icon_name ("open-menu-symbolic",
+ GTK_ICON_SIZE_MENU));
+ gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->header_bar),
+ menu_button);
+
+ builder = gtk_builder_new ();
+ gtk_builder_add_from_resource (builder,
+ "/org/gnome/calendar/menus.ui",
+ NULL);
+
+ winmenu = (GMenuModel *)gtk_builder_get_object (builder, "winmenu");
+ gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button),
+ winmenu);
+
+ g_object_unref (builder);
/* header_bar: search */
search_button = gtk_toggle_button_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]