Column shell: glass grounds the columns in the palette's glass, so a blurred window shows through them
This commit is contained in:
1 file changed
+14
-1
+14
-1
@@ -73,6 +73,7 @@ pub struct ColumnShell {
|
|||||||
platform: Option<Platform>,
|
platform: Option<Platform>,
|
||||||
on_close: Option<OnClose>,
|
on_close: Option<OnClose>,
|
||||||
columns: Vec<ShellColumn>,
|
columns: Vec<ShellColumn>,
|
||||||
|
glass: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ColumnShell {
|
impl ColumnShell {
|
||||||
@@ -83,6 +84,7 @@ impl ColumnShell {
|
|||||||
platform: None,
|
platform: None,
|
||||||
on_close: None,
|
on_close: None,
|
||||||
columns: Vec::new(),
|
columns: Vec::new(),
|
||||||
|
glass: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,6 +104,12 @@ impl ColumnShell {
|
|||||||
self.on_close = Some(Rc::new(handler));
|
self.on_close = Some(Rc::new(handler));
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Grounds the columns in the palette's glass, so a blurred window shows through them.
|
||||||
|
pub fn glass(mut self) -> Self {
|
||||||
|
self.glass = true;
|
||||||
|
self
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderOnce for ColumnShell {
|
impl RenderOnce for ColumnShell {
|
||||||
@@ -175,11 +183,16 @@ impl RenderOnce for ColumnShell {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
let theme = cx.theme();
|
let theme = cx.theme();
|
||||||
|
let ground = if self.glass {
|
||||||
|
theme.colors.glass
|
||||||
|
} else {
|
||||||
|
theme.colors.bg
|
||||||
|
};
|
||||||
div()
|
div()
|
||||||
.flex()
|
.flex()
|
||||||
.h_full()
|
.h_full()
|
||||||
.debug_selector(|| "column-shell".into())
|
.debug_selector(|| "column-shell".into())
|
||||||
.bg(theme.colors.bg)
|
.bg(ground)
|
||||||
.text_color(theme.colors.fg)
|
.text_color(theme.colors.fg)
|
||||||
.children(columns)
|
.children(columns)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user