Commit 9d3769fa authored by Eisha Chen-yen-su's avatar Eisha Chen-yen-su

MediaViewer: Move headerbar in full screen mode

See https://gitlab.gnome.org/World/fractal/issues/265
parent 3a00618f
...@@ -213,6 +213,19 @@ impl AppOp { ...@@ -213,6 +213,19 @@ impl AppOp {
.expect("Cant find main_window in ui file."); .expect("Cant find main_window in ui file.");
main_window.fullscreen(); main_window.fullscreen();
let stack_header = self.ui.builder
.get_object::<gtk::Stack>("headerbar_stack")
.expect("Can't find headerbar_stack in ui file.");
let media_viewer_headerbar_box = self.ui.builder
.get_object::<gtk::Box>("media_viewer_headerbar_box")
.expect("Can't find media_viewer_headerbar_box in ui file.");
let headerbar_revealer = self.ui.builder
.get_object::<gtk::Revealer>("headerbar_revealer")
.expect("Can't find headerbar_revealer in ui file.");
stack_header.remove(&media_viewer_headerbar_box);
headerbar_revealer.add(&media_viewer_headerbar_box);
self.update_media_viewport(); self.update_media_viewport();
} }
...@@ -222,6 +235,22 @@ impl AppOp { ...@@ -222,6 +235,22 @@ impl AppOp {
.expect("Cant find main_window in ui file."); .expect("Cant find main_window in ui file.");
main_window.unfullscreen(); main_window.unfullscreen();
let stack_header = self.ui.builder
.get_object::<gtk::Stack>("headerbar_stack")
.expect("Can't find headerbar_stack in ui file.");
let media_viewer_headerbar_box = self.ui.builder
.get_object::<gtk::Box>("media_viewer_headerbar_box")
.expect("Can't find media_viewer_headerbar_box in ui file.");
let headerbar_revealer = self.ui.builder
.get_object::<gtk::Revealer>("headerbar_revealer")
.expect("Can't find headerbar_revealer in ui file.");
if let Some(ch) = headerbar_revealer.get_child() {
headerbar_revealer.remove(&ch);
}
stack_header.add_named(&media_viewer_headerbar_box, "media-viewer");
stack_header.set_visible_child_name("media-viewer");
self.update_media_viewport(); self.update_media_viewport();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment