This commit is contained in:
zumbalogy 2025-08-22 02:45:02 -04:00
parent 8be12051f9
commit bae3ed8522
7 changed files with 109 additions and 117 deletions

View file

@ -6,8 +6,8 @@ use settings::{Settings, SettingsSources};
use std::{fmt::Write, num::NonZeroU32, time::Duration}; use std::{fmt::Write, num::NonZeroU32, time::Duration};
use text::{Point, Selection}; use text::{Point, Selection};
use ui::{ use ui::{
Button, ButtonCommon, Clickable, Context, DynamicSpacing, FluentBuilder, IntoElement, LabelSize, ParentElement, Button, ButtonCommon, Clickable, Context, DynamicSpacing, FluentBuilder, IntoElement,
Render, Tooltip, Window, div, LabelSize, ParentElement, Render, Tooltip, Window, div,
}; };
use util::paths::FILE_ROW_COLUMN_DELIMITER; use util::paths::FILE_ROW_COLUMN_DELIMITER;
use workspace::{StatusItemView, Workspace, item::ItemHandle}; use workspace::{StatusItemView, Workspace, item::ItemHandle};
@ -223,9 +223,7 @@ impl Render for CursorPosition {
let context = self.context.clone(); let context = self.context.clone();
el el.py(DynamicSpacing::Base04.rems(cx)).child(
.py(DynamicSpacing::Base04.rems(cx))
.child(
Button::new("go-to-line-column", text) Button::new("go-to-line-column", text)
.label_size(LabelSize::Small) .label_size(LabelSize::Small)
.on_click(cx.listener(|this, _, window, cx| { .on_click(cx.listener(|this, _, window, cx| {

View file

@ -77,9 +77,7 @@ impl Render for ImageInfo {
.to_string(), .to_string(),
); );
div() div().py(DynamicSpacing::Base04.rems(cx)).child(
.py(DynamicSpacing::Base04.rems(cx))
.child(
Button::new("image-metadata", components.join("")).label_size(LabelSize::Small), Button::new("image-metadata", components.join("")).label_size(LabelSize::Small),
) )
} }

View file

@ -1,6 +1,7 @@
use editor::{Editor, EditorSettings}; use editor::{Editor, EditorSettings};
use gpui::{ use gpui::{
Context, Entity, IntoElement, ParentElement, Render, Styled, Subscription, WeakEntity, Window, div, Context, Entity, IntoElement, ParentElement, Render, Styled, Subscription, WeakEntity, Window,
div,
}; };
use language::LanguageName; use language::LanguageName;
use settings::Settings as _; use settings::Settings as _;
@ -54,9 +55,7 @@ impl Render for ActiveBufferLanguage {
"Unknown".to_string() "Unknown".to_string()
}; };
el el.py(DynamicSpacing::Base04.rems(cx)).child(
.py(DynamicSpacing::Base04.rems(cx))
.child(
Button::new("change-language", active_language_text) Button::new("change-language", active_language_text)
.label_size(LabelSize::Small) .label_size(LabelSize::Small)
.on_click(cx.listener(|this, _, window, cx| { .on_click(cx.listener(|this, _, window, cx| {

View file

@ -1007,9 +1007,7 @@ impl Render for LspTool {
let lsp_tool = cx.entity(); let lsp_tool = cx.entity();
div() div().py(DynamicSpacing::Base04.rems(cx)).child(
.py(DynamicSpacing::Base04.rems(cx))
.child(
PopoverMenu::new("lsp-tool") PopoverMenu::new("lsp-tool")
.menu(move |_, cx| lsp_tool.read(cx).lsp_menu.clone()) .menu(move |_, cx| lsp_tool.read(cx).lsp_menu.clone())
.anchor(Corner::BottomLeft) .anchor(Corner::BottomLeft)

View file

@ -21,9 +21,7 @@ impl Render for SearchButton {
return button.w_0().invisible(); return button.w_0().invisible();
} }
button button.py(DynamicSpacing::Base04.rems(cx)).child(
.py(DynamicSpacing::Base04.rems(cx))
.child(
IconButton::new("project-search-indicator", SEARCH_ICON) IconButton::new("project-search-indicator", SEARCH_ICON)
.icon_size(IconSize::Small) .icon_size(IconSize::Small)
.tooltip(|window, cx| { .tooltip(|window, cx| {

View file

@ -2,12 +2,15 @@ use std::{path::Path, sync::Arc};
use editor::Editor; use editor::Editor;
use gpui::{ use gpui::{
AsyncWindowContext, Context, Entity, IntoElement, ParentElement, Render, Styled, Subscription, Task, AsyncWindowContext, Context, Entity, IntoElement, ParentElement, Render, Styled, Subscription,
WeakEntity, Window, div, Task, WeakEntity, Window, div,
}; };
use language::{Buffer, BufferEvent, LanguageName, Toolchain}; use language::{Buffer, BufferEvent, LanguageName, Toolchain};
use project::{Project, ProjectPath, WorktreeId, toolchain_store::ToolchainStoreEvent}; use project::{Project, ProjectPath, WorktreeId, toolchain_store::ToolchainStoreEvent};
use ui::{Button, ButtonCommon, Clickable, DynamicSpacing, FluentBuilder, LabelSize, SharedString, Tooltip}; use ui::{
Button, ButtonCommon, Clickable, DynamicSpacing, FluentBuilder, LabelSize, SharedString,
Tooltip,
};
use util::maybe; use util::maybe;
use workspace::{StatusItemView, Workspace, item::ItemHandle}; use workspace::{StatusItemView, Workspace, item::ItemHandle};
@ -219,9 +222,7 @@ impl Render for ActiveToolchain {
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 {
div().when_some(self.active_toolchain.as_ref(), |el, active_toolchain| { div().when_some(self.active_toolchain.as_ref(), |el, active_toolchain| {
let term = self.term.clone(); let term = self.term.clone();
el el.py(DynamicSpacing::Base04.rems(cx)).child(
.py(DynamicSpacing::Base04.rems(cx))
.child(
Button::new("change-toolchain", active_toolchain.name.clone()) Button::new("change-toolchain", active_toolchain.name.clone())
.label_size(LabelSize::Small) .label_size(LabelSize::Small)
.on_click(cx.listener(|this, _, window, cx| { .on_click(cx.listener(|this, _, window, cx| {

View file

@ -116,7 +116,7 @@ impl Render for ModeIndicator {
Label::new(label) Label::new(label)
.size(LabelSize::Small) .size(LabelSize::Small)
.line_height_style(LineHeightStyle::UiLabel) .line_height_style(LineHeightStyle::UiLabel)
.into_any_element() .into_any_element(),
) )
.into_any_element() .into_any_element()
} }