[baobab/reroot-view: 2/4] More styling of FolderDisplay



commit 838e7ca4aad35516fb4f4fa8b04bde131220d4b0
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Fri Jun 26 10:30:48 2020 +0200

    More styling of FolderDisplay
    
    Add a border below, make the text bold and add an icon suggesting that clicking
    there will take you up one level.

 data/baobab.css                  | 10 +++++++++-
 data/ui/baobab-folder-display.ui |  5 +++++
 src/baobab-folder-display.vala   |  5 +++++
 3 files changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/data/baobab.css b/data/baobab.css
index 44edd4a..f5a10b6 100644
--- a/data/baobab.css
+++ b/data/baobab.css
@@ -54,7 +54,15 @@
     color: @theme_unfocused_text_color;
 }
 
-window.background stack > grid > frame border,
+/* FolderDisplay */
+window.background stack > grid > frame border {
+    border-width: 0 1px 1px 0;
+}
+window.background stack > grid > frame treeview {
+       font-weight: bold;
+}
+
+/* regular TreeView */
 window.background stack > grid > scrolledwindow.frame {
     border-width: 0 1px 0 0;
 }
diff --git a/data/ui/baobab-folder-display.ui b/data/ui/baobab-folder-display.ui
index 687feb6..a80b246 100644
--- a/data/ui/baobab-folder-display.ui
+++ b/data/ui/baobab-folder-display.ui
@@ -17,6 +17,11 @@
         <property name="expand">True</property>
         <property name="reorderable">True</property>
         <property name="sort_column_id">0</property>
+        <child>
+          <object class="GtkCellRendererPixbuf" id="folder_column_icon_renderer">
+            <property name="icon_name">pan-up-symbolic</property>
+          </object>
+        </child>
         <child>
           <object class="BaobabCellRendererName" id="folder_column_text_renderer">
             <property name="ellipsize">end</property>
diff --git a/src/baobab-folder-display.vala b/src/baobab-folder-display.vala
index b8e5b55..651308b 100644
--- a/src/baobab-folder-display.vala
+++ b/src/baobab-folder-display.vala
@@ -29,6 +29,8 @@ namespace Baobab {
         public Gtk.TreeViewColumn contents_column;
         [GtkChild]
         public Gtk.TreeViewColumn time_modified_column;
+        [GtkChild]
+        private Gtk.CellRendererPixbuf folder_column_icon_renderer;
 
         construct {
             row_activated.connect (() => { activated (); });
@@ -78,6 +80,9 @@ namespace Baobab {
 
                 if (value.get_depth () == 1) {
                     name = location.name;
+                    folder_column_icon_renderer.visible = false;
+                } else {
+                    folder_column_icon_renderer.visible = true;
                 }
 
                 var list_store = (Gtk.ListStore) model;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]