From 6a669571cb58aaefb778dbd393dd645c0f1a9d99 Mon Sep 17 00:00:00 2001 From: Muhammad Ragib Hasin Date: Tue, 11 Jan 2022 10:58:13 +0600 Subject: [PATCH] Fix build fails on GTK and web --- druid-shell/src/backend/gtk/window.rs | 6 ++--- druid-shell/src/backend/web/window.rs | 33 +++++++++++++-------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/druid-shell/src/backend/gtk/window.rs b/druid-shell/src/backend/gtk/window.rs index 5068210f2f..79a3c98d25 100644 --- a/druid-shell/src/backend/gtk/window.rs +++ b/druid-shell/src/backend/gtk/window.rs @@ -977,13 +977,13 @@ impl WindowHandle { pub fn is_resizable(&self) -> bool { self.state .upgrade() - .map(true, |state| state.window.is_resizable()) + .map_or(true, |state| state.window.is_resizable()) } pub fn is_transparent(&self) -> bool { self.state .upgrade() - .map_or(false, |state| state.is_transparent) + .map_or(false, |state| state.is_transparent.get()) } pub fn show_titlebar(&self, show_titlebar: bool) { @@ -995,7 +995,7 @@ impl WindowHandle { pub fn has_titlebar(&self) -> bool { self.state .upgrade() - .map(true, |state| state.window.is_decorated()) + .map_or(true, |state| state.window.is_decorated()) } pub fn set_position(&self, mut position: Point) { diff --git a/druid-shell/src/backend/web/window.rs b/druid-shell/src/backend/web/window.rs index b1d54baab9..b7b23002f5 100644 --- a/druid-shell/src/backend/web/window.rs +++ b/druid-shell/src/backend/web/window.rs @@ -377,29 +377,14 @@ impl WindowBuilder { // Ignored } - pub fn is_resizable(&self) -> bool { - warn!("is_resizable is unimplemented on web"); - true - } - pub fn show_titlebar(&mut self, _show_titlebar: bool) { // Ignored } - pub fn has_titlebar(&self) -> bool { - warn!("has_titlebar is unimplemented on web"); - true - } - pub fn set_transparent(&mut self, _transparent: bool) { // Ignored } - pub fn is_transparent(&self) -> bool { - warn!("is_transparent is unimplemented on web"); - true - } - pub fn set_position(&mut self, _position: Point) { // Ignored } @@ -493,13 +478,27 @@ impl WindowHandle { } pub fn resizable(&self, _resizable: bool) { - warn!("resizable unimplemented for web"); + warn!("WindowHandle::resizable unimplemented for web"); + } + + pub fn is_resizable(&self) -> bool { + warn!("WindowHandle::is_resizable is unimplemented on web"); + true } pub fn show_titlebar(&self, _show_titlebar: bool) { - warn!("show_titlebar unimplemented for web"); + warn!("WindowHandle::show_titlebar unimplemented for web"); } + pub fn has_titlebar(&self) -> bool { + warn!("WindowHandle::has_titlebar is unimplemented on web"); + true + } + + pub fn is_transparent(&self) -> bool { + warn!("WindowHandle::is_transparent is unimplemented on web"); + true + } pub fn set_position(&self, _position: Point) { warn!("WindowHandle::set_position unimplemented for web"); }