tiles: Add tile_radius theme option and default 0px. (#1441)
This commit is contained in:
parent
519540eaa7
commit
cc0f936348
3 changed files with 8 additions and 5 deletions
|
|
@ -1,12 +1,12 @@
|
|||
use anyhow::{Context as _, Result};
|
||||
use gpui::*;
|
||||
use gpui_component::{
|
||||
ActiveTheme, Root, Sizable, TitleBar,
|
||||
dock::{
|
||||
register_panel, DockArea, DockAreaState, DockEvent, DockItem, Panel, PanelEvent, PanelInfo,
|
||||
PanelRegistry, PanelState, PanelView,
|
||||
DockArea, DockAreaState, DockEvent, DockItem, Panel, PanelEvent, PanelInfo, PanelRegistry,
|
||||
PanelState, PanelView, register_panel,
|
||||
},
|
||||
input::{InputState, TextInput},
|
||||
ActiveTheme, Root, Sizable, TitleBar,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{sync::Arc, time::Duration};
|
||||
|
|
@ -100,7 +100,7 @@ impl Panel for ContainerPanel {
|
|||
Some(
|
||||
div()
|
||||
.w_24()
|
||||
.h_5()
|
||||
.h_6()
|
||||
.px_0p5()
|
||||
.rounded_lg()
|
||||
.border_1()
|
||||
|
|
|
|||
|
|
@ -890,7 +890,7 @@ impl Tiles {
|
|||
// More 1px to account for the border width when 2 panels are too close
|
||||
.w(item.bounds.size.width + px(1.))
|
||||
.h(item.bounds.size.height + px(1.))
|
||||
.rounded(cx.theme().radius)
|
||||
.rounded(cx.theme().tile_radius)
|
||||
.child(h_flex().overflow_hidden().size_full().child(panel_view))
|
||||
.children(self.render_resize_handles(window, cx, entity_id, &item))
|
||||
.child(self.render_drag_bar(window, cx, entity_id, &item))
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ pub struct Theme {
|
|||
pub tile_grid_size: Pixels,
|
||||
/// The shadow of the tile panel.
|
||||
pub tile_shadow: bool,
|
||||
/// The border radius of the tile panel, default is 0px.
|
||||
pub tile_radius: Pixels,
|
||||
}
|
||||
|
||||
impl Default for Theme {
|
||||
|
|
@ -198,6 +200,7 @@ impl From<ThemeColor> for Theme {
|
|||
scrollbar_show: ScrollbarShow::default(),
|
||||
tile_grid_size: px(8.),
|
||||
tile_shadow: true,
|
||||
tile_radius: px(0.),
|
||||
colors,
|
||||
light_theme: Rc::new(ThemeConfig::default()),
|
||||
dark_theme: Rc::new(ThemeConfig::default()),
|
||||
|
|
|
|||
Loading…
Reference in a new issue