[fractal] sidebar: Improve context menu entires



commit 534d2bcec312e64345f9e02abc31b762433604ab
Author: Julian Sparber <julian sparber net>
Date:   Fri Apr 22 15:34:37 2022 +0200

    sidebar: Improve context menu entires
    
    Part-of: <https://gitlab.gnome.org/GNOME/fractal/-/merge_requests/931>

 data/resources/ui/sidebar.ui    | 13 ++++---------
 src/session/sidebar/room_row.rs | 23 +++++++----------------
 2 files changed, 11 insertions(+), 25 deletions(-)
---
diff --git a/data/resources/ui/sidebar.ui b/data/resources/ui/sidebar.ui
index 9a3d73fa3..2464c9620 100644
--- a/data/resources/ui/sidebar.ui
+++ b/data/resources/ui/sidebar.ui
@@ -37,25 +37,20 @@
     </section>
     <section>
       <item>
-        <attribute name="label" translatable="yes">Mark as _Favorite</attribute>
+        <attribute name="label" translatable="yes">Move to _Favorites</attribute>
         <attribute name="action">room-row.set-favorite</attribute>
         <attribute name="hidden-when">action-disabled</attribute>
       </item>
       <item>
-        <attribute name="label" translatable="yes">Unmark as _Favorite</attribute>
-        <attribute name="action">room-row.unset-favorite</attribute>
+        <attribute name="label" translatable="yes">Move to _Rooms</attribute>
+        <attribute name="action">room-row.set-normal</attribute>
         <attribute name="hidden-when">action-disabled</attribute>
       </item>
       <item>
-        <attribute name="label" translatable="yes">Mark as Low _Priority</attribute>
+        <attribute name="label" translatable="yes">Move to Low _Priority</attribute>
         <attribute name="action">room-row.set-lowpriority</attribute>
         <attribute name="hidden-when">action-disabled</attribute>
       </item>
-      <item>
-        <attribute name="label" translatable="yes">Unmark as Low _Priority</attribute>
-        <attribute name="action">room-row.unset-lowpriority</attribute>
-        <attribute name="hidden-when">action-disabled</attribute>
-      </item>
     </section>
     <section>
       <item>
diff --git a/src/session/sidebar/room_row.rs b/src/session/sidebar/room_row.rs
index 144ae42fa..80b27143d 100644
--- a/src/session/sidebar/room_row.rs
+++ b/src/session/sidebar/room_row.rs
@@ -48,15 +48,12 @@ mod imp {
             klass.install_action("room-row.set-favorite", None, move |widget, _, _| {
                 widget.room().unwrap().set_category(RoomType::Favorite);
             });
-            klass.install_action("room-row.unset-favorite", None, move |widget, _, _| {
+            klass.install_action("room-row.set-normal", None, move |widget, _, _| {
                 widget.room().unwrap().set_category(RoomType::Normal);
             });
             klass.install_action("room-row.set-lowpriority", None, move |widget, _, _| {
                 widget.room().unwrap().set_category(RoomType::LowPriority);
             });
-            klass.install_action("room-row.unset-lowpriority", None, move |widget, _, _| {
-                widget.room().unwrap().set_category(RoomType::Normal);
-            });
 
             klass.install_action("room-row.leave", None, move |widget, _, _| {
                 widget.room().unwrap().set_category(RoomType::Left);
@@ -248,9 +245,8 @@ impl RoomRow {
                     self.action_set_enabled("room-row.accept-invite", true);
                     self.action_set_enabled("room-row.reject-invite", true);
                     self.action_set_enabled("room-row.set-favorite", false);
-                    self.action_set_enabled("room-row.unset-favorite", false);
+                    self.action_set_enabled("room-row.set-normal", false);
                     self.action_set_enabled("room-row.set-lowpriority", false);
-                    self.action_set_enabled("room-row.unset-lowpriority", false);
                     self.action_set_enabled("room-row.leave", false);
                     self.action_set_enabled("room-row.join", false);
                     self.action_set_enabled("room-row.forget", false);
@@ -260,9 +256,8 @@ impl RoomRow {
                     self.action_set_enabled("room-row.accept-invite", false);
                     self.action_set_enabled("room-row.reject-invite", false);
                     self.action_set_enabled("room-row.set-favorite", false);
-                    self.action_set_enabled("room-row.unset-favorite", true);
+                    self.action_set_enabled("room-row.set-normal", true);
                     self.action_set_enabled("room-row.set-lowpriority", true);
-                    self.action_set_enabled("room-row.unset-lowpriority", false);
                     self.action_set_enabled("room-row.leave", true);
                     self.action_set_enabled("room-row.join", false);
                     self.action_set_enabled("room-row.forget", false);
@@ -272,9 +267,8 @@ impl RoomRow {
                     self.action_set_enabled("room-row.accept-invite", false);
                     self.action_set_enabled("room-row.reject-invite", false);
                     self.action_set_enabled("room-row.set-favorite", true);
-                    self.action_set_enabled("room-row.unset-favorite", false);
+                    self.action_set_enabled("room-row.set-normal", false);
                     self.action_set_enabled("room-row.set-lowpriority", true);
-                    self.action_set_enabled("room-row.unset-lowpriority", false);
                     self.action_set_enabled("room-row.leave", true);
                     self.action_set_enabled("room-row.join", false);
                     self.action_set_enabled("room-row.forget", false);
@@ -284,9 +278,8 @@ impl RoomRow {
                     self.action_set_enabled("room-row.accept-invite", false);
                     self.action_set_enabled("room-row.reject-invite", false);
                     self.action_set_enabled("room-row.set-favorite", true);
-                    self.action_set_enabled("room-row.unset-favorite", false);
+                    self.action_set_enabled("room-row.set-normal", true);
                     self.action_set_enabled("room-row.set-lowpriority", false);
-                    self.action_set_enabled("room-row.unset-lowpriority", true);
                     self.action_set_enabled("room-row.leave", true);
                     self.action_set_enabled("room-row.join", false);
                     self.action_set_enabled("room-row.forget", false);
@@ -296,9 +289,8 @@ impl RoomRow {
                     self.action_set_enabled("room-row.accept-invite", false);
                     self.action_set_enabled("room-row.reject-invite", false);
                     self.action_set_enabled("room-row.set-favorite", false);
-                    self.action_set_enabled("room-row.unset-favorite", false);
+                    self.action_set_enabled("room-row.set-normal", false);
                     self.action_set_enabled("room-row.set-lowpriority", false);
-                    self.action_set_enabled("room-row.unset-lowpriority", false);
                     self.action_set_enabled("room-row.leave", false);
                     self.action_set_enabled("room-row.join", true);
                     self.action_set_enabled("room-row.forget", true);
@@ -312,9 +304,8 @@ impl RoomRow {
         self.action_set_enabled("room-row.accept-invite", false);
         self.action_set_enabled("room-row.reject-invite", false);
         self.action_set_enabled("room-row.set-favorite", false);
-        self.action_set_enabled("room-row.unset-favorite", false);
+        self.action_set_enabled("room-row.set-normal", false);
         self.action_set_enabled("room-row.set-lowpriority", false);
-        self.action_set_enabled("room-row.unset-lowpriority", false);
         self.action_set_enabled("room-row.leave", false);
         self.action_set_enabled("room-row.join", false);
         self.action_set_enabled("room-row.forget", false);


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