| | @@ -27,8 +27,11 @@ pub const DROP_HEIGHT: f32 = 280.0; |
| 27 | 27 | pub const DROP_RADIUS: u8 = 12; |
| 28 | 28 | pub const ROW: f32 = 32.0; |
| 29 | 29 | pub 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; |
| 32 | 35 | /// 경로와 검색 입력란의 높이. 위쪽 경로 줄은 이 높이만큼만 차지함. |
| 33 | 36 | pub const FIELD: f32 = 36.0; |
| 34 | 37 | /// 테두리 없는 버튼에 마우스를 올리거나 누를 때의 배경. |
| | @@ -65,16 +68,16 @@ pub fn apply(ctx: &egui::Context) { |
| 65 | 68 | ctx.style_mut_of(egui::Theme::Light, |style| { |
| 66 | 69 | style |
| 67 | 70 | .text_styles |
| 68 | | -삭제: .insert(TextStyle::Body, FontId::proportional(BODY)); |
| 71 | +추가: .insert(TextStyle::Body, FontId::proportional(FONT_BODY)); |
| 69 | 72 | style |
| 70 | 73 | .text_styles |
| 71 | | -삭제: .insert(TextStyle::Button, FontId::proportional(BODY)); |
| 74 | +추가: .insert(TextStyle::Button, FontId::proportional(FONT_BODY)); |
| 72 | 75 | style |
| 73 | 76 | .text_styles |
| 74 | | -삭제: .insert(TextStyle::Small, FontId::proportional(BODY)); |
| 77 | +추가: .insert(TextStyle::Small, FontId::proportional(FONT_SMALL)); |
| 75 | 78 | style |
| 76 | 79 | .text_styles |
| 77 | | -삭제: .insert(TextStyle::Heading, FontId::proportional(TITLE)); |
| 80 | +추가: .insert(TextStyle::Heading, FontId::proportional(FONT_LARGE)); |
| 78 | 81 | style.visuals.override_text_color = Some(TEXT); |
| 79 | 82 | style.visuals.panel_fill = BACKGROUND; |
| 80 | 83 | style.visuals.window_fill = PANEL; |
| | @@ -180,8 +183,11 @@ pub fn status_text( |
| 180 | 183 | width: f32, |
| 181 | 184 | align: egui::Align, |
| 182 | 185 | ) { |
| 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 | +추가: ); |
| 185 | 191 | job.wrap = egui::text::TextWrapping { |
| 186 | 192 | max_width: width.max(0.0), |
| 187 | 193 | max_rows: 1, |
| | @@ -309,8 +315,11 @@ pub fn bounded_text_hover( |
| 309 | 315 | } |
| 310 | 316 | |
| 311 | 317 | pub 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 | +추가: ); |
| 314 | 323 | job.wrap = egui::text::TextWrapping { |
| 315 | 324 | max_width: width.max(0.0), |
| 316 | 325 | max_rows: 1, |
| | @@ -350,7 +359,7 @@ pub fn action_pair( |
| 350 | 359 | ) -> (bool, bool) { |
| 351 | 360 | let text_width = |text: &str| { |
| 352 | 361 | ui.painter() |
| 353 | | -삭제: .layout_no_wrap(text.into(), FontId::proportional(BODY), TEXT) |
| 362 | +추가: .layout_no_wrap(text.into(), FontId::proportional(FONT_BODY), TEXT) |
| 354 | 363 | .size() |
| 355 | 364 | .x |
| 356 | 365 | }; |
| | @@ -427,10 +436,10 @@ pub fn svg_icon(painter: &egui::Painter, rect: egui::Rect, asset: &str, color: C |
| 427 | 436 | } |
| 428 | 437 | } |
| 429 | 438 | |
| 430 | | -삭제: /// 가장 긴 이름(압축해제, 15px에서 약 52px) 양옆에 10px씩 남는 폭. |
| 439 | +추가: /// 가장 긴 이름(압축해제, FONT_SMALL에서 약 48px) 양옆에 12px씩 남는 폭. |
| 431 | 440 | pub const TOOL_SIZE: egui::Vec2 = egui::vec2(72.0, 68.0); |
| 432 | 441 | const TOOL_ICON: f32 = 30.0; |
| 433 | | -삭제: const TOOL_LABEL: f32 = 15.0; |
| 442 | +추가: const TOOL_LABEL: f32 = FONT_SMALL; |
| 434 | 443 | |
| 435 | 444 | pub fn tool( |
| 436 | 445 | ui: &mut egui::Ui, |