Rename h_stack
and v_stack
to h_flex
and v_flex
, respectively (#4053)
This PR renames the `h_stack` and `v_stack` to `h_flex` and `v_flex`, respectively. We were previously using `h_stack` and `v_stack` to match SwiftUI, but `h_flex` and `v_flex` fit better with the web/flexbox terminology that the rest of GPUI uses. Additionally, we were already calling the utility functions used to implement `h_stack` and `v_stack` by the new names. Release Notes: - N/A
This commit is contained in:
parent
b136d21ebf
commit
90f4c70a82
69 changed files with 271 additions and 271 deletions
|
@ -36,7 +36,7 @@ use std::{
|
|||
};
|
||||
use theme::ActiveTheme;
|
||||
pub use toolbar_controls::ToolbarControls;
|
||||
use ui::{h_stack, prelude::*, Icon, IconName, Label};
|
||||
use ui::{h_flex, prelude::*, Icon, IconName, Label};
|
||||
use util::TryFutureExt;
|
||||
use workspace::{
|
||||
item::{BreadcrumbText, Item, ItemEvent, ItemHandle},
|
||||
|
@ -654,11 +654,11 @@ impl Item for ProjectDiagnosticsEditor {
|
|||
})
|
||||
.into_any_element()
|
||||
} else {
|
||||
h_stack()
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.when(self.summary.error_count > 0, |then| {
|
||||
then.child(
|
||||
h_stack()
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(Icon::new(IconName::XCircle).color(Color::Error))
|
||||
.child(Label::new(self.summary.error_count.to_string()).color(
|
||||
|
@ -672,7 +672,7 @@ impl Item for ProjectDiagnosticsEditor {
|
|||
})
|
||||
.when(self.summary.warning_count > 0, |then| {
|
||||
then.child(
|
||||
h_stack()
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(Icon::new(IconName::ExclamationTriangle).color(Color::Warning))
|
||||
.child(Label::new(self.summary.warning_count.to_string()).color(
|
||||
|
@ -796,7 +796,7 @@ fn diagnostic_header_renderer(diagnostic: Diagnostic) -> RenderBlock {
|
|||
let message: SharedString = message.into();
|
||||
Arc::new(move |cx| {
|
||||
let highlight_style: HighlightStyle = cx.theme().colors().text_accent.into();
|
||||
h_stack()
|
||||
h_flex()
|
||||
.id("diagnostic header")
|
||||
.py_2()
|
||||
.pl_10()
|
||||
|
@ -805,7 +805,7 @@ fn diagnostic_header_renderer(diagnostic: Diagnostic) -> RenderBlock {
|
|||
.justify_between()
|
||||
.gap_2()
|
||||
.child(
|
||||
h_stack()
|
||||
h_flex()
|
||||
.gap_3()
|
||||
.map(|stack| {
|
||||
stack.child(
|
||||
|
@ -824,7 +824,7 @@ fn diagnostic_header_renderer(diagnostic: Diagnostic) -> RenderBlock {
|
|||
)
|
||||
})
|
||||
.child(
|
||||
h_stack()
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
StyledText::new(message.clone()).with_highlights(
|
||||
|
@ -844,7 +844,7 @@ fn diagnostic_header_renderer(diagnostic: Diagnostic) -> RenderBlock {
|
|||
),
|
||||
)
|
||||
.child(
|
||||
h_stack()
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.when_some(diagnostic.source.as_ref(), |stack, source| {
|
||||
stack.child(
|
||||
|
|
|
@ -6,7 +6,7 @@ use gpui::{
|
|||
};
|
||||
use language::Diagnostic;
|
||||
use lsp::LanguageServerId;
|
||||
use ui::{h_stack, prelude::*, Button, ButtonLike, Color, Icon, IconName, Label, Tooltip};
|
||||
use ui::{h_flex, prelude::*, Button, ButtonLike, Color, Icon, IconName, Label, Tooltip};
|
||||
use workspace::{item::ItemHandle, StatusItemView, ToolbarItemEvent, Workspace};
|
||||
|
||||
use crate::{Deploy, ProjectDiagnosticsEditor};
|
||||
|
@ -23,14 +23,14 @@ pub struct DiagnosticIndicator {
|
|||
impl Render for DiagnosticIndicator {
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
||||
let diagnostic_indicator = match (self.summary.error_count, self.summary.warning_count) {
|
||||
(0, 0) => h_stack().map(|this| {
|
||||
(0, 0) => h_flex().map(|this| {
|
||||
this.child(
|
||||
Icon::new(IconName::Check)
|
||||
.size(IconSize::Small)
|
||||
.color(Color::Default),
|
||||
)
|
||||
}),
|
||||
(0, warning_count) => h_stack()
|
||||
(0, warning_count) => h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Icon::new(IconName::ExclamationTriangle)
|
||||
|
@ -38,7 +38,7 @@ impl Render for DiagnosticIndicator {
|
|||
.color(Color::Warning),
|
||||
)
|
||||
.child(Label::new(warning_count.to_string()).size(LabelSize::Small)),
|
||||
(error_count, 0) => h_stack()
|
||||
(error_count, 0) => h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Icon::new(IconName::XCircle)
|
||||
|
@ -46,7 +46,7 @@ impl Render for DiagnosticIndicator {
|
|||
.color(Color::Error),
|
||||
)
|
||||
.child(Label::new(error_count.to_string()).size(LabelSize::Small)),
|
||||
(error_count, warning_count) => h_stack()
|
||||
(error_count, warning_count) => h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Icon::new(IconName::XCircle)
|
||||
|
@ -64,7 +64,7 @@ impl Render for DiagnosticIndicator {
|
|||
|
||||
let status = if !self.in_progress_checks.is_empty() {
|
||||
Some(
|
||||
h_stack()
|
||||
h_flex()
|
||||
.gap_2()
|
||||
.child(Icon::new(IconName::ArrowCircle).size(IconSize::Small))
|
||||
.child(
|
||||
|
@ -91,7 +91,7 @@ impl Render for DiagnosticIndicator {
|
|||
None
|
||||
};
|
||||
|
||||
h_stack()
|
||||
h_flex()
|
||||
.h(rems(1.375))
|
||||
.gap_2()
|
||||
.child(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue