[baobab] Add a 'Close' button to the Infobar and clear the message when changing UI page
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab] Add a 'Close' button to the Infobar and clear the message when changing UI page
- Date: Tue, 10 Apr 2012 21:24:00 +0000 (UTC)
commit c7e01d8d35caa5b7f7fb1b9a4cbde26d51b63308
Author: Stefano Facchini <stefano facchini gmail com>
Date: Tue Apr 10 23:22:01 2012 +0200
Add a 'Close' button to the Infobar and clear the message when changing UI page
src/baobab-main-window.ui | 8 +++++++-
src/baobab-window.vala | 4 ++++
2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/baobab-main-window.ui b/src/baobab-main-window.ui
index bf98771..f569bdf 100644
--- a/src/baobab-main-window.ui
+++ b/src/baobab-main-window.ui
@@ -163,12 +163,18 @@
</child>
<child internal-child="action_area">
<object class="GtkButtonBox" id="infobar-action-area">
- <property name="visible">False</property>
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="infobar-close-button">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Close</property>
+ </object>
+ </child>
</object>
</child>
</object>
diff --git a/src/baobab-window.vala b/src/baobab-window.vala
index 30c2bfa..862b0cd 100644
--- a/src/baobab-window.vala
+++ b/src/baobab-window.vala
@@ -132,6 +132,9 @@ namespace Baobab {
setup_home_page ();
setup_treeview (builder);
+ var infobar_close_button = builder.get_object ("infobar-close-button") as Gtk.Button;
+ infobar_close_button.clicked.connect (() => { clear_message (); });
+
// To make it draggable like a primary toolbar
toolbar.get_style_context ().add_class (Gtk.STYLE_CLASS_MENUBAR);
@@ -170,6 +173,7 @@ namespace Baobab {
scanner.cancel ();
}
+ clear_message ();
set_ui_page (UIPage.HOME);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]