[nautilus/wip/corey/dnd_features: 73/80] files-view: Add Unstar back to file context menu when in Starred folder




commit a6d2865de7041ff5daa6e397d0e15493654cb29a
Author: Corey Berla <corey berla me>
Date:   Thu Aug 18 12:28:49 2022 -0700

    files-view: Add Unstar back to file context menu when in Starred folder
    
    Now we have another way to star files (by DnD), but unstarring is
    limitted to the properties window and the listview icon.  Add back
    the ability to unstar from the files context menu only when in the
    starred folder.

 src/nautilus-files-view.c                             | 2 +-
 src/resources/ui/nautilus-files-view-context-menus.ui | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 14c2a1e59..f0d38b4ea 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -7923,7 +7923,7 @@ real_update_actions_state (NautilusFilesView *view)
 
     action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
                                          "unstar");
-    g_simple_action_set_enabled (G_SIMPLE_ACTION (action), show_unstar);
+    g_simple_action_set_enabled (G_SIMPLE_ACTION (action), show_unstar && selection_contains_starred);
 }
 
 /* Convenience function to be called when updating menus,
diff --git a/src/resources/ui/nautilus-files-view-context-menus.ui 
b/src/resources/ui/nautilus-files-view-context-menus.ui
index 7c00e9dac..87f0c4111 100644
--- a/src/resources/ui/nautilus-files-view-context-menus.ui
+++ b/src/resources/ui/nautilus-files-view-context-menus.ui
@@ -243,6 +243,11 @@
         <attribute name="action">view.remove-from-recent</attribute>
         <attribute name="hidden-when">action-disabled</attribute>
       </item>
+      <item>
+        <attribute name="label" translatable="yes" comments="Unmarks a file as starred 
(starred)">Unstar</attribute>
+        <attribute name="action">view.unstar</attribute>
+        <attribute name="hidden-when">action-disabled</attribute>
+      </item>
     </section>
     <section id="selection-extensions-section"/>
     <section>


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