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




commit d42db5154bf6846187738f809570752b77db3a02
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 32f08cce6..735bb41a4 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -7896,7 +7896,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 46cd7bdcf..1e00867ae 100644
--- a/src/resources/ui/nautilus-files-view-context-menus.ui
+++ b/src/resources/ui/nautilus-files-view-context-menus.ui
@@ -236,6 +236,11 @@
         <attribute name="action">view.remove-from-recent</attribute>
         <attribute name="hidden-when">action-disabled</attribute>
       </item>
+      <item>
+        <attribute name="label" translatable="yes" context="menu item" 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]