Improve styling of bottom and right docks
This commit is contained in:
parent
208ff2fba7
commit
19b817e48a
3 changed files with 25 additions and 9 deletions
|
@ -402,9 +402,9 @@ pub struct StatusBarLspStatus {
|
||||||
|
|
||||||
#[derive(Deserialize, Default)]
|
#[derive(Deserialize, Default)]
|
||||||
pub struct Dock {
|
pub struct Dock {
|
||||||
pub initial_size: f32,
|
pub left: ContainerStyle,
|
||||||
#[serde(flatten)]
|
pub bottom: ContainerStyle,
|
||||||
pub container: ContainerStyle,
|
pub right: ContainerStyle,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Deserialize, Default)]
|
#[derive(Clone, Deserialize, Default)]
|
||||||
|
|
|
@ -372,11 +372,10 @@ impl Dock {
|
||||||
|
|
||||||
pub fn render_placeholder(&self, cx: &WindowContext) -> AnyElement<Workspace> {
|
pub fn render_placeholder(&self, cx: &WindowContext) -> AnyElement<Workspace> {
|
||||||
if let Some(active_entry) = self.active_entry() {
|
if let Some(active_entry) = self.active_entry() {
|
||||||
let style = &settings::get::<ThemeSettings>(cx).theme.workspace.dock;
|
|
||||||
Empty::new()
|
Empty::new()
|
||||||
.into_any()
|
.into_any()
|
||||||
.contained()
|
.contained()
|
||||||
.with_style(style.container)
|
.with_style(self.style(cx))
|
||||||
.resizable(
|
.resizable(
|
||||||
self.position.to_resize_handle_side(),
|
self.position.to_resize_handle_side(),
|
||||||
active_entry.panel.size(cx),
|
active_entry.panel.size(cx),
|
||||||
|
@ -387,6 +386,16 @@ impl Dock {
|
||||||
Empty::new().into_any()
|
Empty::new().into_any()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn style(&self, cx: &WindowContext) -> ContainerStyle {
|
||||||
|
let theme = &settings::get::<ThemeSettings>(cx).theme;
|
||||||
|
let style = match self.position {
|
||||||
|
DockPosition::Left => theme.workspace.dock.left,
|
||||||
|
DockPosition::Bottom => theme.workspace.dock.bottom,
|
||||||
|
DockPosition::Right => theme.workspace.dock.right,
|
||||||
|
};
|
||||||
|
style
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Entity for Dock {
|
impl Entity for Dock {
|
||||||
|
@ -400,10 +409,10 @@ impl View for Dock {
|
||||||
|
|
||||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> AnyElement<Self> {
|
fn render(&mut self, cx: &mut ViewContext<Self>) -> AnyElement<Self> {
|
||||||
if let Some(active_entry) = self.active_entry() {
|
if let Some(active_entry) = self.active_entry() {
|
||||||
let style = &settings::get::<ThemeSettings>(cx).theme.workspace.dock;
|
let style = self.style(cx);
|
||||||
ChildView::new(active_entry.panel.as_any(), cx)
|
ChildView::new(active_entry.panel.as_any(), cx)
|
||||||
.contained()
|
.contained()
|
||||||
.with_style(style.container)
|
.with_style(style)
|
||||||
.resizable(
|
.resizable(
|
||||||
self.position.to_resize_handle_side(),
|
self.position.to_resize_handle_side(),
|
||||||
active_entry.panel.size(cx),
|
active_entry.panel.size(cx),
|
||||||
|
|
|
@ -128,8 +128,15 @@ export default function workspace(colorScheme: ColorScheme) {
|
||||||
border: border(colorScheme.highest, { overlay: true }),
|
border: border(colorScheme.highest, { overlay: true }),
|
||||||
},
|
},
|
||||||
dock: {
|
dock: {
|
||||||
initialSize: 240,
|
left: {
|
||||||
border: border(layer, { left: true, right: true }),
|
border: border(layer, { right: true }),
|
||||||
|
},
|
||||||
|
bottom: {
|
||||||
|
border: border(layer, { top: true }),
|
||||||
|
},
|
||||||
|
right: {
|
||||||
|
border: border(layer, { left: true }),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
paneDivider: {
|
paneDivider: {
|
||||||
color: borderColor(layer),
|
color: borderColor(layer),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue