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
|
@ -1090,7 +1090,7 @@ fn build_api_key_editor(cx: &mut ViewContext<AssistantPanel>) -> View<Editor> {
|
|||
impl Render for AssistantPanel {
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
||||
if let Some(api_key_editor) = self.api_key_editor.clone() {
|
||||
v_stack()
|
||||
v_flex()
|
||||
.on_action(cx.listener(AssistantPanel::save_credentials))
|
||||
.track_focus(&self.focus_handle)
|
||||
.child(Label::new(
|
||||
|
@ -1115,26 +1115,26 @@ impl Render for AssistantPanel {
|
|||
} else {
|
||||
let header = TabBar::new("assistant_header")
|
||||
.start_child(
|
||||
h_stack().gap_1().child(Self::render_hamburger_button(cx)), // .children(title),
|
||||
h_flex().gap_1().child(Self::render_hamburger_button(cx)), // .children(title),
|
||||
)
|
||||
.children(self.active_editor().map(|editor| {
|
||||
h_stack()
|
||||
h_flex()
|
||||
.h(rems(Tab::HEIGHT_IN_REMS))
|
||||
.flex_1()
|
||||
.px_2()
|
||||
.child(Label::new(editor.read(cx).title(cx)).into_element())
|
||||
}))
|
||||
.end_child(if self.focus_handle.contains_focused(cx) {
|
||||
h_stack()
|
||||
h_flex()
|
||||
.gap_2()
|
||||
.child(h_stack().gap_1().children(self.render_editor_tools(cx)))
|
||||
.child(h_flex().gap_1().children(self.render_editor_tools(cx)))
|
||||
.child(
|
||||
ui::Divider::vertical()
|
||||
.inset()
|
||||
.color(ui::DividerColor::Border),
|
||||
)
|
||||
.child(
|
||||
h_stack()
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(Self::render_plus_button(cx))
|
||||
.child(self.render_zoom_button(cx)),
|
||||
|
@ -1153,7 +1153,7 @@ impl Render for AssistantPanel {
|
|||
} else {
|
||||
div()
|
||||
};
|
||||
v_stack()
|
||||
v_flex()
|
||||
.key_context("AssistantPanel")
|
||||
.size_full()
|
||||
.on_action(cx.listener(|this, _: &workspace::NewFile, cx| {
|
||||
|
@ -2530,7 +2530,7 @@ impl Render for ConversationEditor {
|
|||
.child(self.editor.clone()),
|
||||
)
|
||||
.child(
|
||||
h_stack()
|
||||
h_flex()
|
||||
.absolute()
|
||||
.gap_1()
|
||||
.top_3()
|
||||
|
@ -2616,7 +2616,7 @@ impl EventEmitter<InlineAssistantEvent> for InlineAssistant {}
|
|||
impl Render for InlineAssistant {
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {
|
||||
let measurements = self.measurements.get();
|
||||
h_stack()
|
||||
h_flex()
|
||||
.w_full()
|
||||
.py_2()
|
||||
.border_y_1()
|
||||
|
@ -2628,7 +2628,7 @@ impl Render for InlineAssistant {
|
|||
.on_action(cx.listener(Self::move_up))
|
||||
.on_action(cx.listener(Self::move_down))
|
||||
.child(
|
||||
h_stack()
|
||||
h_flex()
|
||||
.justify_center()
|
||||
.w(measurements.gutter_width)
|
||||
.child(
|
||||
|
@ -2676,7 +2676,7 @@ impl Render for InlineAssistant {
|
|||
}),
|
||||
)
|
||||
.child(
|
||||
h_stack()
|
||||
h_flex()
|
||||
.w_full()
|
||||
.ml(measurements.anchor_x - measurements.gutter_width)
|
||||
.child(self.render_prompt_editor(cx)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue