Skip to content

Commit 6a66957

Browse files
committed
Fix build fails on GTK and web
1 parent c2611e1 commit 6a66957

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
@@ -977,13 +977,13 @@ impl WindowHandle {
977977
pub fn is_resizable(&self) -> bool {
978978
self.state
979979
.upgrade()
980-
.map(true, |state| state.window.is_resizable())
980+
.map_or(true, |state| state.window.is_resizable())
981981
}
982982

983983
pub fn is_transparent(&self) -> bool {
984984
self.state
985985
.upgrade()
986-
.map_or(false, |state| state.is_transparent)
986+
.map_or(false, |state| state.is_transparent.get())
987987
}
988988

989989
pub fn show_titlebar(&self, show_titlebar: bool) {
@@ -995,7 +995,7 @@ impl WindowHandle {
995995
pub fn has_titlebar(&self) -> bool {
996996
self.state
997997
.upgrade()
998-
.map(true, |state| state.window.is_decorated())
998+
.map_or(true, |state| state.window.is_decorated())
999999
}
10001000

10011001
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
@@ -377,29 +377,14 @@ impl WindowBuilder {
377377
// Ignored
378378
}
379379

380-
pub fn is_resizable(&self) -> bool {
381-
warn!("is_resizable is unimplemented on web");
382-
true
383-
}
384-
385380
pub fn show_titlebar(&mut self, _show_titlebar: bool) {
386381
// Ignored
387382
}
388383

389-
pub fn has_titlebar(&self) -> bool {
390-
warn!("has_titlebar is unimplemented on web");
391-
true
392-
}
393-
394384
pub fn set_transparent(&mut self, _transparent: bool) {
395385
// Ignored
396386
}
397387

398-
pub fn is_transparent(&self) -> bool {
399-
warn!("is_transparent is unimplemented on web");
400-
true
401-
}
402-
403388
pub fn set_position(&mut self, _position: Point) {
404389
// Ignored
405390
}
@@ -493,13 +478,27 @@ impl WindowHandle {
493478
}
494479

495480
pub fn resizable(&self, _resizable: bool) {
496-
warn!("resizable unimplemented for web");
481+
warn!("WindowHandle::resizable unimplemented for web");
482+
}
483+
484+
pub fn is_resizable(&self) -> bool {
485+
warn!("WindowHandle::is_resizable is unimplemented on web");
486+
true
497487
}
498488

499489
pub fn show_titlebar(&self, _show_titlebar: bool) {
500-
warn!("show_titlebar unimplemented for web");
490+
warn!("WindowHandle::show_titlebar unimplemented for web");
501491
}
502492

493+
pub fn has_titlebar(&self) -> bool {
494+
warn!("WindowHandle::has_titlebar is unimplemented on web");
495+
true
496+
}
497+
498+
pub fn is_transparent(&self) -> bool {
499+
warn!("WindowHandle::is_transparent is unimplemented on web");
500+
true
501+
}
503502
pub fn set_position(&self, _position: Point) {
504503
warn!("WindowHandle::set_position unimplemented for web");
505504
}

0 commit comments

Comments
 (0)