team-ljyzipelo

공개

글자 크기를 16px 기준 세 단계 상수로 통일함

FONT_SMALL 14, FONT_BODY 16, FONT_LARGE 20을 두고 모든 글자가 이 중
하나를 쓰게 함. 본문·버튼 17→16, 제목 22→20, 도구 이름과 제목 표시줄
15→14, 빈 화면 안내 20→20, ZIP 만들기 끌어 놓기 안내 18→16.
TextStyle::Small도 본문과 같던 값을 14로 바로잡음. 도구 이름이 작아져
아래 여백을 다시 맞춤 (보이는 여백 위아래 13px).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
작성자
LeeJunyoung
작성 시각
커밋
a6cb40659d2e8c5741c24ed6fb3f9e75f2fbd0c2
부모
366976d
이 시점의 파일 보기

변경된 파일 3개

+28-19
수정experiments/rust-ui-memory-app/src/archive_screen.rs+5-5
@@ -618,9 +618,9 @@ impl ArchiveApp {
618618 left: 12,
619619 right: 12,
620620 top: 6,
621삭제: // 이름 글자 줄 높이 아래에 남는 빈 공간(약 5px)만큼 줄여
622삭제: // 아이콘 위와 글자 아래의 보이는 여백을 같게 맞춤.
623삭제: bottom: 1,
621추가: // 이름 글자 줄 높이 아래에 남는 빈 공간만큼 줄여 아이콘 위와
622추가: // 글자 아래의 보이는 여백을 같게 맞춤 (FONT_SMALL에서 13px씩).
623추가: bottom: 3,
624624 }),
625625 )
626626 .show(root, |ui| {
@@ -749,7 +749,7 @@ impl ArchiveApp {
749749 } else {
750750 "압축파일을 여기에 끌어 놓으세요"
751751 })
752삭제: .size(20.0)
752추가: .size(theme::FONT_LARGE)
753753 .strong(),
754754 );
755755 ui.label("또는");
@@ -1804,7 +1804,7 @@ impl ArchiveApp {
18041804 ui.add_space(16.0);
18051805 ui.label(
18061806 RichText::new("파일이나 폴더를 여기에 끌어 놓으세요")
1807삭제: .size(18.0),
1807추가: .size(theme::FONT_BODY),
18081808 );
18091809 });
18101810 })
수정experiments/rust-ui-memory-app/src/archive_theme.rs+22-13
@@ -27,8 +27,11 @@ pub const DROP_HEIGHT: f32 = 280.0;
2727pub const DROP_RADIUS: u8 = 12;
2828pub const ROW: f32 = 32.0;
2929pub const BUTTON: f32 = 40.0;
30삭제: pub const BODY: f32 = 17.0;
31삭제: pub const TITLE: f32 = 22.0;
30추가: /// 글자 크기 단계. 앱의 모든 글자는 이 세 값 중 하나를 씀.
31추가: /// 기본 16px을 기준으로 보조 글자는 작게, 제목과 강조 글자는 크게 씀.
32추가: pub const FONT_SMALL: f32 = 14.0;
33추가: pub const FONT_BODY: f32 = 16.0;
34추가: pub const FONT_LARGE: f32 = 20.0;
3235/// 경로와 검색 입력란의 높이. 위쪽 경로 줄은 이 높이만큼만 차지함.
3336pub const FIELD: f32 = 36.0;
3437/// 테두리 없는 버튼에 마우스를 올리거나 누를 때의 배경.
@@ -65,16 +68,16 @@ pub fn apply(ctx: &egui::Context) {
6568 ctx.style_mut_of(egui::Theme::Light, |style| {
6669 style
6770 .text_styles
68삭제: .insert(TextStyle::Body, FontId::proportional(BODY));
71추가: .insert(TextStyle::Body, FontId::proportional(FONT_BODY));
6972 style
7073 .text_styles
71삭제: .insert(TextStyle::Button, FontId::proportional(BODY));
74추가: .insert(TextStyle::Button, FontId::proportional(FONT_BODY));
7275 style
7376 .text_styles
74삭제: .insert(TextStyle::Small, FontId::proportional(BODY));
77추가: .insert(TextStyle::Small, FontId::proportional(FONT_SMALL));
7578 style
7679 .text_styles
77삭제: .insert(TextStyle::Heading, FontId::proportional(TITLE));
80추가: .insert(TextStyle::Heading, FontId::proportional(FONT_LARGE));
7881 style.visuals.override_text_color = Some(TEXT);
7982 style.visuals.panel_fill = BACKGROUND;
8083 style.visuals.window_fill = PANEL;
@@ -180,8 +183,11 @@ pub fn status_text(
180183 width: f32,
181184 align: egui::Align,
182185) {
183삭제: let mut job =
184삭제: egui::text::LayoutJob::simple_singleline(text.into(), FontId::proportional(BODY), TEXT);
186추가: let mut job = egui::text::LayoutJob::simple_singleline(
187추가: text.into(),
188추가: FontId::proportional(FONT_BODY),
189추가: TEXT,
190추가: );
185191 job.wrap = egui::text::TextWrapping {
186192 max_width: width.max(0.0),
187193 max_rows: 1,
@@ -309,8 +315,11 @@ pub fn bounded_text_hover(
309315}
310316
311317pub fn window_title(ui: &egui::Ui, text: &str, width: f32) -> String {
312삭제: let mut job =
313삭제: egui::text::LayoutJob::simple_singleline(text.into(), FontId::proportional(BODY), TEXT);
318추가: let mut job = egui::text::LayoutJob::simple_singleline(
319추가: text.into(),
320추가: FontId::proportional(FONT_BODY),
321추가: TEXT,
322추가: );
314323 job.wrap = egui::text::TextWrapping {
315324 max_width: width.max(0.0),
316325 max_rows: 1,
@@ -350,7 +359,7 @@ pub fn action_pair(
350359) -> (bool, bool) {
351360 let text_width = |text: &str| {
352361 ui.painter()
353삭제: .layout_no_wrap(text.into(), FontId::proportional(BODY), TEXT)
362추가: .layout_no_wrap(text.into(), FontId::proportional(FONT_BODY), TEXT)
354363 .size()
355364 .x
356365 };
@@ -427,10 +436,10 @@ pub fn svg_icon(painter: &egui::Painter, rect: egui::Rect, asset: &str, color: C
427436 }
428437}
429438
430삭제: /// 가장 긴 이름(압축해제, 15px에서 약 52px) 양옆에 10px씩 남는 폭.
439추가: /// 가장 긴 이름(압축해제, FONT_SMALL에서 약 48px) 양옆에 12px씩 남는 폭.
431440pub const TOOL_SIZE: egui::Vec2 = egui::vec2(72.0, 68.0);
432441const TOOL_ICON: f32 = 30.0;
433삭제: const TOOL_LABEL: f32 = 15.0;
442추가: const TOOL_LABEL: f32 = FONT_SMALL;
434443
435444pub fn tool(
436445 ui: &mut egui::Ui,
수정experiments/rust-ui-memory-app/src/window_frame.rs+1-1
@@ -95,7 +95,7 @@ pub fn title_bar(root: &mut egui::Ui, id: &str, title: &str, buttons: Buttons) -
9595 // 버튼 영역을 피해 가운데에 제목을 그림.
9696 let reserved = rect.right() - right;
9797 let width = (rect.width() - 2.0 * reserved).max(0.0);
98삭제: let font = FontId::proportional(theme::BODY - 2.0);
98추가: let font = FontId::proportional(theme::FONT_SMALL);
9999 let text = fit(ui, title, &font, width);
100100 ui.painter().text(
101101 rect.center(),