Browse Source

room-details: Allow to toggle fullscreen for MediaViewer

merge-requests/1579/head
Kévin Commaille 2 years ago
parent
commit
43cb85e99d
No known key found for this signature in database
GPG Key ID: 29A48C1F03620416
  1. 2
      data/resources/style.css
  2. 8
      src/session/view/content/room_details/mod.rs
  3. 3
      src/session/view/media_viewer.rs

2
data/resources/style.css

@ -146,7 +146,7 @@ power-level-badge.mod {
background-color: @warning_bg_color;
}
media-viewer headerbar {
media-viewer toolbarview headerbar {
background: black;
color: white;
}

8
src/session/view/content/room_details/mod.rs

@ -75,6 +75,14 @@ mod imp {
widget.show_subpage(subpage, false);
},
);
klass.install_action("win.toggle-fullscreen", None, |obj, _, _| {
if obj.is_fullscreened() {
obj.unfullscreen();
} else {
obj.fullscreen();
}
});
}
fn instance_init(obj: &InitializingObject<Self>) {

3
src/session/view/media_viewer.rs

@ -11,7 +11,6 @@ use crate::{
session::model::Room,
spawn, toast,
utils::{matrix::get_media_content, media::save_to_file},
Window,
};
const ANIMATION_DURATION: u32 = 250;
@ -171,7 +170,7 @@ mod imp {
// Bind `fullscreened` to the window property of the same name.
obj.connect_root_notify(|obj| {
if let Some(window) = obj.root().and_downcast::<Window>() {
if let Some(window) = obj.root().and_downcast::<gtk::Window>() {
window
.bind_property("fullscreened", obj, "fullscreened")
.sync_create()

Loading…
Cancel
Save