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 11, 2022
1 parent c2611e1 commit 6a66957
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 @@ -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) {
Expand All @@ -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) {
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 @@ -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
}
Expand Down Expand Up @@ -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");
}
Expand Down

0 comments on commit 6a66957

Please sign in to comment.