Skip to content

Commit

Permalink
Fix build fails on GTK and web
Browse files Browse the repository at this point in the history
  • Loading branch information
RagibHasin committed Jan 17, 2023
1 parent d1d908d commit 15b2f82
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
6 changes: 3 additions & 3 deletions druid-shell/src/backend/gtk/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -975,13 +975,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) {
Expand All @@ -993,7 +993,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) {
Expand Down
33 changes: 16 additions & 17 deletions druid-shell/src/backend/web/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,29 +384,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
}
Expand Down Expand Up @@ -513,13 +498,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");
}
Expand Down

0 comments on commit 15b2f82

Please sign in to comment.