Round corners in the chat panel's input editor

This commit is contained in:
Antonio Scandurra
2021-09-03 09:49:47 +02:00
parent 522bef2e3a
commit ec36d818c0
4 changed files with 15 additions and 4 deletions

View File

@@ -65,6 +65,11 @@ corner_radius = 6
border = { color = "#000000", width = 1 }
background = "$surface.0"
[chat_panel.input_editor_container]
background = "$surface.1"
corner_radius = 6
padding = 6
[chat_panel.input_editor]
text = "$text.1.color"
placeholder_text = "$text.2.color"

View File

@@ -236,9 +236,14 @@ impl ChatPanel {
}
fn render_input_box(&self) -> ElementBox {
ConstrainedBox::new(ChildView::new(self.input_editor.id()).boxed())
.with_max_height(100.)
.boxed()
let theme = &self.settings.borrow().theme;
Container::new(
ConstrainedBox::new(ChildView::new(self.input_editor.id()).boxed())
.with_max_height(100.)
.boxed(),
)
.with_style(&theme.chat_panel.input_editor_container)
.boxed()
}
fn render_channel_name(

View File

@@ -68,6 +68,7 @@ pub struct ChatPanel {
pub container: ContainerStyle,
pub message: ChatMessage,
pub channel_select: ChannelSelect,
pub input_editor_container: ContainerStyle,
pub input_editor: InputEditorStyle,
}

View File

@@ -37,7 +37,7 @@ impl Sidebar {
side,
items: Default::default(),
active_item_ix: None,
width: Rc::new(RefCell::new(100.)),
width: Rc::new(RefCell::new(200.)),
}
}