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




commit f45f6147d1206919787540dfa66a58cd78cd0300
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 554c69ab3..680a48990 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -7919,7 +7919,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..d018571c2 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" 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]