Commit ad61ec17 authored by Eisha Chen-yen-su's avatar Eisha Chen-yen-su

MediaViewer: Hide some buttons in FS header bar

This hides the back and close buttons in the full screen header bar
in order to avoid unexpected behaviors.

See https://gitlab.gnome.org/World/fractal/issues/265
parent 64f6c06f
...@@ -228,6 +228,17 @@ impl AppOp { ...@@ -228,6 +228,17 @@ impl AppOp {
headerbar_revealer.add_events(8192); headerbar_revealer.add_events(8192);
stack_header.remove(&media_viewer_headerbar_box); stack_header.remove(&media_viewer_headerbar_box);
let media_viewer_headerbar = self.ui.builder
.get_object::<gtk::HeaderBar>("media_viewer_headerbar")
.expect("Can't find media_viewer_headerbar in ui file.");
let media_viewer_back_button = self.ui.builder
.get_object::<gtk::Button>("media_viewer_back_button")
.expect("Can't find media_viewer_back_button in ui file.");
media_viewer_headerbar.remove(&media_viewer_back_button);
media_viewer_headerbar.set_show_close_button(false);
headerbar_revealer.add(&media_viewer_headerbar_box); headerbar_revealer.add(&media_viewer_headerbar_box);
self.update_media_viewport(); self.update_media_viewport();
...@@ -252,6 +263,18 @@ impl AppOp { ...@@ -252,6 +263,18 @@ impl AppOp {
if let Some(ch) = headerbar_revealer.get_child() { if let Some(ch) = headerbar_revealer.get_child() {
headerbar_revealer.remove(&ch); headerbar_revealer.remove(&ch);
} }
let media_viewer_headerbar = self.ui.builder
.get_object::<gtk::HeaderBar>("media_viewer_headerbar")
.expect("Can't find media_viewer_headerbar in ui file.");
let media_viewer_back_button = self.ui.builder
.get_object::<gtk::Button>("media_viewer_back_button")
.expect("Can't find media_viewer_back_button in ui file.");
media_viewer_headerbar.pack_start(&media_viewer_back_button);
media_viewer_headerbar.set_child_position(&media_viewer_back_button, 0);
media_viewer_headerbar.set_show_close_button(true);
stack_header.add_named(&media_viewer_headerbar_box, "media-viewer"); stack_header.add_named(&media_viewer_headerbar_box, "media-viewer");
stack_header.set_visible_child_name("media-viewer"); stack_header.set_visible_child_name("media-viewer");
......
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