chore: replace pixel metrics with rem-based sizing across ui
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s

This commit is contained in:
2026-11-19 15:47:50 +07:00
parent 5a597f43c4
commit a0f69b6450
74 changed files with 897 additions and 1090 deletions
@@ -14,7 +14,7 @@ use signed_state::{Backend, Mirrors, RepoStore};
use ui::avatar::Avatar;
use ui::button::Button;
use ui::clipboard::ClipboardButton;
use ui::common::{Sizable as _, h_flex, v_flex};
use ui::common::{Sizable as _, StyledExt as _, h_flex, v_flex};
use ui::icons::{Icon, IconRole};
use ui::input::InputState;
use ui::layout::panel::Panel;
@@ -22,7 +22,7 @@ use ui::scroll_area::ScrollArea;
use ui::scrollbar::Scrollbar;
use ui::spinner::Spinner;
use ui::tabs::{Tab, Tabs};
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
use ui::theme::ActiveTheme as _;
use utils::relative_time;
use super::dialogs;
@@ -376,7 +376,7 @@ impl PullRequestDetailView {
.child(
h_flex()
.gap_2()
.typeset(TextRole::Body, cx)
.text_base()
.child(
h_flex()
.gap_1()
@@ -397,9 +397,7 @@ impl PullRequestDetailView {
)
.when(!self.description.is_empty(), |this| {
this.child(
div()
.typeset(TextRole::Body, cx)
.child(self.description.clone()),
div().text_base().child(self.description.clone()),
)
}),
)
@@ -527,7 +525,8 @@ impl PullRequestDetailView {
div()
.flex_1()
.min_w_0()
.typeset(TextRole::Headline, cx)
.text_sm()
.font_semibold()
.text_ellipsis()
.child(title),
),
@@ -574,7 +573,7 @@ impl PullRequestDetailView {
h_flex()
.gap_1()
.font_family(cx.theme().mono_font)
.typeset(TextRole::Caption, cx)
.text_xs()
.text_color(cx.theme().colors.muted_foreground)
.child(id.clone())
.child(ClipboardButton::new("pr-commit", &id)),
@@ -9,7 +9,7 @@ use ui::common::v_flex;
use ui::dialog::{Dialog, DialogHandle};
use ui::field::Field;
use ui::input::{Input, InputState};
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
use ui::theme::ActiveTheme as _;
pub struct UpdatePrDialog {
handle: DialogHandle,
@@ -55,7 +55,7 @@ impl Render for UpdatePrDialog {
.gap_3()
.child(
div()
.typeset(TextRole::Body, cx)
.text_base()
.text_color(cx.theme().colors.muted_foreground)
.child("Publish a new revision with the output of `git format-patch`."),
)
+3 -3
View File
@@ -17,7 +17,7 @@ use ui::layout::panel::Panel;
use ui::menu::MenuItem;
use ui::scrollbar::Scrollbar;
use ui::segmented::{Segmented, SegmentedOption};
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
use ui::theme::ActiveTheme as _;
use utils::relative_time;
mod detail;
@@ -387,7 +387,7 @@ impl Render for PullRequestsView {
.gap_1()
.child(
div()
.typeset(TextRole::Body, cx)
.text_base()
.text_ellipsis()
.whitespace_nowrap()
.child(title),
@@ -395,7 +395,7 @@ impl Render for PullRequestsView {
.child(
h_flex()
.gap_2()
.typeset(TextRole::Caption, cx)
.text_xs()
.child(
h_flex()
.gap_1()
+8 -11
View File
@@ -9,7 +9,7 @@ use gpui::{
use signed_state::{CheckoutsStore, RepoStore};
use ui::button::Button;
use ui::combobox::{Combobox, ComboboxState};
use ui::common::{h_flex, v_flex};
use ui::common::{StyledExt as _, h_flex, v_flex};
use ui::icons::{Icon, IconRole};
use ui::input::{Input, InputState};
use ui::layout::panel::Panel;
@@ -17,7 +17,7 @@ use ui::menu::Menu;
use ui::scrollbar::Scrollbar;
use ui::spinner::Spinner;
use ui::tabs::{Tab, Tabs};
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
use ui::theme::ActiveTheme as _;
use super::helpers::{ForkCompare, fork_display_name, truncate_label};
use crate::repo::commit_diff::{CommitDiffView, DiffPane};
@@ -281,17 +281,17 @@ impl NewPullRequestView {
.child(
v_flex()
.gap_1()
.child(label("Merge Into", cx))
.child(label("Merge Into"))
.child(div().w(px(160.)).child(self.base_select.clone())),
)
.child(
v_flex()
.gap_1()
.child(label("Pull From", cx))
.child(label("Pull From"))
.child(div().w(px(160.)).child(self.compare_select.clone())),
)
.child(
v_flex().gap_1().child(label("Source", cx)).child(
v_flex().gap_1().child(label("Source")).child(
Menu::new("pr-source")
.open(self.source_open)
.on_change(move |open, _, cx| {
@@ -475,7 +475,7 @@ impl Render for NewPullRequestView {
.when_some(self.error.clone(), |this, error| {
this.child(
div()
.typeset(TextRole::Caption, cx)
.text_xs()
.text_color(cx.theme().ramps.destructive.base)
.child(error),
)
@@ -493,9 +493,6 @@ impl Render for NewPullRequestView {
}
}
fn label(text: &'static str, cx: &App) -> AnyElement {
div()
.typeset(TextRole::Caption2, cx)
.child(text)
.into_any_element()
fn label(text: &'static str) -> AnyElement {
div().text_xs().font_medium().child(text).into_any_element()
}
@@ -9,7 +9,7 @@ use ui::common::{h_flex, v_flex};
use ui::icons::{Icon, IconRole};
use ui::input::{Input, InputState};
use ui::layout::panel::Panel;
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
use ui::theme::ActiveTheme as _;
use crate::workspace::Workspace;
@@ -148,7 +148,7 @@ impl Render for SendPatchView {
)
.child(
div()
.typeset(TextRole::Caption, cx)
.text_xs()
.text_color(cx.theme().colors.muted_foreground)
.child(
"You can paste a git diff or a git format-patch patch series here.",
@@ -162,7 +162,7 @@ impl Render for SendPatchView {
.when_some(self.error.clone(), |this, error| {
this.child(
div()
.typeset(TextRole::Caption, cx)
.text_xs()
.text_color(cx.theme().ramps.destructive.base)
.child(error),
)