[baobab] Show the current folder name at in the toolbar
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab] Show the current folder name at in the toolbar
- Date: Sat, 4 Aug 2012 10:01:07 +0000 (UTC)
commit add6171782d7774253325e794ef942af39b28f56
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Aug 4 11:08:19 2012 +0200
Show the current folder name at in the toolbar
src/baobab-main-window.ui | 28 ++++++++++++++++++++++------
src/baobab-window.vala | 6 ++++++
2 files changed, 28 insertions(+), 6 deletions(-)
---
diff --git a/src/baobab-main-window.ui b/src/baobab-main-window.ui
index 4d12236..3a149ed 100644
--- a/src/baobab-main-window.ui
+++ b/src/baobab-main-window.ui
@@ -68,14 +68,30 @@
</packing>
</child>
<child>
- <object class="GtkSeparatorToolItem" id="separatortoolitem1">
+ <object class="GtkToolItem" id="toolbar-label-toolitem">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="draw">False</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkLabel" id="toolbar-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"></property>
+ <property name="selectable">True</property>
+ <property name="halign">GTK_ALIGN_CENTER</property>
+ <property name="ellipsize">end</property>
+ <property name="single_line_mode">True</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ </packing>
+ </child>
</object>
- <packing>
- <property name="expand">True</property>
- </packing>
+ <packing>
+ <property name="expand">True</property>
+ </packing>
</child>
<child>
<object class="GtkToolButton" id="rescan-button">
diff --git a/src/baobab-window.vala b/src/baobab-window.vala
index d639964..6a4538f 100644
--- a/src/baobab-window.vala
+++ b/src/baobab-window.vala
@@ -28,6 +28,7 @@ namespace Baobab {
Gtk.Toolbar toolbar;
Gtk.ToolItem toolbar_home_toolitem;
Gtk.ToolButton toolbar_show_home_page;
+ Gtk.Label toolbar_label;
Gtk.ToolButton toolbar_rescan;
Gtk.InfoBar infobar;
Gtk.Label infobar_primary;
@@ -118,6 +119,7 @@ namespace Baobab {
toolbar = builder.get_object ("toolbar") as Gtk.Toolbar;
toolbar_home_toolitem = builder.get_object ("home-page-toolitem") as Gtk.ToolItem;
toolbar_show_home_page = builder.get_object ("show-home-page-button") as Gtk.ToolButton;
+ toolbar_label = builder.get_object ("toolbar-label") as Gtk.Label;
toolbar_rescan = builder.get_object ("rescan-button") as Gtk.ToolButton;
infobar = builder.get_object ("infobar") as Gtk.InfoBar;
infobar_primary = builder.get_object ("infobar-primary-label") as Gtk.Label;
@@ -481,13 +483,17 @@ namespace Baobab {
void set_ui_state (UIPage page, bool busy) {
toolbar_home_toolitem.visible = (page == UIPage.HOME);
toolbar_show_home_page.visible = (page == UIPage.RESULT);
+ toolbar_label.visible = (page == UIPage.RESULT);
toolbar_rescan.visible = (page == UIPage.RESULT);
set_busy (busy);
if (page == UIPage.HOME) {
+ toolbar_label.set_text ("");
var action = lookup_action ("reload") as SimpleAction;
action.set_enabled (false);
+ } else {
+ toolbar_label.set_text (active_location.name);
}
main_notebook.page = page;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]