[devhelp/wip/wintemplate: 2/7] Add close button
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp/wip/wintemplate: 2/7] Add close button
- Date: Wed, 24 Jul 2013 09:05:48 +0000 (UTC)
commit 9d80c5f5e134e3c0d54048f1b5ff571d64ad9807
Author: Ignacio Casal Quinteiro <ignacio casal nice-software com>
Date: Tue Jul 23 17:23:59 2013 +0200
Add close button
src/dh-window.c | 5 +++++
src/dh-window.ui | 30 ++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/src/dh-window.c b/src/dh-window.c
index 2969102..6e6469b 100644
--- a/src/dh-window.c
+++ b/src/dh-window.c
@@ -48,6 +48,7 @@ struct _DhWindowPriv {
GtkImage *back_button_image;
GtkWidget *forward_button;
GtkImage *forward_button_image;
+ GtkWidget *close_button;
GtkWidget *grid_sidebar;
GtkWidget *grid_documents;
GtkWidget *findbar;
@@ -597,6 +598,7 @@ dh_window_class_init (DhWindowClass *klass)
gtk_widget_class_bind_child (widget_class, DhWindowPriv, back_button_image);
gtk_widget_class_bind_child (widget_class, DhWindowPriv, forward_button);
gtk_widget_class_bind_child (widget_class, DhWindowPriv, forward_button_image);
+ gtk_widget_class_bind_child (widget_class, DhWindowPriv, close_button);
gtk_widget_class_bind_child (widget_class, DhWindowPriv, hpaned);
gtk_widget_class_bind_child (widget_class, DhWindowPriv, grid_sidebar);
gtk_widget_class_bind_child (widget_class, DhWindowPriv, grid_documents);
@@ -670,6 +672,9 @@ window_populate (DhWindow *window)
gtk_image_set_from_icon_name (priv->back_button_image, prev_icon, GTK_ICON_SIZE_MENU);
gtk_image_set_from_icon_name (priv->forward_button_image, next_icon, GTK_ICON_SIZE_MENU);
+ g_signal_connect_swapped (priv->close_button, "clicked",
+ G_CALLBACK (gtk_window_close), window);
+
/* Sidebar */
priv->sidebar = dh_sidebar_new (book_manager);
gtk_widget_set_vexpand (priv->sidebar, TRUE);
diff --git a/src/dh-window.ui b/src/dh-window.ui
index 8890076..27da92b 100644
--- a/src/dh-window.ui
+++ b/src/dh-window.ui
@@ -120,6 +120,36 @@
<property name="pack_type">end</property>
</packing>
</child>
+ <child>
+ <object class="GtkSeparator" id="close_button_separator">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="valign">fill</property>
+ </object>
+ <packing>
+ <property name="pack_type">end</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="close_button">
+ <property name="visible">True</property>
+ <property name="valign">center</property>
+ <property name="relief">none</property>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage" id="close_button_image">
+ <property name="visible">True</property>
+ <property name="icon_size">1</property>
+ <property name="icon_name">window-close-symbolic</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="pack_type">end</property>
+ </packing>
+ </child>
</object>
</child>
<child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]