summaryrefslogtreecommitdiffstats
path: root/style
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 17:04:44 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 17:04:44 +0700
commit89d50c0243fcb70442c78bbff207d0328b33e158 (patch)
treea44d2c69b246ea6fcf632040d25da84f5048b80f /style
parent40a5de581144886571504b762719f057dbb2e871 (diff)
downloadiced-89d50c0243fcb70442c78bbff207d0328b33e158.tar.gz
iced-89d50c0243fcb70442c78bbff207d0328b33e158.tar.bz2
iced-89d50c0243fcb70442c78bbff207d0328b33e158.zip
Reintroduce `Box` for `style_sheet` in `PaneGrid`
Diffstat (limited to 'style')
-rw-r--r--style/src/pane_grid.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/style/src/pane_grid.rs b/style/src/pane_grid.rs
index 032fcb6d..89cf39ea 100644
--- a/style/src/pane_grid.rs
+++ b/style/src/pane_grid.rs
@@ -35,8 +35,17 @@ impl StyleSheet for Default {
}
}
-impl std::default::Default for &'static dyn StyleSheet {
+impl std::default::Default for Box<dyn StyleSheet> {
fn default() -> Self {
- &Default
+ Box::new(Default)
+ }
+}
+
+impl<'a, T> From<T> for Box<dyn StyleSheet + 'a>
+where
+ T: StyleSheet + 'a,
+{
+ fn from(style_sheet: T) -> Self {
+ Box::new(style_sheet)
}
}