[nautilus/wip/antoniof/column-chooser-dialog-rework] WIP



commit 89efd00d1335539202186415bb131dbd3deb8b4d
Author: António Fernandes <antoniof gnome org>
Date:   Tue Aug 3 17:44:14 2021 +0100

    WIP

 src/nautilus-list-view-private.h                   |  1 +
 src/nautilus-list-view.c                           | 33 ++++++++++++++++++++++
 .../ui/nautilus-list-view-column-editor.ui         | 10 +++----
 3 files changed, 39 insertions(+), 5 deletions(-)
---
diff --git a/src/nautilus-list-view-private.h b/src/nautilus-list-view-private.h
index 9d4cbad42..2895facee 100644
--- a/src/nautilus-list-view-private.h
+++ b/src/nautilus-list-view-private.h
@@ -61,6 +61,7 @@ struct NautilusListViewDetails {
 
   GHashTable *columns;
   GtkWidget *column_editor;
+  gboolean custom_columns;
 
   char *original_name;
 
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 89ad9e92b..71dcf8640 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -2550,6 +2550,10 @@ get_visible_columns (NautilusListView *list_view)
 
     visible_columns = nautilus_file_get_metadata_list (file,
                                                        NAUTILUS_METADATA_KEY_LIST_VIEW_VISIBLE_COLUMNS);
+    if (visible_columns != NULL)
+    {
+        list_view->details->custom_columns = TRUE;
+    }
     if (visible_columns == NULL)
     {
         visible_columns = get_default_visible_columns_as_list (list_view);
@@ -2608,6 +2612,11 @@ get_column_order (NautilusListView *list_view)
                        (file,
                        NAUTILUS_METADATA_KEY_LIST_VIEW_COLUMN_ORDER);
 
+    if (column_order != NULL)
+    {
+        list_view->details->custom_columns = TRUE;
+    }
+
     if (column_order)
     {
         GPtrArray *res;
@@ -3417,6 +3426,22 @@ column_chooser_use_default_callback (NautilusColumnChooser *chooser,
     g_strfreev (default_order);
 }
 
+static void
+on_custom_columns_checkbox_toggled (GtkToggleButton *togglebutton,
+                                    gpointer         user_data)
+{
+    NautilusListView *view = NAUTILUS_LIST_VIEW (user_data);
+
+    if (gtk_toggle_button_get_active (togglebutton))
+    {
+
+    }
+    else
+    {
+
+    }
+}
+
 static GtkWidget *
 create_column_editor (NautilusListView *view)
 {
@@ -3424,6 +3449,7 @@ create_column_editor (NautilusListView *view)
     GtkWidget *window;
     GtkWidget *box;
     GtkWidget *column_chooser;
+    GtkWidget *checkbox;
     NautilusFile *file;
     char *str;
     char *name;
@@ -3456,6 +3482,13 @@ create_column_editor (NautilusListView *view)
     column_chooser_set_from_settings
         (NAUTILUS_COLUMN_CHOOSER (column_chooser), view);
 
+    checkbox = GTK_WIDGET (gtk_builder_get_object (builder, "checkbox"));
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox),
+                                  view->details->custom_columns);
+    g_signal_connect (checkbox, "toggled",
+                      G_CALLBACK (on_custom_columns_checkbox_toggled),
+                      view);
+
     return window;
 }
 
diff --git a/src/resources/ui/nautilus-list-view-column-editor.ui 
b/src/resources/ui/nautilus-list-view-column-editor.ui
index 5b30e863c..7454f6ec3 100644
--- a/src/resources/ui/nautilus-list-view-column-editor.ui
+++ b/src/resources/ui/nautilus-list-view-column-editor.ui
@@ -6,6 +6,7 @@
     <property name="type-hint">dialog</property>
     <property name="default-width">300</property>
     <property name="default-height">400</property>
+    <property name="title" translatable="yes">Visible Columns</property>
     <child>
       <object class="GtkBox">
         <property name="visible">True</property>
@@ -24,12 +25,11 @@
             <property name="orientation">vertical</property>
             <property name="spacing">12</property>
             <child>
-              <object class="GtkLabel">
-                <property name="label" translatable="yes">Choose the order of information to appear in this 
folder:</property>
+              <object class="GtkCheckButton" id="checkbox">
+                <property name="label" translatable="yes">_Apply only to current folder</property>
                 <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="yalign">0</property>
-                <property name="wrap">True</property>
+                <property name="active">False</property>
+                <property name="use-underline">True</property>
               </object>
             </child>
           </object>


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