Separate window show ui and code to enable editing

This commit is contained in:
Sophie Herold 2024-09-14 00:48:46 +02:00
parent 0012d807e3
commit 9205c93fae
8 changed files with 527 additions and 382 deletions

View file

@ -20,22 +20,24 @@
use super::*;
/// Manage visibility of overlay controls
impl LpWindow {
impl LpWindowImage {
/// Set control opacity
///
/// Also changes headerbar transparency if it flat and hides/shows cursor on
/// fullscreen
fn set_control_opacity(&self, opacity: f64, hiding: bool) {
let window = self.window();
self.image_view().controls_box_start().set_opacity(opacity);
self.image_view().controls_box_end().set_opacity(opacity);
if self.is_headerbar_flat() && self.is_fullscreen() {
if self.is_headerbar_flat() && window.is_fullscreen() {
self.headerbar().set_opacity(opacity);
} else {
self.headerbar().set_opacity(1.);
}
if self.is_fullscreen() && hiding && opacity < 0.9 {
if window.is_fullscreen() && hiding && opacity < 0.9 {
self.set_cursor(gdk::Cursor::from_name("none", None).as_ref());
} else {
self.set_cursor(None);