[gnome-calendar] gcal-window: added cute close button
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] gcal-window: added cute close button
- Date: Thu, 4 Dec 2014 22:29:31 +0000 (UTC)
commit 2919eedc5fc008a16a9d316ffd52f1e80045224a
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Sat Jul 27 18:17:30 2013 -0400
gcal-window: added cute close button
src/gcal-window.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 0be8f4c..acc45d7 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -309,6 +309,10 @@ view_changed (GObject *object,
priv = gcal_window_get_instance_private (GCAL_WINDOW (user_data));
+ /* XXX: this is the destruction process */
+ if (!gtk_widget_get_visible (priv->views_stack))
+ return;
+
eklass = g_type_class_ref (gcal_window_view_type_get_type ());
eval = g_enum_get_value_by_nick (
eklass,
@@ -606,6 +610,8 @@ gcal_window_constructed (GObject *object)
GtkWidget *box;
GtkWidget *search_button;
GtkWidget *menu_button;
+ GtkWidget *separator;
+ GtkWidget *close_button;
gint i;
@@ -653,10 +659,19 @@ gcal_window_constructed (GObject *object)
_("Settings"));
gd_header_button_set_symbolic_icon_name (GD_HEADER_BUTTON (menu_button),
"emblem-system-symbolic");
+
gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->header_bar), menu_button);
- gtk_widget_set_hexpand (priv->header_bar, TRUE);
+ separator = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
+ gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->header_bar), separator);
+
+ close_button = gd_header_simple_button_new ();
+ gd_header_button_set_symbolic_icon_name (GD_HEADER_BUTTON (close_button),
+ "window-close-symbolic");
+ gtk_button_set_relief (GTK_BUTTON (close_button), GTK_RELIEF_NONE);
+ gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->header_bar), close_button);
+ gtk_widget_set_hexpand (priv->header_bar, TRUE);
gtk_window_set_titlebar (GTK_WINDOW (object), priv->header_bar);
/* search_bar */
@@ -755,6 +770,8 @@ gcal_window_constructed (GObject *object)
g_signal_connect_swapped (priv->new_button, "clicked",
G_CALLBACK (gcal_window_new_event), object);
+ g_signal_connect_swapped (close_button, "clicked",
+ G_CALLBACK (gtk_window_close), GTK_WINDOW (object));
for (i = 0; i < 4; ++i)
{
g_signal_connect (priv->views[i], "create-event",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]