team-ljyzipelo

공개

탐색기 상단 줄과 도구 아이콘을 정리하고 애니메이션을 없앰

- 경로 줄 회색 배경이 오른쪽 끝까지 이어지게 하고 위아래 여백을 없앰.
  경로와 검색 입력란을 같은 높이와 위치로 맞추고 8px 간격을 둠.
- "현재 경로" 문구를 없애고 돋보기를 검색란 안쪽 왼쪽에 넣음 (파일 검색).
- 위로 버튼은 아이콘만 남기고, 사용할 수 있을 때만 마우스를 올리면 어두워짐.
- 서서히 나타남, 부드러운 스크롤, 커서 깜빡임, 움직이는 진행 표시를 없앰.
- Pretendard를 기본 글꼴로 쓰고 운영체제 한글 글꼴은 대체 글꼴로만 씀.
- 도구 아이콘 모서리를 둥글게 하고, 압축하기/압축해제를 닫힌/열린 상자로
  새로 그림. 이름 글자를 줄여 아이콘에 붙이고 아래 여백을 둠.
- 상태 줄을 고정 높이로 바꾸고 글자를 세로 가운데에 그림.
- 암호 열을 없애고 암호가 걸린 항목 이름 앞에 *를 붙임. 툴팁은 실제 이름.

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

변경된 파일 10개

+316-144
수정experiments/rust-ui-memory-app/src/archive_screen.rs+113-76
@@ -614,10 +614,16 @@ impl ArchiveApp {
614614 .frame(
615615 theme::panel(theme::PANEL)
616616 .corner_radius(0)
617삭제: .inner_margin(egui::Margin::symmetric(16, 4)),
617추가: .inner_margin(egui::Margin {
618추가: left: 12,
619추가: right: 12,
620추가: top: 6,
621추가: bottom: 10,
622추가: }),
618623 )
619624 .show(root, |ui| {
620625 ui.horizontal(|ui| {
626추가: ui.spacing_mut().item_spacing.x = 4.0;
621627 let idle = !self.model.busy()
622628 && self.model.close == Close::Open
623629 && self.picker.is_none();
@@ -644,37 +650,29 @@ impl ArchiveApp {
644650 });
645651 });
646652 egui::Panel::bottom("archive-status")
653추가: .exact_size(theme::STATUS_HEIGHT)
654추가: .resizable(false)
647655 .frame(
648삭제: theme::panel(theme::STRIPE)
649삭제: .corner_radius(0)
650삭제: .inner_margin(egui::Margin::symmetric(16, 8)),
656추가: egui::Frame::new()
657추가: .fill(theme::STRIPE)
658추가: .inner_margin(egui::Margin::symmetric(16, 0)),
651659 )
652660 .show(root, |ui| {
653삭제: ui.horizontal(|ui| {
654삭제: let width = (ui.available_width() - ui.spacing().item_spacing.x) / 2.0;
655삭제: theme::bounded_text(
656삭제: ui,
657삭제: &format!(
658삭제: "{}개 항목",
659삭제: browser::rows(&self.model.entries, &self.folder, &self.search).len()
660삭제: ),
661삭제: width,
662삭제: );
663삭제: ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
664삭제: theme::bounded_text(
665삭제: ui,
666삭제: &format!(
667삭제: "선택 {}개",
668삭제: browser::rows(&self.model.entries, &self.folder, &self.search)
669삭제: .iter()
670삭제: .filter(|row| !row.ids.is_empty()
671삭제: && row.ids.is_subset(&self.model.selected))
672삭제: .count()
673삭제: ),
674삭제: width,
675삭제: );
676삭제: });
677삭제: });
661추가: let rows = browser::rows(&self.model.entries, &self.folder, &self.search);
662추가: let selected = rows
663추가: .iter()
664추가: .filter(|row| !row.ids.is_empty() && row.ids.is_subset(&self.model.selected))
665추가: .count();
666추가: let rect = ui.max_rect();
667추가: let half = (rect.width() - theme::SPACE) / 2.0;
668추가: theme::status_text(
669추가: ui,
670추가: rect,
671추가: &format!("{}개 항목", rows.len()),
672추가: half,
673추가: Align::Min,
674추가: );
675추가: theme::status_text(ui, rect, &format!("선택 {selected}개"), half, Align::Max);
678676 });
679677 if ctx.embed_viewports() && self.work_visible() {
680678 // 별도 창을 만들 수 없을 때만 쓰는 대체 배치. 목록을 가리지 않도록 하단에 둠.
@@ -799,56 +797,91 @@ impl ArchiveApp {
799797 }
800798
801799 fn archive_list(&mut self, ui: &mut egui::Ui) {
802삭제: theme::panel(theme::STRIPE).corner_radius(0).show(ui, |ui| {
803삭제: ui.horizontal(|ui| {
804삭제: let up = theme::icon_button(
805삭제: ui,
806삭제: "위로",
807삭제: theme::UP,
808삭제: !self.folder.is_empty() && !self.model.busy(),
809삭제: );
810삭제: if up.clicked() {
811삭제: let parent = self
812삭제: .folder
813삭제: .rsplit_once('/')
814삭제: .map_or("", |(parent, _)| parent)
815삭제: .to_owned();
816삭제: self.browse_folder(&parent);
817삭제: }
818삭제: ui.label("현재 경로");
819삭제: let path = format!("/{}", self.folder);
820삭제: let width = (ui.available_width() - 270.0).max(0.0);
821삭제: egui::Frame::new()
822삭제: .fill(theme::PANEL)
823삭제: .stroke(egui::Stroke::new(1.0, theme::BORDER))
824삭제: .corner_radius(6)
825삭제: .inner_margin(egui::Margin::symmetric(8, 7))
826삭제: .show(ui, |ui| {
827삭제: theme::bounded_text(ui, &path, (width - 18.0).max(0.0));
828삭제: });
829삭제: let (rect, _) =
830삭제: ui.allocate_exact_size(egui::vec2(20.0, 20.0), egui::Sense::hover());
831삭제: theme::svg_icon(ui.painter(), rect, theme::SEARCH, theme::MUTED);
832삭제: let search = ui.add_sized(
833삭제: [220.0, 36.0],
834삭제: egui::TextEdit::singleline(&mut self.search)
835삭제: .id(egui::Id::unique("archive-search"))
836삭제: .hint_text("파일 찾기"),
837삭제: );
838삭제: theme::focus(&search);
839삭제: if search.changed() {
840삭제: self.clear_list_selection();
841삭제: }
800추가: // 경로 줄은 입력란 높이만 차지하고 창 너비 전체를 회색으로 채움.
801추가: egui::Frame::new()
802추가: .fill(theme::STRIPE)
803추가: .inner_margin(egui::Margin {
804추가: left: 8,
805추가: right: 12,
806추가: top: 0,
807추가: bottom: 0,
808추가: })
809추가: .show(ui, |ui| {
810추가: ui.set_min_width(ui.available_width());
811추가: ui.horizontal(|ui| {
812추가: ui.set_height(theme::FIELD);
813추가: // 간격은 아래에서 직접 넣어 위치가 흔들리지 않게 함.
814추가: ui.spacing_mut().item_spacing.x = 0.0;
815추가: let up = theme::flat_icon_button(
816추가: ui,
817추가: "위로",
818추가: theme::UP,
819추가: !self.folder.is_empty() && !self.model.busy(),
820추가: egui::vec2(theme::FIELD, theme::FIELD),
821추가: );
822추가: if up.clicked() {
823추가: let parent = self
824추가: .folder
825추가: .rsplit_once('/')
826추가: .map_or("", |(parent, _)| parent)
827추가: .to_owned();
828추가: self.browse_folder(&parent);
829추가: }
830추가: ui.add_space(6.0);
831추가: let path = format!("/{}", self.folder);
832추가: let search_width = 240.0;
833추가: let gap = 8.0;
834추가: let path_width = (ui.available_width() - search_width - gap).max(0.0);
835추가: // 두 입력란은 같은 높이의 칸을 받아 같은 세로 위치에 그림.
836추가: let (path_rect, _) = ui.allocate_exact_size(
837추가: egui::vec2(path_width, theme::FIELD),
838추가: egui::Sense::hover(),
839추가: );
840추가: theme::field_frame(ui, path_rect, false);
841추가: // 부모 배치에 영향을 주지 않는 하위 영역에 경로 글자를 그림.
842추가: let mut text_ui = ui.new_child(
843추가: egui::UiBuilder::new()
844추가: .max_rect(path_rect.shrink2(egui::vec2(10.0, 0.0)))
845추가: .layout(Layout::left_to_right(Align::Center)),
846추가: );
847추가: theme::bounded_text(&mut text_ui, &path, (path_width - 20.0).max(0.0));
848추가: ui.add_space(gap);
849추가: let (search_rect, _) = ui.allocate_exact_size(
850추가: egui::vec2(search_width, theme::FIELD),
851추가: egui::Sense::hover(),
852추가: );
853추가: let search_id = egui::Id::unique("archive-search");
854추가: let focused = ui.memory(|m| m.has_focus(search_id));
855추가: theme::field_frame(ui, search_rect, focused);
856추가: let icon = egui::Rect::from_center_size(
857추가: egui::pos2(search_rect.left() + 20.0, search_rect.center().y),
858추가: egui::vec2(16.0, 16.0),
859추가: );
860추가: theme::svg_icon(ui.painter(), icon, theme::SEARCH, theme::MUTED);
861추가: let search = ui.put(
862추가: egui::Rect::from_min_max(
863추가: egui::pos2(icon.right() + 8.0, search_rect.top() + 1.0),
864추가: egui::pos2(search_rect.right() - 8.0, search_rect.bottom() - 1.0),
865추가: ),
866추가: egui::TextEdit::singleline(&mut self.search)
867추가: .id(search_id)
868추가: .frame(egui::Frame::NONE)
869추가: .margin(egui::Margin::ZERO)
870추가: .align(egui::Align2::LEFT_CENTER)
871추가: .hint_text("파일 검색"),
872추가: );
873추가: if search.changed() {
874추가: self.clear_list_selection();
875추가: }
876추가: });
842877 });
843삭제: });
844878 let rows = browser::rows(&self.model.entries, &self.folder, &self.search);
845879
846삭제: let name_width = (ui.available_width() - 16.0 - 28.0 - 96.0 - 64.0 - 40.0).max(120.0);
880추가: let name_width = (ui.available_width() - 16.0 - 28.0 - 96.0 - 40.0).max(120.0);
847881 ui.horizontal(|ui| {
848882 ui.add_space(16.0 + 28.0);
849883 theme::column_label(ui, RichText::new("이름").strong(), name_width, Align::Min);
850884 theme::column_label(ui, "크기", 96.0, Align::Max);
851삭제: theme::column_label(ui, "암호", 64.0, Align::Min);
852885 });
853886 ui.separator();
854887 let active = !self.model.busy()
@@ -1027,7 +1060,14 @@ impl ArchiveApp {
10271060 },
10281061 20.0,
10291062 );
1030삭제: theme::bounded_text(ui, &row.name, name_width);
1063추가: // 암호가 걸린 항목은 이름 앞에 *를 붙여 표시함.
1064추가: let name = if row.encrypted {
1065추가: format!("*{}", row.name)
1066추가: } else {
1067추가: row.name.clone()
1068추가: };
1069추가: // 툴팁은 표시용 *를 빼고 실제 이름을 보여 줌.
1070추가: theme::bounded_text_hover(ui, &name, &row.name, name_width);
10311071 theme::column_label(
10321072 ui,
10331073 if row.directory {
@@ -1040,9 +1080,6 @@ impl ArchiveApp {
10401080 96.0,
10411081 Align::Max,
10421082 );
1043삭제: if row.encrypted {
1044삭제: theme::icon(ui, Icon::Lock, 16.0);
1045삭제: }
10461083 },
10471084 );
10481085 if active
수정experiments/rust-ui-memory-app/src/archive_theme.rs+168-34
@@ -29,6 +29,35 @@ pub const ROW: f32 = 32.0;
2929pub const BUTTON: f32 = 40.0;
3030pub const BODY: f32 = 17.0;
3131pub const TITLE: f32 = 22.0;
32추가: /// 경로와 검색 입력란의 높이. 위쪽 경로 줄은 이 높이만큼만 차지함.
33추가: pub const FIELD: f32 = 36.0;
34추가: /// 테두리 없는 버튼에 마우스를 올리거나 누를 때의 배경.
35추가: pub const HOVER: Color32 = Color32::from_rgb(229, 233, 239);
36추가: pub const PRESS: Color32 = Color32::from_rgb(214, 220, 229);
37추가:
38추가: /// 앱에 포함한 기본 글꼴 (SIL OFL 1.1, assets/fonts/OFL.txt).
39추가: pub const PRETENDARD: &[u8] = include_bytes!("assets/fonts/Pretendard-Regular.ttf");
40추가:
41추가: /// Pretendard를 기본 글꼴로 쓰고, 없는 글자는 운영체제 한글 글꼴로 대신 그림.
42추가: pub fn fonts(fallback: Option<(Vec<u8>, u32)>) -> egui::FontDefinitions {
43추가: let mut fonts = egui::FontDefinitions::empty();
44추가: fonts.font_data.insert(
45추가: "pretendard".into(),
46추가: egui::FontData::from_static(PRETENDARD).into(),
47추가: );
48추가: let mut family = vec!["pretendard".to_owned()];
49추가: if let Some((bytes, index)) = fallback {
50추가: let mut data = egui::FontData::from_owned(bytes);
51추가: data.index = index;
52추가: fonts.font_data.insert("system-kr".into(), data.into());
53추가: family.push("system-kr".into());
54추가: }
55추가: fonts
56추가: .families
57추가: .insert(egui::FontFamily::Proportional, family.clone());
58추가: fonts.families.insert(egui::FontFamily::Monospace, family);
59추가: fonts
60추가: }
3261
3362pub fn apply(ctx: &egui::Context) {
3463 ctx.set_theme(egui::Theme::Light);
@@ -75,6 +104,10 @@ pub fn apply(ctx: &egui::Context) {
75104 style.spacing.interact_size.y = ROW;
76105 style.spacing.window_margin = egui::Margin::same(PAD);
77106 style.visuals.disabled_alpha = 0.4;
107추가: // 클릭과 표시가 즉시 바뀌도록 서서히 나타남, 부드러운 스크롤, 커서 깜빡임을 모두 끔.
108추가: style.animation_time = 0.0;
109추가: style.scroll_animation = egui::style::ScrollAnimation::none();
110추가: style.visuals.text_cursor.blink = false;
78111 });
79112}
80113
@@ -122,6 +155,53 @@ pub fn action(ui: &mut egui::Ui, text: &str, primary: bool, enabled: bool) -> eg
122155 response
123156}
124157
158추가: pub const STATUS_HEIGHT: f32 = 34.0;
159추가:
160추가: /// 입력란 모양의 테두리를 그림. 초점이 있으면 파란 테두리.
161추가: pub fn field_frame(ui: &egui::Ui, rect: egui::Rect, focused: bool) {
162추가: ui.painter().rect(
163추가: rect,
164추가: 6,
165추가: PANEL,
166추가: Stroke::new(1.0, if focused { BLUE } else { BORDER }),
167추가: egui::StrokeKind::Inside,
168추가: );
169추가: }
170추가:
171추가: /// 상태 줄 글자를 칸의 세로 가운데에 그림. 넘치면 줄이고 전체 글자는 툴팁으로 보여 줌.
172추가: pub fn status_text(
173추가: ui: &mut egui::Ui,
174추가: rect: egui::Rect,
175추가: text: &str,
176추가: width: f32,
177추가: align: egui::Align,
178추가: ) {
179추가: let mut job =
180추가: egui::text::LayoutJob::simple_singleline(text.into(), FontId::proportional(BODY), TEXT);
181추가: job.wrap = egui::text::TextWrapping {
182추가: max_width: width.max(0.0),
183추가: max_rows: 1,
184추가: ..Default::default()
185추가: };
186추가: let galley = ui.fonts_mut(|fonts| fonts.layout_job(job));
187추가: let size = galley.size();
188추가: let x = if align == egui::Align::Max {
189추가: rect.right() - size.x
190추가: } else {
191추가: rect.left()
192추가: };
193추가: let text_rect = egui::Rect::from_min_size(egui::pos2(x, rect.center().y - size.y / 2.0), size);
194추가: ui.painter().galley(text_rect.min, galley, TEXT);
195추가: let response = ui.interact(
196추가: text_rect,
197추가: ui.scope_id()
198추가: .with(("status-text", align == egui::Align::Max)),
199추가: egui::Sense::hover(),
200추가: );
201추가: response.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Label, true, text));
202추가: response.on_hover_text(text);
203추가: }
204추가:
125205pub fn panel(fill: Color32) -> egui::Frame {
126206 egui::Frame::new()
127207 .fill(fill)
@@ -200,6 +280,16 @@ pub fn icon(ui: &mut egui::Ui, kind: Icon, size: f32) {
200280}
201281
202282pub fn bounded_text(ui: &mut egui::Ui, text: &str, width: f32) -> egui::Response {
283추가: bounded_text_hover(ui, text, text, width)
284추가: }
285추가:
286추가: /// 폭에 맞춰 줄인 글자를 그리고, 마우스를 올리면 hover 글자를 보여 줌.
287추가: pub fn bounded_text_hover(
288추가: ui: &mut egui::Ui,
289추가: text: &str,
290추가: hover: &str,
291추가: width: f32,
292추가: ) -> egui::Response {
203293 let width = width.max(0.0);
204294 ui.allocate_ui_with_layout(
205295 egui::vec2(width, ui.text_style_height(&TextStyle::Body)),
@@ -211,7 +301,7 @@ pub fn bounded_text(ui: &mut egui::Ui, text: &str, width: f32) -> egui::Response
211301 },
212302 )
213303 .inner
214삭제: .on_hover_text(text)
304추가: .on_hover_text(hover)
215305}
216306
217307pub fn window_title(ui: &egui::Ui, text: &str, width: f32) -> String {
@@ -290,18 +380,9 @@ pub fn indeterminate(ui: &mut egui::Ui) {
290380 egui::vec2(ui.available_width(), SPACE * 2.0),
291381 egui::Sense::hover(),
292382 );
293삭제: ui.painter().rect_filled(rect, 8, BORDER);
294삭제: let phase = if ui.style().animation_time > 0.0 {
295삭제: ui.input(|i| (i.time * 0.6).fract()) as f32
296삭제: } else {
297삭제: 0.5
298삭제: };
299삭제: let width = (SPACE * 8.0).min(rect.width());
300삭제: let pulse = egui::Rect::from_min_size(
301삭제: rect.min + egui::vec2((rect.width() - width) * phase, 0.0),
302삭제: egui::vec2(width, rect.height()),
303삭제: );
304삭제: ui.painter().rect_filled(pulse, 8, BLUE);
383추가: // 움직이는 표시 없이 전체 막대를 옅은 파란색으로 채워 진행 중임을 나타냄.
384추가: ui.painter()
385추가: .rect_filled(rect, 8, Color32::from_rgb(191, 211, 248));
305386 response.widget_info(|| {
306387 egui::WidgetInfo::labeled(
307388 egui::Role::ProgressIndicator,
@@ -333,13 +414,19 @@ pub fn svg_icon(painter: &egui::Painter, rect: egui::Rect, asset: &str, color: C
333414 )
334415 })
335416 .collect::<Vec<_>>();
336삭제: painter.add(egui::Shape::line(
337삭제: points,
338삭제: Stroke::new(rect.width() / 18.0, color),
339삭제: ));
417추가: let width = rect.width() / 18.0;
418추가: // 꼭짓점과 끝점에 원을 더해 둥근 이음과 둥근 끝을 만듦.
419추가: for point in &points {
420추가: painter.circle_filled(*point, width / 2.0, color);
421추가: }
422추가: painter.add(egui::Shape::line(points, Stroke::new(width, color)));
340423 }
341424}
342425
426추가: pub const TOOL_SIZE: egui::Vec2 = egui::vec2(96.0, 68.0);
427추가: const TOOL_ICON: f32 = 30.0;
428추가: const TOOL_LABEL: f32 = 15.0;
429추가:
343430pub fn tool(
344431 ui: &mut egui::Ui,
345432 label: &str,
@@ -347,40 +434,87 @@ pub fn tool(
347434 enabled: bool,
348435 blue: bool,
349436) -> egui::Response {
350삭제: let response = ui.add_enabled(
351삭제: enabled,
352삭제: egui::Button::new(
353삭제: egui::RichText::new(label)
354삭제: .size(18.0)
355삭제: .color(Color32::TRANSPARENT),
356삭제: )
357삭제: .frame(false)
358삭제: .min_size(egui::vec2(108.0, 86.0)),
437추가: let (rect, response) = ui.allocate_exact_size(
438추가: TOOL_SIZE,
439추가: if enabled {
440추가: egui::Sense::click()
441추가: } else {
442추가: egui::Sense::hover()
443추가: },
359444 );
360삭제: let rect = response.rect;
445추가: response.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, enabled, label));
361446 let color = if enabled {
362447 if blue { BLUE } else { TEXT }
363448 } else {
364449 MUTED
365450 };
366삭제: let icon_rect = egui::Rect::from_center_size(
367삭제: egui::pos2(rect.center().x, rect.top() + 27.0),
368삭제: egui::vec2(36.0, 36.0),
451추가: if enabled && (response.hovered() || response.has_focus()) {
452추가: let fill = if response.is_pointer_button_down_on() {
453추가: PRESS
454추가: } else {
455추가: HOVER
456추가: };
457추가: ui.painter().rect_filled(rect, 8, fill);
458추가: }
459추가: // 아이콘과 글자를 붙여 가운데에 두고, 아래쪽은 여백으로 남김.
460추가: let label_height = TOOL_LABEL * 1.3;
461추가: let gap = 4.0;
462추가: let top = rect.top() + (rect.height() - TOOL_ICON - gap - label_height) / 2.0;
463추가: let icon_rect = egui::Rect::from_min_size(
464추가: egui::pos2(rect.center().x - TOOL_ICON / 2.0, top),
465추가: egui::vec2(TOOL_ICON, TOOL_ICON),
369466 );
370삭제: ui.painter()
371삭제: .rect_filled(rect.shrink2(egui::vec2(1.0, 27.0)), 0, PANEL);
372467 svg_icon(ui.painter(), icon_rect, asset, color);
373468 ui.painter().text(
374삭제: egui::pos2(rect.center().x, rect.bottom() - 15.0),
469추가: egui::pos2(
470추가: rect.center().x,
471추가: icon_rect.bottom() + gap + label_height / 2.0,
472추가: ),
375473 egui::Align2::CENTER_CENTER,
376474 label,
377삭제: FontId::proportional(18.0),
475추가: FontId::proportional(TOOL_LABEL),
378476 color,
379477 );
380478 focus(&response);
381479 response
382480}
383481
482추가: /// 테두리와 배경 없이 아이콘만 그리는 버튼. 사용할 수 있을 때만 마우스를 올리면 배경이 어두워짐.
483추가: pub fn flat_icon_button(
484추가: ui: &mut egui::Ui,
485추가: name: &str,
486추가: asset: &str,
487추가: enabled: bool,
488추가: size: egui::Vec2,
489추가: ) -> egui::Response {
490추가: let (rect, response) = ui.allocate_exact_size(
491추가: size,
492추가: if enabled {
493추가: egui::Sense::click()
494추가: } else {
495추가: egui::Sense::hover()
496추가: },
497추가: );
498추가: let response = response.on_hover_text(name);
499추가: response.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, enabled, name));
500추가: if enabled && response.hovered() {
501추가: let fill = if response.is_pointer_button_down_on() {
502추가: PRESS
503추가: } else {
504추가: HOVER
505추가: };
506추가: ui.painter().rect_filled(rect, 6, fill);
507추가: }
508추가: svg_icon(
509추가: ui.painter(),
510추가: egui::Rect::from_center_size(rect.center(), egui::vec2(20.0, 20.0)),
511추가: asset,
512추가: if enabled { TEXT } else { MUTED },
513추가: );
514추가: focus(&response);
515추가: response
516추가: }
517추가:
384518pub const SEARCH: &str = include_str!("assets/icons/search-files.svg");
385519
386520pub fn icon_button(ui: &mut egui::Ui, name: &str, asset: &str, enabled: bool) -> egui::Response {
수정experiments/rust-ui-memory-app/src/assets/icons/create-zip.svg+1-1
@@ -1 +1 @@
1삭제: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="14,3 5,3 5,21 16,21"/><polyline points="14,3 20,9 14,9 14,3"/><polyline points="20,14 20,22"/><polyline points="16,18 24,18"/></svg>
1추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="2.80,5.60 2.84,5.11 2.98,4.71 3.20,4.40 3.51,4.18 3.91,4.04 4.40,4.00 19.60,4.00 20.09,4.04 20.49,4.18 20.80,4.40 21.02,4.71 21.16,5.11 21.20,5.60 21.20,7.40 21.16,7.89 21.02,8.29 20.80,8.60 20.49,8.82 20.09,8.96 19.60,9.00 4.40,9.00 3.91,8.96 3.51,8.82 3.20,8.60 2.98,8.29 2.84,7.89 2.80,7.40 2.80,5.60"/> <polyline points="4.30,9.00 4.30,17.60 4.37,18.33 4.57,18.93 4.90,19.40 5.37,19.73 5.97,19.93 6.70,20.00 17.30,20.00 18.03,19.93 18.63,19.73 19.10,19.40 19.43,18.93 19.63,18.33 19.70,17.60 19.70,9.00"/> <polyline points="9.60,13.00 14.40,13.00"/></svg>
수정experiments/rust-ui-memory-app/src/assets/icons/extract-archive.svg+1-1
@@ -1 +1 @@
1삭제: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="12,2 12,16"/><polyline points="6,10 12,16 18,10"/><polyline points="3,16 3,22 21,22 21,16"/></svg>
1추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="1.94,7.82 1.78,7.36 1.74,6.94 1.82,6.57 2.01,6.24 2.32,5.95 2.75,5.71 14.81,0.34 15.28,0.19 15.70,0.14 16.07,0.22 16.40,0.41 16.69,0.73 16.92,1.15 17.33,2.07 17.49,2.53 17.53,2.95 17.45,3.33 17.26,3.66 16.95,3.94 16.52,4.18 4.46,9.55 4.00,9.71 3.58,9.75 3.20,9.67 2.87,9.48 2.59,9.17 2.35,8.74 1.94,7.82"/> <polyline points="4.30,11.80 4.30,18.10 4.37,18.83 4.57,19.43 4.90,19.90 5.37,20.23 5.97,20.43 6.70,20.50 17.30,20.50 18.03,20.43 18.63,20.23 19.10,19.90 19.43,19.43 19.63,18.83 19.70,18.10 19.70,11.80"/> <polyline points="2.80,11.80 21.20,11.80"/> <polyline points="9.60,15.60 14.40,15.60"/></svg>
수정experiments/rust-ui-memory-app/src/assets/icons/navigate-up.svg+1-1
@@ -1 +1 @@
1삭제: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="5,10 12,3 19,10"/><polyline points="12,3 12,22"/></svg>
1추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="12.00,20.00 12.00,4.50"/> <polyline points="6.00,10.50 11.29,5.21 11.53,5.01 11.76,4.89 12.00,4.85 12.24,4.89 12.47,5.01 12.71,5.21 18.00,10.50"/></svg>
수정experiments/rust-ui-memory-app/src/assets/icons/open-archive.svg+1-1
@@ -1 +1 @@
1삭제: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="3,8 3,4 10,4 13,7 21,7 19,20 3,20 3,8 21,8"/></svg>
1추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="3.00,7.00 3.00,7.00 3.00,7.00 3.00,7.00 3.00,7.00 3.00,7.00 3.00,7.00 3.00,5.75 3.03,5.37 3.14,5.06 3.31,4.81 3.56,4.64 3.87,4.53 4.25,4.50 8.13,4.50 8.41,4.52 8.68,4.58 8.92,4.67 9.14,4.80 9.35,4.97 9.54,5.18 10.46,6.32 10.65,6.53 10.86,6.70 11.08,6.83 11.32,6.92 11.59,6.98 11.87,7.00 19.20,7.00 19.75,7.05 20.20,7.20 20.55,7.45 20.80,7.80 20.95,8.25 21.00,8.80 21.00,17.70 20.95,18.25 20.80,18.70 20.55,19.05 20.20,19.30 19.75,19.45 19.20,19.50 4.80,19.50 4.25,19.45 3.80,19.30 3.45,19.05 3.20,18.70 3.05,18.25 3.00,17.70 3.00,7.00"/> <polyline points="3.00,10.00 21.00,10.00"/></svg>
수정experiments/rust-ui-memory-app/src/assets/icons/search-files.svg+1-1
@@ -1 +1 @@
1삭제: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="16,16 23,23"/><polyline points="18,10 17,5 13,2 7,2 3,5 2,10 4,15 9,18 14,17 18,13 18,10"/></svg>
1추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="17.00,10.50 16.88,11.77 16.51,12.99 15.90,14.11 15.10,15.10 14.11,15.90 12.99,16.51 11.77,16.88 10.50,17.00 9.23,16.88 8.01,16.51 6.89,15.90 5.90,15.10 5.10,14.11 4.49,12.99 4.12,11.77 4.00,10.50 4.12,9.23 4.49,8.01 5.10,6.89 5.90,5.90 6.89,5.10 8.01,4.49 9.23,4.12 10.50,4.00 11.77,4.12 12.99,4.49 14.11,5.10 15.10,5.90 15.90,6.89 16.51,8.01 16.88,9.23 17.00,10.50"/> <polyline points="15.30,15.30 20.50,20.50"/></svg>
수정experiments/rust-ui-memory-app/src/desktop.rs+8-12
@@ -7,7 +7,7 @@ mod fake;
77mod renderer;
88#[path = "system_font.rs"]
99mod system_font;
10삭제: use eframe::egui::{self, FontData, FontDefinitions, FontFamily};
10추가: use eframe::egui;
1111fn main() -> eframe::Result {
1212 let result = run();
1313 #[cfg(target_os = "windows")]
@@ -43,7 +43,10 @@ fn show_startup_error(message: &str) {
4343
4444fn run() -> eframe::Result {
4545 let custom_frame = zipelo_ui_memory_app::window_frame::custom_frame_needed();
46삭제: let font = system_font::load().map_err(|e| eframe::Error::AppCreation(Box::new(e)))?;
46추가: // 운영체제 한글 글꼴은 Pretendard에 없는 글자를 위한 대체 글꼴로만 씀.
47추가: let fallback = system_font::load()
48추가: .ok()
49추가: .map(|font| (font.bytes, font.face_index));
4750 renderer::run_native(
4851 "Zipelo",
4952 eframe::NativeOptions {
@@ -54,17 +57,10 @@ fn run() -> eframe::Result {
5457 ..Default::default()
5558 },
5659 || {
57삭제: let bytes = font.bytes.clone();
58삭제: let face_index = font.face_index;
60추가: let fallback = fallback.clone();
5961 Box::new(move |cc| {
60삭제: let mut fonts = FontDefinitions::empty();
61삭제: let mut data = FontData::from_owned(bytes);
62삭제: data.index = face_index;
63삭제: fonts.font_data.insert("noto-kr".into(), data.into());
64삭제: fonts
65삭제: .families
66삭제: .insert(FontFamily::Proportional, vec!["noto-kr".into()]);
67삭제: cc.egui_ctx.set_fonts(fonts);
62추가: cc.egui_ctx
63추가: .set_fonts(zipelo_ui_memory_app::archive_theme::fonts(fallback));
6864 zipelo_ui_memory_app::archive_theme::apply(&cc.egui_ctx);
6965 let (fixture, startup) = zipelo_ui_memory_app::archive_ui::launch_args(
7066 std::env::args_os().skip(1).collect(),
수정tests/rust-app-ui/capture.rs+7-12
@@ -1,4 +1,4 @@
1삭제: use eframe::egui::{self, FontData, FontDefinitions, FontFamily, FontId, TextStyle};
1추가: use eframe::egui::{self, FontId, TextStyle};
22use std::{collections::VecDeque, path::PathBuf};
33use zipelo_ui_memory_app::{archive_screen::ArchiveApp, archive_ui::*};
44#[path = "../../experiments/rust-ui-memory-app/src/renderer.rs"]
@@ -388,7 +388,9 @@ fn main() -> eframe::Result {
388388 std::fs::create_dir_all(&base).unwrap();
389389 std::fs::write(base.join("읽어주세요.txt"), "화면 검증 입력").unwrap();
390390 std::fs::create_dir_all(base.join("사진")).unwrap();
391삭제: let font = system_font::load().map_err(|e| eframe::Error::AppCreation(Box::new(e)))?;
391추가: let fallback = system_font::load()
392추가: .ok()
393추가: .map(|font| (font.bytes, font.face_index));
392394 let title = format!("Zipelo UI capture {mode}");
393395 renderer::run_native(
394396 &title,
@@ -401,17 +403,10 @@ fn main() -> eframe::Result {
401403 || {
402404 let mode = mode.clone();
403405 let base = base.clone();
404삭제: let bytes = font.bytes.clone();
405삭제: let face_index = font.face_index;
406추가: let fallback = fallback.clone();
406407 Box::new(move |cc| {
407삭제: let mut fonts = FontDefinitions::empty();
408삭제: let mut data = FontData::from_owned(bytes.clone());
409삭제: data.index = face_index;
410삭제: fonts.font_data.insert("noto-kr".into(), data.into());
411삭제: fonts
412삭제: .families
413삭제: .insert(FontFamily::Proportional, vec!["noto-kr".into()]);
414삭제: cc.egui_ctx.set_fonts(fonts);
408추가: cc.egui_ctx
409추가: .set_fonts(zipelo_ui_memory_app::archive_theme::fonts(fallback.clone()));
415410 cc.egui_ctx.set_visuals(egui::Visuals::light());
416411 cc.egui_ctx.style_mut_of(egui::Theme::Light, |style| {
417412 style
수정tests/rust-app-ui/long_layout.rs+15-5
@@ -100,18 +100,22 @@ fn narrow_archive_keeps_columns_and_virtualizes_thousands_of_long_names() {
100100 assert_narrow_text(&output);
101101 let text = layout_text(&output);
102102 assert!(text.len() < 100);
103추가: // 암호가 걸린 항목은 이름 앞에 *가 붙음.
103104 let first = text
104105 .iter()
105삭제: .find(|(text, _, _)| text == &format!("0000-{name}"))
106추가: .find(|(text, _, _)| text.trim_start_matches('*') == format!("0000-{name}"))
106107 .unwrap();
107108 assert!(first.2);
109추가: // 크기는 스크롤 막대 자리(오른쪽 24px)를 침범하지 않는 행 안쪽에 남음.
108110 assert!(
109111 text.iter()
110삭제: .any(|(text, rect, _)| text == "31 B" && rect.right() < 720.0)
112추가: .any(|(text, rect, _)| text == "31 B" && rect.right() <= 736.0)
111113 );
112삭제: for expected in ["크기", "암호", "5000개 항목", "선택 5000개"] {
114추가: for expected in ["크기", "5000개 항목", "선택 5000개"] {
113115 assert!(text.iter().any(|(text, _, _)| text == expected));
114116 }
117추가: // 암호 열은 없고 이름 앞의 *로만 표시함.
118추가: assert!(!text.iter().any(|(text, _, _)| text == "암호"));
115119 let title = output
116120 .viewport_output
117121 .values()
@@ -123,7 +127,13 @@ fn narrow_archive_keeps_columns_and_virtualizes_thousands_of_long_names() {
123127 .unwrap();
124128 assert!(title.contains('…') && title.ends_with(" — Zipelo"));
125129 assert!(title.chars().count() < full_title.chars().count());
126삭제: assert_full_tooltip(&ctx, &mut app, first.1.center(), &first.0);
130추가: // 툴팁은 표시용 *를 뺀 실제 이름을 보여 줌.
131추가: assert_full_tooltip(
132추가: &ctx,
133추가: &mut app,
134추가: first.1.center(),
135추가: first.0.trim_start_matches('*'),
136추가: );
127137 let output = narrow_frame(&ctx, &mut app, 14.0, vec![egui::Event::PointerGone]);
128138 let point = layout_text(&output)
129139 .into_iter()
@@ -152,7 +162,7 @@ fn narrow_deep_folder_path_is_elided_without_displacing_search() {
152162 assert!(path.2);
153163 assert!(
154164 text.iter()
155삭제: .any(|(text, rect, _)| text == "파일 찾기" && rect.right() < 760.0)
165추가: .any(|(text, rect, _)| text == "파일 검색" && rect.right() < 760.0)
156166 );
157167 assert_full_tooltip(&ctx, &mut app, path.1.center(), &full);
158168}