[gitg] Add close button
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Add close button
- Date: Tue, 28 May 2013 12:23:05 +0000 (UTC)
commit 87650faead3cc1d7ff2370472b2e5f38a4568996
Author: Jose Manuel Pintor Freire <jmpintorfreire gmail com>
Date: Tue May 28 14:22:48 2013 +0200
Add close button
Signed-off-by: Ignacio Casal Quinteiro <icq gnome org>
gitg/gitg-window.vala | 14 ++++++++++++++
gitg/resources/ui/gitg-window.ui | 30 ++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+), 0 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index f2f3240..9c7c3be 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -424,6 +424,20 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
repository = null;
});
+ // Extract widgets from the builder
+ var close_button = builder.get_object("close_button") as Gtk.Button;
+ close_button.clicked.connect((b) => {
+ Gdk.Event event;
+
+ event = new Gdk.Event(Gdk.EventType.DELETE);
+
+ event.any.window = this.get_window();
+ event.any.send_event = 1;
+
+ Gtk.main_do_event(event);
+ event.free();
+ });
+
d_main_stack = builder.get_object("main_stack") as Gd.Stack;
d_dash_scrolled_window = builder.get_object("dash_scrolled_window") as Gtk.ScrolledWindow;
diff --git a/gitg/resources/ui/gitg-window.ui b/gitg/resources/ui/gitg-window.ui
index f360339..cd41eac 100644
--- a/gitg/resources/ui/gitg-window.ui
+++ b/gitg/resources/ui/gitg-window.ui
@@ -53,6 +53,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_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]