[gnome-calendar] ui: migrating from GdHeaderBar to GtkHeaderBar
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] ui: migrating from GdHeaderBar to GtkHeaderBar
- Date: Thu, 4 Dec 2014 22:19:12 +0000 (UTC)
commit dd969cf14d929ef94d086361b756dd0144d24038
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Mon May 27 16:41:48 2013 -0400
ui: migrating from GdHeaderBar to GtkHeaderBar
src/gcal-application.c | 2 +-
src/gcal-window.c | 34 ++++++++++++++++++----------------
2 files changed, 19 insertions(+), 17 deletions(-)
---
diff --git a/src/gcal-application.c b/src/gcal-application.c
index f6942c1..adf51e8 100644
--- a/src/gcal-application.c
+++ b/src/gcal-application.c
@@ -157,7 +157,7 @@ gcal_application_activate (GApplication *application)
G_SETTINGS_BIND_SET | G_SETTINGS_BIND_GET);
gtk_window_set_title (GTK_WINDOW (priv->window), _("Calendar"));
gtk_window_set_hide_titlebar_when_maximized (GTK_WINDOW (priv->window),
- TRUE);
+ FALSE);
variant = g_settings_get_value (priv->settings, "window-size");
size = g_variant_get_fixed_array (variant, &n_elements, sizeof (gint32));
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 2c1d157..3cd834d 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -249,7 +249,7 @@ gcal_window_constructed (GObject *object)
GTK_ORIENTATION_VERTICAL);
/* header_bar */
- priv->header_bar = gd_header_bar_new ();
+ priv->header_bar = gtk_header_bar_new ();
/* header_bar: new */
priv->new_button = gd_header_simple_button_new ();
@@ -259,7 +259,7 @@ gcal_window_constructed (GObject *object)
gtk_widget_get_style_context (priv->new_button),
"suggested-action");
/* FIXME: gtk_actionable_set_action_name (GTK_ACTIONABLE (forward_button), "win.new-event"); */
- gd_header_bar_pack_start (GD_HEADER_BAR (priv->header_bar), priv->new_button);
+ gtk_header_bar_pack_start (GTK_HEADER_BAR (priv->header_bar), priv->new_button);
/* header_bar: views. Temporarily, since this will be made of GdStackSwitcher */
priv->views_switcher = gtk_image_new_from_icon_name ("face-wink-symbolic", GTK_ICON_SIZE_MENU);
@@ -269,7 +269,7 @@ gcal_window_constructed (GObject *object)
search_button = gd_header_toggle_button_new ();
gd_header_button_set_symbolic_icon_name (GD_HEADER_BUTTON (search_button),
"edit-find-symbolic");
- gd_header_bar_pack_end (GD_HEADER_BAR (priv->header_bar), search_button);
+ gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->header_bar), search_button);
/* header_bar: menu */
menu_button = gd_header_menu_button_new ();
@@ -277,10 +277,10 @@ gcal_window_constructed (GObject *object)
_("Settings"));
gd_header_button_set_symbolic_icon_name (GD_HEADER_BUTTON (menu_button),
"emblem-system-symbolic");
- gd_header_bar_pack_end (GD_HEADER_BAR (priv->header_bar), menu_button);
+ gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->header_bar), menu_button);
gtk_widget_set_hexpand (priv->header_bar, TRUE);
- gtk_container_add (GTK_CONTAINER (priv->main_box), priv->header_bar);
+ /* gtk_container_add (GTK_CONTAINER (priv->main_box), priv->header_bar); */
/* search_bar */
priv->search_entry = gtk_search_entry_new ();
@@ -328,9 +328,11 @@ gcal_window_constructed (GObject *object)
gtk_container_add (GTK_CONTAINER (object), priv->main_box);
gtk_widget_show_all (priv->main_box);
- /* FIXME: hack to ensure proper working of gd_header_bar */
- gd_header_bar_set_custom_title (GD_HEADER_BAR (priv->header_bar),
- priv->views_switcher);
+ /* FIXME: hack to ensure proper working of gtk_header_bar */
+ gtk_header_bar_set_custom_title (GTK_HEADER_BAR (priv->header_bar),
+ priv->views_switcher);
+
+ gtk_window_set_titlebar (GTK_WINDOW (object), priv->header_bar);
}
static void
@@ -412,8 +414,8 @@ gcal_window_search_toggled (GObject *object,
/* update headder_bar widget */
gtk_widget_hide (priv->new_button);
- gd_header_bar_set_custom_title (GD_HEADER_BAR (priv->header_bar),
- NULL);
+ gtk_header_bar_set_custom_title (GTK_HEADER_BAR (priv->header_bar),
+ NULL);
/* _prepare_for_search */
}
else
@@ -421,8 +423,8 @@ gcal_window_search_toggled (GObject *object,
g_debug ("Leaving search mode");
/* update header_bar */
gtk_widget_show (priv->new_button);
- gd_header_bar_set_custom_title (GD_HEADER_BAR (priv->header_bar),
- priv->views_switcher);
+ gtk_header_bar_set_custom_title (GTK_HEADER_BAR (priv->header_bar),
+ priv->views_switcher);
/* return to last active_view */
gd_stack_set_visible_child (GD_STACK (priv->views_stack),
priv->views[priv->active_view]);
@@ -450,13 +452,13 @@ gcal_window_search_changed (GtkEditable *editable,
{
title = g_strdup_printf ("Results for \"%s\"",
gtk_entry_get_text (GTK_ENTRY (entry)));
- gd_header_bar_set_title (GD_HEADER_BAR (priv->header_bar),
- title);
+ gtk_header_bar_set_title (GTK_HEADER_BAR (priv->header_bar),
+ title);
}
else
{
- gd_header_bar_set_title (GD_HEADER_BAR (priv->header_bar),
- "");
+ gtk_header_bar_set_title (GTK_HEADER_BAR (priv->header_bar),
+ "");
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]