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>,
|
||||
on_close: Option<OnClose>,
|
||||
columns: Vec<ShellColumn>,
|
||||
glass: bool,
|
||||
}
|
||||
|
||||
impl ColumnShell {
|
||||
@@ -83,6 +84,7 @@ impl ColumnShell {
|
||||
platform: None,
|
||||
on_close: None,
|
||||
columns: Vec::new(),
|
||||
glass: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,6 +104,12 @@ impl ColumnShell {
|
||||
self.on_close = Some(Rc::new(handler));
|
||||
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 {
|
||||
@@ -175,11 +183,16 @@ impl RenderOnce for ColumnShell {
|
||||
);
|
||||
}
|
||||
let theme = cx.theme();
|
||||
let ground = if self.glass {
|
||||
theme.colors.glass
|
||||
} else {
|
||||
theme.colors.bg
|
||||
};
|
||||
div()
|
||||
.flex()
|
||||
.h_full()
|
||||
.debug_selector(|| "column-shell".into())
|
||||
.bg(theme.colors.bg)
|
||||
.bg(ground)
|
||||
.text_color(theme.colors.fg)
|
||||
.children(columns)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user