Apply theme to chat messages

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo
2021-08-24 17:46:41 -06:00
co-authored by Max Brunsfeld
parent 87a103bc52
commit a79b32cfc2
3 changed files with 22 additions and 10 deletions
+3
View File
@@ -22,6 +22,9 @@ color = "$text.2"
[workspace.active_sidebar_icon]
color = "$text.0"
[chat_panel.message]
text = "$text.0"
[selector]
background = "$surface.2"
text = "$text.0"
+7 -10
View File
@@ -116,16 +116,13 @@ impl ChatPanel {
fn render_message(&self, message: &ChannelMessage) -> ElementBox {
let settings = self.settings.borrow();
Flex::column()
.with_child(
Label::new(
message.body.clone(),
settings.ui_font_family,
settings.ui_font_size,
)
.boxed(),
)
.boxed()
Label::new(
message.body.clone(),
settings.ui_font_family,
settings.ui_font_size,
)
.with_style(&settings.theme.chat_panel.message.label)
.boxed()
}
fn render_input_box(&self) -> ElementBox {
+12
View File
@@ -20,6 +20,7 @@ pub struct Theme {
#[serde(default)]
pub name: String,
pub workspace: Workspace,
pub chat_panel: ChatPanel,
pub selector: Selector,
pub editor: Editor,
#[serde(deserialize_with = "deserialize_syntax_theme")]
@@ -52,6 +53,17 @@ pub struct SidebarIcon {
pub color: Color,
}
#[derive(Debug, Default, Deserialize)]
pub struct ChatPanel {
pub message: ChatMessage,
}
#[derive(Debug, Default, Deserialize)]
pub struct ChatMessage {
#[serde(flatten)]
pub label: LabelStyle,
}
#[derive(Debug, Default, Deserialize)]
pub struct Selector {
#[serde(flatten)]