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

MediaViewer: Implement the revealing of headerbar

See https://gitlab.gnome.org/World/fractal/issues/265
parent 9d3769fa
...@@ -4,6 +4,8 @@ extern crate gdk; ...@@ -4,6 +4,8 @@ extern crate gdk;
use self::gtk::prelude::*; use self::gtk::prelude::*;
use self::gdk::WindowExt; use self::gdk::WindowExt;
use self::gdk::DisplayExt;
use self::gdk::SeatExt;
use glib; use glib;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
...@@ -100,6 +102,22 @@ impl App { ...@@ -100,6 +102,22 @@ impl App {
} }
} }
let main_window = ui.builder
.get_object::<gtk::Window>("main_window")
.expect("Cant find main_window in ui file.");
if let Some(win) = main_window.get_window() {
if let Some(disp) = gdk::Display::get_default() {
if let Some(seat) = disp.get_default_seat() {
if let Some(ptr) = seat.get_pointer() {
let (_, _, y, _) = win.get_device_position(&ptr);
if y <= 6 && win.get_state().contains(gdk::WindowState::FULLSCREEN) {
headerbar_revealer.set_reveal_child(true);
}
}
}
}
}
let previous_media_revealer = ui.builder let previous_media_revealer = ui.builder
.get_object::<gtk::Revealer>("previous_media_revealer") .get_object::<gtk::Revealer>("previous_media_revealer")
.expect("Cant find previous_media_revealer in ui file."); .expect("Cant find previous_media_revealer in ui file.");
......
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