mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-20 02:47:34 +03:00
Use filled button style for role indicator in assistant panel
This fixes the left side of the button getting clipped on hover.
This commit is contained in:
parent
58664206cf
commit
42bd9ffa7e
@ -2298,6 +2298,7 @@ impl ConversationEditor {
|
|||||||
move |_cx| {
|
move |_cx| {
|
||||||
let message_id = message.id;
|
let message_id = message.id;
|
||||||
let sender = ButtonLike::new("role")
|
let sender = ButtonLike::new("role")
|
||||||
|
.style(ButtonStyle::Filled)
|
||||||
.child(match message.role {
|
.child(match message.role {
|
||||||
Role::User => Label::new("You").color(Color::Default),
|
Role::User => Label::new("You").color(Color::Default),
|
||||||
Role::Assistant => Label::new("Assistant").color(Color::Info),
|
Role::Assistant => Label::new("Assistant").color(Color::Info),
|
||||||
@ -2329,10 +2330,7 @@ impl ConversationEditor {
|
|||||||
.h_11()
|
.h_11()
|
||||||
.relative()
|
.relative()
|
||||||
.gap_1()
|
.gap_1()
|
||||||
// Sender is a button with a padding of 1, but only has a background on hover,
|
.child(sender)
|
||||||
// so we shift it left by the same amount to align the text with the content
|
|
||||||
// in the un-hovered state.
|
|
||||||
.child(div().child(sender).relative().neg_left_1())
|
|
||||||
// TODO: Only show this if the message if the message has been sent
|
// TODO: Only show this if the message if the message has been sent
|
||||||
.child(
|
.child(
|
||||||
Label::new(
|
Label::new(
|
||||||
|
Loading…
Reference in New Issue
Block a user