[file-roller/wip/gtk4: 21/54] gtk4: file selector dialog: make the location bar a widget




commit 960882d38b69be96e1ab04d035e42f202e322184
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Oct 1 12:37:25 2022 +0200

    gtk4: file selector dialog: make the location bar a widget

 src/fr-file-selector-dialog.c |  57 +++-----
 src/fr-location-bar.c         | 332 ++++++++++++++++++++++++++++++++++++++++++
 src/fr-location-bar.h         |  50 +++++++
 src/meson.build               |   2 +
 src/ui/app.css                |   5 +
 src/ui/file-selector.ui       |  78 ++++------
 6 files changed, 437 insertions(+), 87 deletions(-)
---
diff --git a/src/fr-file-selector-dialog.c b/src/fr-file-selector-dialog.c
index d1360a31..a7797cc0 100644
--- a/src/fr-file-selector-dialog.c
+++ b/src/fr-file-selector-dialog.c
@@ -21,6 +21,7 @@
 
 #include <config.h>
 #include "fr-file-selector-dialog.h"
+#include "fr-location-bar.h"
 #include "gio-utils.h"
 #include "glib-utils.h"
 #include "gtk-utils.h"
@@ -96,16 +97,16 @@ load_data_free (LoadData *load_data)
 
 
 struct _FrFileSelectorDialog {
-       GtkDialog      parent_instance;
-       GtkBuilder    *builder;
-       GtkWidget     *extra_widget;
-       GFile         *current_folder;
-       LoadData      *current_operation;
-       GSettings     *settings;
-       gboolean       show_hidden;
+       GtkDialog           parent_instance;
+       GtkBuilder         *builder;
+       GtkWidget          *extra_widget;
+       GFile              *current_folder;
+       LoadData           *current_operation;
+       GSettings          *settings;
+       gboolean            show_hidden;
        GSimpleActionGroup *action_map;
-       GtkPopover *file_context_menu;
-
+       GtkPopover         *file_context_menu;
+       GtkWidget          *location_bar;
 };
 
 
@@ -135,8 +136,6 @@ static void
 set_current_folder (FrFileSelectorDialog *self,
                    GFile                *folder)
 {
-       char *folder_name;
-
        if (folder != self->current_folder) {
                _g_object_unref (self->current_folder);
                self->current_folder = g_object_ref (folder);
@@ -145,10 +144,7 @@ set_current_folder (FrFileSelectorDialog *self,
        if (self->current_folder == NULL)
                return;
 
-       folder_name = g_file_get_parse_name (folder);
-       gtk_editable_set_text (GTK_EDITABLE (GET_WIDGET ("location_entry")), folder_name);
-       g_free (folder_name);
-
+       fr_location_bar_set_location (FR_LOCATION_BAR (self->location_bar), folder);
        //gtk_places_sidebar_set_location (GTK_PLACES_SIDEBAR (GET_WIDGET ("places_sidebar")), folder);
 }
 
@@ -418,7 +414,6 @@ is_selected_cellrenderertoggle_toggled_cb (GtkCellRendererToggle *cell_renderer,
        GtkTreeIter           iter;
        gboolean              is_selected;
 
-
        list_store = GTK_LIST_STORE (GET_WIDGET ("files_liststore"));
        tree_path = gtk_tree_path_new_from_string (path);
        if (! gtk_tree_model_get_iter (GTK_TREE_MODEL (list_store), &iter, tree_path)) {
@@ -467,22 +462,11 @@ files_treeview_row_activated_cb (GtkTreeView       *tree_view,
 
 
 static void
-go_up_button_clicked_cb (GtkButton *button,
-                        gpointer   user_data)
+location_bar_changed_cb (FrLocationBar *location_bar,
+                        gpointer       user_data)
 {
        FrFileSelectorDialog *self = user_data;
-       GFile                *parent;
-
-       if (self->current_folder == NULL)
-               return;
-
-       parent = g_file_get_parent (self->current_folder);
-       if (parent == NULL)
-               return;
-
-       fr_file_selector_dialog_set_current_folder (self, parent);
-
-       g_object_unref (parent);
+       fr_file_selector_dialog_set_current_folder (self, fr_location_bar_get_location (location_bar));
 }
 
 
@@ -631,6 +615,14 @@ fr_file_selector_dialog_init (FrFileSelectorDialog *self)
        gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (GET_WIDGET ("files_liststore")), 
FILE_LIST_COLUMN_MODIFIED, files_modified_column_sort_func, self, NULL);
        gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (GET_WIDGET ("files_liststore")), 
FILE_LIST_COLUMN_NAME, GTK_SORT_ASCENDING);
 
+       self->location_bar = fr_location_bar_new ();
+       gtk_widget_show (self->location_bar);
+       _gtk_box_pack_start (GTK_BOX (GET_WIDGET ("content_box")), self->location_bar, TRUE, FALSE);
+       g_signal_connect (self->location_bar,
+                         "changed",
+                         G_CALLBACK (location_bar_changed_cb),
+                         self);
+
        g_signal_connect (GTK_CELL_RENDERER_TOGGLE (GET_WIDGET ("is_selected_cellrenderertoggle")),
                          "toggled",
                          G_CALLBACK (is_selected_cellrenderertoggle_toggled_cb),
@@ -639,10 +631,6 @@ fr_file_selector_dialog_init (FrFileSelectorDialog *self)
                          "row-activated",
                          G_CALLBACK (files_treeview_row_activated_cb),
                          self);
-       g_signal_connect (GTK_BUTTON (GET_WIDGET ("go_up_button")),
-                         "clicked",
-                         G_CALLBACK (go_up_button_clicked_cb),
-                         self);
        /*g_signal_connect (GTK_PLACES_SIDEBAR (GET_WIDGET ("places_sidebar")),
                          "open-location",
                          G_CALLBACK (places_sidebar_open_location_cb),
@@ -843,7 +831,6 @@ get_folder_content_done_cb (GError   *error,
                g_free (modified);
                g_date_time_unref (datetime);
                g_free (size);
-               _g_object_unref (icon);
        }
 
        gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (GET_WIDGET ("files_liststore")), 
sort_column_id, sort_order);
diff --git a/src/fr-location-bar.c b/src/fr-location-bar.c
new file mode 100644
index 00000000..88887668
--- /dev/null
+++ b/src/fr-location-bar.c
@@ -0,0 +1,332 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  File-Roller
+ *
+ *  Copyright (C) 2022 Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <config.h>
+#include <glib/gi18n.h>
+#include "gtk-utils.h"
+#include "glib-utils.h"
+#include "fr-location-bar.h"
+
+
+enum {
+       CHANGED,
+       LAST_SIGNAL
+};
+
+
+static guint fr_location_bar_signals[LAST_SIGNAL] = { 0 };
+
+
+typedef struct {
+       GFile *location;
+       GtkWidget *location_entry;
+       GtkWidget *previous_location_button;
+       GtkWidget *next_location_button;
+       GtkWidget *parent_location_button;
+       GList *history;
+       GList *history_current;
+} FrLocationBarPrivate;
+
+
+G_DEFINE_TYPE_WITH_PRIVATE (FrLocationBar, fr_location_bar, GTK_TYPE_BOX)
+
+
+static void
+fr_location_bar_finalize (GObject *object)
+{
+       FrLocationBar *self = FR_LOCATION_BAR (object);
+       FrLocationBarPrivate *private = fr_location_bar_get_instance_private (self);
+
+       _g_object_list_unref (private->history);
+
+       G_OBJECT_CLASS (fr_location_bar_parent_class)->finalize (object);
+}
+
+
+static void
+fr_location_bar_class_init (FrLocationBarClass *klass)
+{
+       GObjectClass *object_class;
+
+       fr_location_bar_parent_class = g_type_class_peek_parent (klass);
+
+       object_class = (GObjectClass*) klass;
+       object_class->finalize = fr_location_bar_finalize;
+
+       fr_location_bar_signals[CHANGED] =
+               g_signal_newv ("changed",
+                              G_TYPE_FROM_CLASS (klass),
+                              G_SIGNAL_RUN_LAST,
+                              /* class_closure = */ NULL,
+                              NULL, NULL,
+                              g_cclosure_marshal_VOID__VOID,
+                              G_TYPE_NONE,
+                              0, NULL);
+}
+
+
+static void
+location_changed (FrLocationBar *self) {
+       g_signal_emit (self, fr_location_bar_signals[CHANGED], 0, NULL);
+}
+
+
+static void
+update_navigation_sensitivity (FrLocationBar *self)
+{
+       FrLocationBarPrivate *private = fr_location_bar_get_instance_private (self);
+       gtk_widget_set_sensitive (private->previous_location_button,
+                                 (private->history != NULL)
+                                 && (private->history_current != NULL)
+                                 && (private->history_current->next != NULL));
+       gtk_widget_set_sensitive (private->next_location_button,
+                                 (private->history != NULL)
+                                 && (private->history_current != NULL)
+                                 && (private->history_current->prev != NULL));
+
+       GFile *parent = (private->location != NULL) ? g_file_get_parent (private->location) : NULL;
+       gtk_widget_set_sensitive (private->parent_location_button, parent != NULL);
+       _g_object_unref (parent);
+}
+
+
+static gboolean
+previous_location_button_clicked_cb (GtkButton *button,
+                                    gpointer   user_data)
+{
+       FrLocationBar *self = user_data;
+       FrLocationBarPrivate *private = fr_location_bar_get_instance_private (self);
+
+       if (private->history == NULL)
+               return TRUE;
+       if (private->history_current == NULL)
+               return TRUE;
+       if (private->history_current->next == NULL)
+               return TRUE;
+
+       private->history_current = private->history_current->next;
+
+       _g_object_unref (private->location);
+       private->location = g_object_ref (G_FILE (private->history_current->data));
+       location_changed (self);
+
+       return TRUE;
+}
+
+
+static gboolean
+next_location_button_clicked_cb (GtkButton *button,
+                                gpointer   user_data)
+{
+       FrLocationBar *self = user_data;
+       FrLocationBarPrivate *private = fr_location_bar_get_instance_private (self);
+
+       if (private->history == NULL)
+               return TRUE;
+       if (private->history_current == NULL)
+               return TRUE;
+       if (private->history_current->prev == NULL)
+               return TRUE;
+
+       private->history_current = private->history_current->prev;
+
+       _g_object_unref (private->location);
+       private->location = g_object_ref (G_FILE (private->history_current->data));
+       location_changed (self);
+
+       return TRUE;
+}
+
+
+static gboolean
+parent_location_button_clicked_cb (GtkButton *button,
+                                  gpointer   user_data)
+{
+       FrLocationBar *self = user_data;
+       FrLocationBarPrivate *private = fr_location_bar_get_instance_private (self);
+       GFile *parent;
+
+       parent = g_file_get_parent (private->location);
+       if (parent == NULL)
+               return TRUE;
+
+       _g_object_unref (private->location);
+       private->location = parent;
+       location_changed (self);
+
+       return TRUE;
+}
+
+
+static gboolean
+location_entry_activate_cb (GtkEntry *entry,
+                           gpointer  user_data)
+{
+       FrLocationBar *self = user_data;
+       FrLocationBarPrivate *private = fr_location_bar_get_instance_private (self);
+
+       _g_object_unref (private->location);
+       private->location = g_file_parse_name (gtk_editable_get_text (GTK_EDITABLE (entry)));
+       location_changed (self);
+
+       return FALSE;
+}
+
+
+static void
+fr_location_bar_init (FrLocationBar *self)
+{
+       FrLocationBarPrivate *private = fr_location_bar_get_instance_private (self);
+
+       private->location = NULL;
+       private->history = NULL;
+       private->history_current = NULL;
+
+       gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_HORIZONTAL);
+       gtk_box_set_spacing (GTK_BOX (self), 6);
+       gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (self)), "locationbar");
+
+       GtkWidget *navigation_commands = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+       gtk_style_context_add_class (gtk_widget_get_style_context (navigation_commands), "raised");
+       gtk_style_context_add_class (gtk_widget_get_style_context (navigation_commands), "linked");
+       gtk_box_append (GTK_BOX (self), navigation_commands);
+
+       GtkWidget *button;
+
+       private->previous_location_button = button = gtk_button_new_from_icon_name ("go-previous-symbolic");
+       gtk_widget_set_tooltip_text (button, _("Go to the previous visited location"));
+       gtk_box_append (GTK_BOX (navigation_commands), button);
+       g_signal_connect (button,
+                         "clicked",
+                         G_CALLBACK (previous_location_button_clicked_cb),
+                         self);
+
+       private->next_location_button = button = gtk_button_new_from_icon_name ("go-next-symbolic");
+       gtk_widget_set_tooltip_text (button, _("Go to the next visited location"));
+       gtk_box_append (GTK_BOX (navigation_commands), button);
+       g_signal_connect (button,
+                         "clicked",
+                         G_CALLBACK (next_location_button_clicked_cb),
+                         self);
+
+       private->parent_location_button = button = gtk_button_new_from_icon_name ("go-up-symbolic");
+       gtk_widget_set_tooltip_text (button, _("Open the parent location"));
+       gtk_box_append (GTK_BOX (self), button);
+       g_signal_connect (button,
+                         "clicked",
+                         G_CALLBACK (parent_location_button_clicked_cb),
+                         self);
+
+       GtkWidget *location_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+       _gtk_box_pack_end (GTK_BOX (self), location_box, TRUE, FALSE);
+
+       /* Translators: after the colon there is a folder name. */
+       GtkWidget *location_label = gtk_label_new_with_mnemonic (_("_Location:"));
+       gtk_widget_set_margin_start (location_label, 5);
+       gtk_widget_set_margin_end (location_label, 5);
+       gtk_box_append (GTK_BOX (location_box), location_label);
+
+       private->location_entry = gtk_entry_new ();
+       gtk_entry_set_icon_from_icon_name (GTK_ENTRY (private->location_entry),
+                                          GTK_ENTRY_ICON_PRIMARY,
+                                          "folder-symbolic");
+       g_signal_connect (private->location_entry,
+                         "activate",
+                         G_CALLBACK (location_entry_activate_cb),
+                         self);
+       gtk_widget_set_margin_start (private->location_entry, 5);
+       gtk_widget_set_margin_end (private->location_entry, 5);
+       _gtk_box_pack_end (GTK_BOX (location_box), private->location_entry, TRUE, FALSE);
+}
+
+
+GtkWidget *
+fr_location_bar_new (void)
+{
+       return g_object_new (FR_TYPE_LOCATION_BAR, NULL);
+}
+
+
+GFile *
+fr_location_bar_get_location (FrLocationBar *self)
+{
+       FrLocationBarPrivate *private = fr_location_bar_get_instance_private (self);
+       return private->location;
+}
+
+
+static void
+fr_location_bar_history_add (FrLocationBar *self,
+                            GFile         *location)
+{
+       FrLocationBarPrivate *private = fr_location_bar_get_instance_private (self);
+
+       if ((private->history_current == NULL) || !g_file_equal (location, (GFile *) 
private->history_current->data)) {
+               GList *scan;
+               GList *new_current = NULL;
+
+               /* Search the location in the history. */
+               for (scan = private->history_current; scan; scan = scan->next) {
+                       GFile *location_in_history = scan->data;
+
+                       if (g_file_equal (location, location_in_history)) {
+                               new_current = scan;
+                               break;
+                       }
+               }
+
+               if (new_current != NULL) {
+                       private->history_current = new_current;
+               }
+               else {
+                       /* Remove all the location after the current position. */
+                       for (scan = private->history; scan && (scan != private->history_current); /* void */) 
{
+                               GList *next = scan->next;
+
+                               private->history = g_list_remove_link (private->history, scan);
+                               _g_object_list_unref (scan);
+
+                               scan = next;
+                       }
+
+                       private->history = g_list_prepend (private->history, g_object_ref (location));
+                       private->history_current = private->history;
+               }
+       }
+       update_navigation_sensitivity (self);
+}
+
+
+void
+fr_location_bar_set_location (FrLocationBar *self,
+                             GFile         *location)
+{
+       FrLocationBarPrivate *private = fr_location_bar_get_instance_private (self);
+
+       _g_object_unref (private->location);
+       private->location = g_object_ref (location);
+
+       char *name = g_file_get_parse_name (private->location);
+       gtk_editable_set_text (GTK_EDITABLE (private->location_entry), name);
+       g_free (name);
+
+       fr_location_bar_history_add (self, private->location);
+}
diff --git a/src/fr-location-bar.h b/src/fr-location-bar.h
new file mode 100644
index 00000000..360497a5
--- /dev/null
+++ b/src/fr-location-bar.h
@@ -0,0 +1,50 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  File-Roller
+ *
+ *  Copyright (C) 2022 The Free Software Foundation, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef FR_LOCATION_BAR_H
+#define FR_LOCATION_BAR_H
+
+#include <gtk/gtk.h>
+
+#define FR_TYPE_LOCATION_BAR (fr_location_bar_get_type ())
+G_DECLARE_FINAL_TYPE (FrLocationBar, fr_location_bar, FR, LOCATION_BAR, GtkBox)
+
+struct _FrLocationBar {
+       GtkBox parent_class;
+};
+
+struct _FrLocationBarClass {
+       GtkBoxClass parent_class;
+       void (* changed) (FrLocationBar *location_bar);
+};
+
+GtkWidget * fr_location_bar_new (void);
+
+/**
+ * fr_location_bar_get_location:
+ * Returns: (transfer none)
+ */
+GFile * fr_location_bar_get_location (FrLocationBar *dialog);
+
+void    fr_location_bar_set_location (FrLocationBar *dialog,
+                                     GFile         *location);
+
+#endif /* FR_LOCATION_BAR_H */
diff --git a/src/meson.build b/src/meson.build
index edc66164..ca149be7 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -39,6 +39,7 @@ source_files = files(
   'fr-file-data.c',
   'fr-file-selector-dialog.c',
   'fr-init.c',
+  'fr-location-bar.c',
   'fr-new-archive-dialog.c',
   'fr-process.c',
   'fr-window-actions-callbacks.c',
@@ -81,6 +82,7 @@ fr_headers = files(
   'fr-file-data.h',
   'fr-file-selector-dialog.h',
   'fr-init.h',
+  'fr-location-bar.h',
   'fr-new-archive-dialog.h',
   'fr-process.h',
   'fr-window-actions-callbacks.h',
diff --git a/src/ui/app.css b/src/ui/app.css
index d05a07ac..facf14a2 100644
--- a/src/ui/app.css
+++ b/src/ui/app.css
@@ -2,3 +2,8 @@
        padding: 10px;
        border-bottom: 1px solid @borders;
 }
+
+.borders-top-bottom {
+       border-top: 1px solid @borders;
+       border-bottom: 1px solid @borders;
+}
diff --git a/src/ui/file-selector.ui b/src/ui/file-selector.ui
index 5dc733fc..02f6fcd4 100644
--- a/src/ui/file-selector.ui
+++ b/src/ui/file-selector.ui
@@ -21,7 +21,7 @@
   </menu>
   <object class="GtkListStore" id="files_liststore">
     <columns>
-      <column type="GdkPixbuf"/>
+      <column type="GIcon"/>
       <column type="gchararray"/>
       <column type="gchararray"/>
       <column type="gchararray"/>
@@ -35,7 +35,7 @@
   </object>
   <object class="GtkListStore" id="places_liststore">
     <columns>
-      <column type="GdkPixbuf"/>
+      <column type="GIcon"/>
       <column type="gchararray"/>
       <column type="GObject"/>
       <column type="gboolean"/>
@@ -47,49 +47,14 @@
     <property name="orientation">vertical</property>
     <property name="spacing">12</property>
     <child>
-      <object class="GtkBox" id="box2">
+      <object class="GtkBox" id="content_box">
         <property name="vexpand">1</property>
         <property name="orientation">vertical</property>
-        <property name="spacing">12</property>
-        <child>
-          <object class="GtkBox" id="toolbox">
-            <property name="spacing">12</property>
-            <child>
-              <object class="GtkLabel" id="label1">
-                <property name="label" translatable="1">_Location:</property>
-                <property name="use_underline">1</property>
-                <property name="mnemonic_widget">location_entry</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkEntry" id="location_entry">
-                <property name="hexpand">1</property>
-                <property name="focusable">1</property>
-                <property name="invisible_char">●</property>
-                <property name="primary_icon_name">folder</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkButton" id="go_up_button">
-                <property name="halign">center</property>
-                <property name="focusable">1</property>
-                <property name="receives_default">1</property>
-                <property name="has_tooltip">1</property>
-                <property name="tooltip_markup" translatable="1">Go up one level</property>
-                <property name="tooltip_text" translatable="1">Go up one level</property>
-                <property name="relief">none</property>
-                <child>
-                  <object class="GtkImage" id="image1">
-                    <property name="icon_name">go-up-symbolic</property>
-                    <property name="icon_size">large</property>
-                  </object>
-                </child>
-              </object>
-            </child>
-          </object>
-        </child>
         <child>
           <object class="GtkPaned" id="main_paned">
+            <style>
+              <class name="borders-top-bottom"/>
+            </style>
             <property name="vexpand">1</property>
             <property name="resize-start-child">0</property>
             <property name="focusable">1</property>
@@ -119,20 +84,25 @@
                         <property name="reorderable">1</property>
                         <property name="sort_column_id">1</property>
                         <child>
-                          <object class="GtkCellRendererToggle" id="is_selected_cellrenderertoggle"/>
+                          <object class="GtkCellRendererToggle" id="is_selected_cellrenderertoggle">
+                            <property name="xpad">5</property>
+                          </object>
                           <attributes>
                             <attribute name="active">9</attribute>
                           </attributes>
                         </child>
                         <child>
-                          <object class="GtkCellRendererPixbuf" id="cellrendererpixbuf2"/>
+                          <object class="GtkCellRendererPixbuf" id="cellrendererpixbuf2">
+                            <property name="xpad">5</property>
+                          </object>
                           <attributes>
-                            <attribute name="pixbuf">0</attribute>
+                            <attribute name="gicon">0</attribute>
                           </attributes>
                         </child>
                         <child>
                           <object class="GtkCellRendererText" id="cellrenderertext4">
                             <property name="ellipsize">end</property>
+                            <property name="ypad">5</property>
                           </object>
                           <attributes>
                             <attribute name="text">1</attribute>
@@ -142,14 +112,16 @@
                     </child>
                     <child>
                       <object class="GtkTreeViewColumn" id="treeviewcolumn3">
-                        <property name="resizable">1</property>
-                        <property name="sizing">fixed</property>
-                        <property name="fixed_width">100</property>
+                        <property name="resizable">0</property>
+                        <property name="sizing">autosize</property>
                         <property name="title" translatable="1" context="File">Size</property>
                         <property name="reorderable">1</property>
                         <property name="sort_column_id">2</property>
                         <child>
-                          <object class="GtkCellRendererText" id="cellrenderertext2"/>
+                          <object class="GtkCellRendererText" id="cellrenderertext2">
+                            <property name="xpad">5</property>
+                            <property name="ypad">5</property>
+                          </object>
                           <attributes>
                             <attribute name="text">2</attribute>
                           </attributes>
@@ -158,14 +130,16 @@
                     </child>
                     <child>
                       <object class="GtkTreeViewColumn" id="treeviewcolumn4">
-                        <property name="resizable">1</property>
-                        <property name="sizing">fixed</property>
-                        <property name="fixed_width">100</property>
+                        <property name="resizable">0</property>
+                        <property name="sizing">autosize</property>
                         <property name="title" translatable="1" context="File">Modified</property>
                         <property name="reorderable">1</property>
                         <property name="sort_column_id">3</property>
                         <child>
-                          <object class="GtkCellRendererText" id="cellrenderertext3"/>
+                          <object class="GtkCellRendererText" id="cellrenderertext3">
+                            <property name="xpad">5</property>
+                            <property name="ypad">5</property>
+                          </object>
                           <attributes>
                             <attribute name="text">3</attribute>
                           </attributes>


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