[fractal/fractal-next] room_menu: Add members item



commit 35478155f4bcd43b3ca3e1cc4d4bbe179fd2b3b1
Author: Kai A. Hiller <V02460 gmail com>
Date:   Sat Aug 14 00:12:01 2021 +0200

    room_menu: Add members item

 data/resources/ui/content-room-history.ui | 7 +++++++
 src/session/content/room_history.rs       | 9 +++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/data/resources/ui/content-room-history.ui b/data/resources/ui/content-room-history.ui
index 92fee857..f02d5f67 100644
--- a/data/resources/ui/content-room-history.ui
+++ b/data/resources/ui/content-room-history.ui
@@ -7,6 +7,13 @@
         <attribute name="action">room-history.details</attribute>
         <attribute name="hidden-when">action-disabled</attribute>
       </item>
+      <item>
+        <attribute name="label" translatable="yes">Room _Members</attribute>
+        <attribute name="action">room-history.members</attribute>
+        <attribute name="hidden-when">action-disabled</attribute>
+      </item>
+    </section>
+    <section>
       <item>
         <attribute name="label" translatable="yes">_Leave Room</attribute>
         <attribute name="action">room-history.leave</attribute>
diff --git a/src/session/content/room_history.rs b/src/session/content/room_history.rs
index ac1166ac..ed51e4c2 100644
--- a/src/session/content/room_history.rs
+++ b/src/session/content/room_history.rs
@@ -76,7 +76,10 @@ mod imp {
             });
 
             klass.install_action("room-history.details", None, move |widget, _, _| {
-                widget.open_room_details();
+                widget.open_room_details("general");
+            });
+            klass.install_action("room-history.members", None, move |widget, _, _| {
+                widget.open_room_details("members");
             });
 
             klass.install_action("room-history.scroll-down", None, move |widget, _, _| {
@@ -363,9 +366,11 @@ impl RoomHistory {
         }
     }
 
-    pub fn open_room_details(&self) {
+    /// Opens the room details on the page with the given name.
+    pub fn open_room_details(&self, page_name: &str) {
         if let Some(room) = self.room() {
             let window = RoomDetails::new(&self.parent_window(), &room);
+            window.set_property("visible-page-name", page_name).unwrap();
             window.show();
         }
     }


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