Skip to content

Commit 15b2f82

Browse files
committed
Fix build fails on GTK and web
1 parent d1d908d commit 15b2f82

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

druid-shell/src/backend/gtk/window.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -975,13 +975,13 @@ impl WindowHandle {
975975
pub fn is_resizable(&self) -> bool {
976976
self.state
977977
.upgrade()
978-
.map(true, |state| state.window.is_resizable())
978+
.map_or(true, |state| state.window.is_resizable())
979979
}
980980

981981
pub fn is_transparent(&self) -> bool {
982982
self.state
983983
.upgrade()
984-
.map_or(false, |state| state.is_transparent)
984+
.map_or(false, |state| state.is_transparent.get())
985985
}
986986

987987
pub fn show_titlebar(&self, show_titlebar: bool) {
@@ -993,7 +993,7 @@ impl WindowHandle {
993993
pub fn has_titlebar(&self) -> bool {
994994
self.state
995995
.upgrade()
996-
.map(true, |state| state.window.is_decorated())
996+
.map_or(true, |state| state.window.is_decorated())
997997
}
998998

999999
pub fn set_position(&self, mut position: Point) {

druid-shell/src/backend/web/window.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -384,29 +384,14 @@ impl WindowBuilder {
384384
// Ignored
385385
}
386386

387-
pub fn is_resizable(&self) -> bool {
388-
warn!("is_resizable is unimplemented on web");
389-
true
390-
}
391-
392387
pub fn show_titlebar(&mut self, _show_titlebar: bool) {
393388
// Ignored
394389
}
395390

396-
pub fn has_titlebar(&self) -> bool {
397-
warn!("has_titlebar is unimplemented on web");
398-
true
399-
}
400-
401391
pub fn set_transparent(&mut self, _transparent: bool) {
402392
// Ignored
403393
}
404394

405-
pub fn is_transparent(&self) -> bool {
406-
warn!("is_transparent is unimplemented on web");
407-
true
408-
}
409-
410395
pub fn set_position(&mut self, _position: Point) {
411396
// Ignored
412397
}
@@ -513,13 +498,27 @@ impl WindowHandle {
513498
}
514499

515500
pub fn resizable(&self, _resizable: bool) {
516-
warn!("resizable unimplemented for web");
501+
warn!("WindowHandle::resizable unimplemented for web");
502+
}
503+
504+
pub fn is_resizable(&self) -> bool {
505+
warn!("WindowHandle::is_resizable is unimplemented on web");
506+
true
517507
}
518508

519509
pub fn show_titlebar(&self, _show_titlebar: bool) {
520-
warn!("show_titlebar unimplemented for web");
510+
warn!("WindowHandle::show_titlebar unimplemented for web");
521511
}
522512

513+
pub fn has_titlebar(&self) -> bool {
514+
warn!("WindowHandle::has_titlebar is unimplemented on web");
515+
true
516+
}
517+
518+
pub fn is_transparent(&self) -> bool {
519+
warn!("WindowHandle::is_transparent is unimplemented on web");
520+
true
521+
}
523522
pub fn set_position(&self, _position: Point) {
524523
warn!("WindowHandle::set_position unimplemented for web");
525524
}

0 commit comments

Comments
 (0)