[fractal/clippy-ci: 5/25] Videos: open viewer when clicking on play button



commit 3c3cfe5081b70969004108c9d16b742a72eab486
Author: Sonja Heinze <sonjaleaheinze gmail com>
Date:   Wed Feb 12 13:08:04 2020 +0100

    Videos: open viewer when clicking on play button
    
    Before, when clicking on a video widget in the room history, the media
    viewer was only opened, if it was clicked anywhere on the widget but the
    play button.

 fractal-gtk/src/widgets/message.rs | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/fractal-gtk/src/widgets/message.rs b/fractal-gtk/src/widgets/message.rs
index 7a3e40d0..c569e17c 100644
--- a/fractal-gtk/src/widgets/message.rs
+++ b/fractal-gtk/src/widgets/message.rs
@@ -457,6 +457,9 @@ impl MessageBox {
         play_button.get_style_context().add_class("osd");
         play_button.get_style_context().add_class("play-icon");
         play_button.get_style_context().add_class("flat");
+        let data = glib::Variant::from(msg.id.as_str());
+        play_button.set_action_name(Some("app.open-media-viewer"));
+        play_button.set_action_target_value(Some(&data));
         overlay.add_overlay(&play_button);
 
         let menu_button = gtk::MenuButton::new();


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