Refine the multibuffer hint design (#25167)
Just a little touch-up here.  Release Notes: - N/A
This commit is contained in:
parent
c34b14ae7d
commit
2d1a028de5
1 changed files with 23 additions and 14 deletions
|
@ -4,7 +4,7 @@ use std::sync::OnceLock;
|
||||||
|
|
||||||
use db::kvp::KEY_VALUE_STORE;
|
use db::kvp::KEY_VALUE_STORE;
|
||||||
use gpui::{App, EntityId, EventEmitter, Subscription};
|
use gpui::{App, EntityId, EventEmitter, Subscription};
|
||||||
use ui::{prelude::*, ButtonLike, IconButtonShape, Tooltip};
|
use ui::{prelude::*, IconButtonShape, Tooltip};
|
||||||
use workspace::item::{ItemEvent, ItemHandle};
|
use workspace::item::{ItemEvent, ItemHandle};
|
||||||
use workspace::{ToolbarItemEvent, ToolbarItemLocation, ToolbarItemView};
|
use workspace::{ToolbarItemEvent, ToolbarItemLocation, ToolbarItemView};
|
||||||
|
|
||||||
|
@ -133,24 +133,34 @@ impl Render for MultibufferHint {
|
||||||
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||||
h_flex()
|
h_flex()
|
||||||
.px_2()
|
.px_2()
|
||||||
|
.py_0p5()
|
||||||
.justify_between()
|
.justify_between()
|
||||||
.bg(cx.theme().status().info_background)
|
.bg(cx.theme().status().info_background.opacity(0.5))
|
||||||
|
.border_1()
|
||||||
|
.border_color(cx.theme().colors().border_variant)
|
||||||
.rounded_md()
|
.rounded_md()
|
||||||
|
.overflow_hidden()
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.gap_2()
|
.gap_0p5()
|
||||||
.child(Label::new(
|
|
||||||
"Edit and save files directly in the results multibuffer!",
|
|
||||||
))
|
|
||||||
.child(
|
.child(
|
||||||
ButtonLike::new("open_docs")
|
h_flex()
|
||||||
.style(ButtonStyle::Transparent)
|
.gap_2()
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
Icon::new(IconName::Info)
|
||||||
.gap_1()
|
.size(IconSize::XSmall)
|
||||||
.child(Label::new("Read more…"))
|
.color(Color::Muted),
|
||||||
.child(Icon::new(IconName::ArrowUpRight).size(IconSize::Small)),
|
|
||||||
)
|
)
|
||||||
|
.child(Label::new(
|
||||||
|
"Edit and save files directly in the results multibuffer!",
|
||||||
|
)),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
Button::new("open_docs", "Learn More")
|
||||||
|
.icon(IconName::ArrowUpRight)
|
||||||
|
.icon_size(IconSize::XSmall)
|
||||||
|
.icon_color(Color::Muted)
|
||||||
|
.icon_position(IconPosition::End)
|
||||||
.on_click(move |_event, _, cx| {
|
.on_click(move |_event, _, cx| {
|
||||||
cx.open_url("https://zed.dev/docs/multibuffers")
|
cx.open_url("https://zed.dev/docs/multibuffers")
|
||||||
}),
|
}),
|
||||||
|
@ -158,7 +168,6 @@ impl Render for MultibufferHint {
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
IconButton::new("dismiss", IconName::Close)
|
IconButton::new("dismiss", IconName::Close)
|
||||||
.style(ButtonStyle::Transparent)
|
|
||||||
.shape(IconButtonShape::Square)
|
.shape(IconButtonShape::Square)
|
||||||
.icon_size(IconSize::Small)
|
.icon_size(IconSize::Small)
|
||||||
.on_click(cx.listener(|this, _event, _, cx| {
|
.on_click(cx.listener(|this, _event, _, cx| {
|
||||||
|
@ -167,7 +176,7 @@ impl Render for MultibufferHint {
|
||||||
ToolbarItemLocation::Hidden,
|
ToolbarItemLocation::Hidden,
|
||||||
))
|
))
|
||||||
}))
|
}))
|
||||||
.tooltip(Tooltip::text("Dismiss this hint")),
|
.tooltip(Tooltip::text("Dismiss Hint")),
|
||||||
)
|
)
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue