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:
@@ -99,8 +99,8 @@ use sum_tree::TreeMap;
|
||||
use text::{OffsetUtf16, Rope};
|
||||
use theme::{ActiveTheme, PlayerColor, StatusColors, SyntaxTheme, ThemeColors, ThemeSettings};
|
||||
use ui::{
|
||||
h_stack, prelude::*, ButtonSize, ButtonStyle, IconButton, IconName, IconSize, ListItem,
|
||||
Popover, Tooltip,
|
||||
h_flex, prelude::*, ButtonSize, ButtonStyle, IconButton, IconName, IconSize, ListItem, Popover,
|
||||
Tooltip,
|
||||
};
|
||||
use util::{post_inc, RangeExt, ResultExt, TryFutureExt};
|
||||
use workspace::{searchable::SearchEvent, ItemNavHistory, Pane, SplitDirection, ViewId, Workspace};
|
||||
@@ -1264,7 +1264,7 @@ impl CompletionsMenu {
|
||||
None
|
||||
} else {
|
||||
Some(
|
||||
h_stack().ml_4().child(
|
||||
h_flex().ml_4().child(
|
||||
Label::new(text.clone())
|
||||
.size(LabelSize::Small)
|
||||
.color(Color::Muted),
|
||||
@@ -1290,7 +1290,7 @@ impl CompletionsMenu {
|
||||
)
|
||||
.map(|task| task.detach_and_log_err(cx));
|
||||
}))
|
||||
.child(h_stack().overflow_hidden().child(completion_label))
|
||||
.child(h_flex().overflow_hidden().child(completion_label))
|
||||
.end_slot::<Div>(documentation_label),
|
||||
)
|
||||
})
|
||||
@@ -9747,7 +9747,7 @@ pub fn diagnostic_block_renderer(diagnostic: Diagnostic, _is_valid: bool) -> Ren
|
||||
let group_id: SharedString = cx.block_id.to_string().into();
|
||||
// TODO: Nate: We should tint the background of the block with the severity color
|
||||
// We need to extend the theme before we can do this
|
||||
h_stack()
|
||||
h_flex()
|
||||
.id(cx.block_id)
|
||||
.group(group_id.clone())
|
||||
.relative()
|
||||
|
||||
@@ -53,7 +53,7 @@ use std::{
|
||||
use sum_tree::Bias;
|
||||
use theme::{ActiveTheme, PlayerColor};
|
||||
use ui::prelude::*;
|
||||
use ui::{h_stack, ButtonLike, ButtonStyle, IconButton, Tooltip};
|
||||
use ui::{h_flex, ButtonLike, ButtonStyle, IconButton, Tooltip};
|
||||
use util::ResultExt;
|
||||
use workspace::item::Item;
|
||||
|
||||
@@ -2293,7 +2293,7 @@ impl EditorElement {
|
||||
.size_full()
|
||||
.p_1p5()
|
||||
.child(
|
||||
h_stack()
|
||||
h_flex()
|
||||
.id("path header block")
|
||||
.py_1p5()
|
||||
.pl_3()
|
||||
@@ -2306,8 +2306,8 @@ impl EditorElement {
|
||||
.justify_between()
|
||||
.hover(|style| style.bg(cx.theme().colors().element_hover))
|
||||
.child(
|
||||
h_stack().gap_3().child(
|
||||
h_stack()
|
||||
h_flex().gap_3().child(
|
||||
h_flex()
|
||||
.gap_2()
|
||||
.child(
|
||||
filename
|
||||
@@ -2339,12 +2339,12 @@ impl EditorElement {
|
||||
}),
|
||||
)
|
||||
} else {
|
||||
h_stack()
|
||||
h_flex()
|
||||
.id(("collapsed context", block_id))
|
||||
.size_full()
|
||||
.gap(gutter_padding)
|
||||
.child(
|
||||
h_stack()
|
||||
h_flex()
|
||||
.justify_end()
|
||||
.flex_none()
|
||||
.w(gutter_width - gutter_padding)
|
||||
|
||||
@@ -32,7 +32,7 @@ use std::{
|
||||
};
|
||||
use text::Selection;
|
||||
use theme::Theme;
|
||||
use ui::{h_stack, prelude::*, Label};
|
||||
use ui::{h_flex, prelude::*, Label};
|
||||
use util::{paths::PathExt, paths::FILE_ROW_COLUMN_DELIMITER, ResultExt, TryFutureExt};
|
||||
use workspace::{
|
||||
item::{BreadcrumbText, FollowEvent, FollowableItemHandle},
|
||||
@@ -619,7 +619,7 @@ impl Item for Editor {
|
||||
Some(util::truncate_and_trailoff(&description, MAX_TAB_TITLE_LEN))
|
||||
});
|
||||
|
||||
h_stack()
|
||||
h_flex()
|
||||
.gap_2()
|
||||
.child(Label::new(self.title(cx).to_string()).color(label_color))
|
||||
.when_some(description, |this, description| {
|
||||
|
||||
Reference in New Issue
Block a user