[nautilus/wip/corey/dnd_features: 3/10] files-view: Add Unstar back to file context menu when in Starred folder
- From: Corey Berla <coreyberla src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/corey/dnd_features: 3/10] files-view: Add Unstar back to file context menu when in Starred folder
- Date: Thu, 1 Sep 2022 20:51:46 +0000 (UTC)
commit ecf0b976f4ffac8e46a5cbd7830057d48a301af8
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..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]