Add title to assistant panel and move + to right
This commit is contained in:
parent
a011ced698
commit
d78fbbc63e
3 changed files with 19 additions and 2 deletions
|
@ -418,13 +418,25 @@ impl View for AssistantPanel {
|
||||||
.aligned()
|
.aligned()
|
||||||
.into_any()
|
.into_any()
|
||||||
} else {
|
} else {
|
||||||
|
let title = self.active_conversation_editor().map(|editor| {
|
||||||
|
Label::new(editor.read(cx).title(cx), style.title.text.clone())
|
||||||
|
.contained()
|
||||||
|
.with_style(style.title.container)
|
||||||
|
.aligned()
|
||||||
|
});
|
||||||
|
|
||||||
Flex::column()
|
Flex::column()
|
||||||
.with_child(
|
.with_child(
|
||||||
Flex::row()
|
Flex::row()
|
||||||
.with_child(
|
.with_child(
|
||||||
Self::render_hamburger_button(&style.hamburger_button).aligned(),
|
Self::render_hamburger_button(&style.hamburger_button).aligned(),
|
||||||
)
|
)
|
||||||
.with_child(Self::render_plus_button(&style.plus_button).aligned())
|
.with_children(title)
|
||||||
|
.with_child(
|
||||||
|
Self::render_plus_button(&style.plus_button)
|
||||||
|
.aligned()
|
||||||
|
.flex_float(),
|
||||||
|
)
|
||||||
.contained()
|
.contained()
|
||||||
.with_style(theme.workspace.tab_bar.container)
|
.with_style(theme.workspace.tab_bar.container)
|
||||||
.expanded()
|
.expanded()
|
||||||
|
|
|
@ -996,6 +996,7 @@ pub struct AssistantStyle {
|
||||||
pub container: ContainerStyle,
|
pub container: ContainerStyle,
|
||||||
pub hamburger_button: IconStyle,
|
pub hamburger_button: IconStyle,
|
||||||
pub plus_button: IconStyle,
|
pub plus_button: IconStyle,
|
||||||
|
pub title: ContainedText,
|
||||||
pub message_header: ContainerStyle,
|
pub message_header: ContainerStyle,
|
||||||
pub sent_at: ContainedText,
|
pub sent_at: ContainedText,
|
||||||
pub user_sender: Interactive<ContainedText>,
|
pub user_sender: Interactive<ContainedText>,
|
||||||
|
|
|
@ -37,9 +37,13 @@ export default function assistant(colorScheme: ColorScheme) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
container: {
|
container: {
|
||||||
margin: { left: 8 },
|
margin: { right: 8 },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
title: {
|
||||||
|
margin: { left: 8 },
|
||||||
|
...text(layer, "sans", "default", { size: "sm" })
|
||||||
|
},
|
||||||
savedConversation: {
|
savedConversation: {
|
||||||
background: background(layer, "on"),
|
background: background(layer, "on"),
|
||||||
hover: {
|
hover: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue