team-ljyzipelo

공개

파일 행 선택과 공통 간격을 보완함

작성자
호시노 히나타
작성 시각
커밋
ce0f63496cb7d2f32eb304738952adbe3588371a
부모
85c6f3d
이 시점의 파일 보기

변경된 파일 11개

+83-15
수정experiments/rust-ui-memory-app/src/archive_screen.rs+29-15
@@ -413,20 +413,20 @@ impl ArchiveApp {
413413 let width = (ui.available_width() * 0.60)
414414 .max(480.0)
415415 .min(ui.available_width());
416삭제: let y = ((ui.available_height() - 344.0) / 2.0).max(0.0);
416추가: let y = ((ui.available_height() - theme::DROP_HEIGHT - theme::SPACE * 8.0) / 2.0).max(0.0);
417417 ui.add_space(y);
418418 ui.vertical_centered(|ui| {
419419 let drop_frame = egui::Frame::new()
420420 .fill(if hovered { theme::DROP } else { theme::PANEL })
421삭제: .corner_radius(12)
422삭제: .inner_margin(egui::Margin::same(24))
421추가: .corner_radius(theme::DROP_RADIUS)
422추가: .inner_margin(egui::Margin::same(theme::DROP_PAD))
423423 .show(ui, |ui| {
424삭제: ui.set_width(width - 48.0);
425삭제: ui.set_min_height(232.0);
424추가: ui.set_width(width - 2.0 * theme::DROP_PAD as f32);
425추가: ui.set_min_height(theme::DROP_HEIGHT - 2.0 * theme::DROP_PAD as f32);
426426 ui.vertical_centered(|ui| {
427삭제: ui.add_space(16.0);
427추가: ui.add_space(theme::PAD as f32);
428428 theme::icon(ui, Icon::Archive, 48.0);
429삭제: ui.add_space(16.0);
429추가: ui.add_space(theme::PAD as f32);
430430 ui.label(
431431 RichText::new(if hovered {
432432 "놓으면 엽니다"
@@ -459,20 +459,22 @@ impl ArchiveApp {
459459 (rect.left_bottom(), rect.left_top()),
460460 ] {
461461 let direction = (b - a).normalized();
462삭제: let mut distance = 12.0;
463삭제: while distance < a.distance(b) - 12.0 {
462추가: let mut distance = theme::DROP_RADIUS as f32;
463추가: while distance < a.distance(b) - theme::DROP_RADIUS as f32 {
464464 ui.painter().line_segment(
465465 [
466466 a + direction * distance,
467삭제: a + direction * (distance + 8.0).min(a.distance(b) - 12.0),
467추가: a + direction
468추가: * (distance + theme::SPACE)
469추가: .min(a.distance(b) - theme::DROP_RADIUS as f32),
468470 ],
469471 stroke,
470472 );
471삭제: distance += 16.0;
473추가: distance += theme::PAD as f32;
472474 }
473475 }
474476 }
475삭제: ui.add_space(16.0);
477추가: ui.add_space(theme::PAD as f32);
476478 ui.colored_label(
477479 theme::MUTED,
478480 "ZIP, 7z, TAR, GZ, TAR.GZ 파일을 열 수 있습니다",
@@ -520,7 +522,7 @@ impl ArchiveApp {
520522 let widths =
521523 (ui.available_width() - 32.0 - 96.0 - 64.0 - theme::SPACE * 4.0 - 32.0).max(160.0);
522524 theme::panel(theme::PANEL)
523삭제: .inner_margin(egui::Margin::symmetric(8, 0))
525추가: .inner_margin(egui::Margin::symmetric(theme::SPACE as i8, 0))
524526 .show(ui, |ui| {
525527 ui.horizontal(|ui| {
526528 let response = ui
@@ -552,7 +554,7 @@ impl ArchiveApp {
552554 ui.separator();
553555 if self.model.entries.is_empty() {
554556 ui.vertical_centered(|ui| {
555삭제: ui.add_space(64.0);
557추가: ui.add_space(theme::SPACE * 8.0);
556558 ui.label(if self.model.list_id.is_some() {
557559 "이 압축파일은 비어 있습니다"
558560 } else {
@@ -670,7 +672,19 @@ impl ArchiveApp {
670672 });
671673 row.clone().on_hover_text(&entry.name);
672674 theme::focus(&row);
673삭제: if enabled && !changed && row.clicked() {
675추가: let content = ui.interact(
676추가: egui::Rect::from_min_max(
677추가: rect.min + egui::vec2(32.0, 0.0),
678추가: rect.max,
679추가: ),
680추가: row.id.with("content"),
681추가: if enabled {
682추가: egui::Sense::click()
683추가: } else {
684추가: egui::Sense::hover()
685추가: },
686추가: );
687추가: if enabled && !changed && (row.clicked() || content.clicked()) {
674688 selected = !selected;
675689 changed = true;
676690 }
수정experiments/rust-ui-memory-app/src/archive_theme.rs+3-0
@@ -22,6 +22,9 @@ pub const FOLDER: Color32 = Color32::from_rgb(224, 165, 38);
2222pub const FILE: Color32 = Color32::from_rgb(123, 135, 148);
2323pub const SPACE: f32 = 8.0;
2424pub const PAD: i8 = 16;
25추가: pub const DROP_PAD: i8 = 24;
26추가: pub const DROP_HEIGHT: f32 = 280.0;
27추가: pub const DROP_RADIUS: u8 = 12;
2528pub const ROW: f32 = 32.0;
2629pub const BUTTON: f32 = 40.0;
2730pub const BODY: f32 = 15.0;
추가tests/ui-redesign/check_row_selection.py+51-0
@@ -0,0 +1,51 @@
1추가: """실제 X11 창에서 파일 행을 눌렀을 때 선택 배경이 바뀌는지 확인함."""
2추가:
3추가: import argparse
4추가: from pathlib import Path
5추가: import subprocess
6추가: import sys
7추가: import time
8추가:
9추가: import capture
10추가:
11추가:
12추가: def main():
13추가: parser = argparse.ArgumentParser(description=__doc__)
14추가: parser.add_argument("--binary", type=Path, required=True)
15추가: args = parser.parse_args()
16추가: original = capture.command
17추가: clicked = False
18추가:
19추가: def command(arguments, environment, **kwargs):
20추가: nonlocal clicked
21추가: if arguments[:3] == ["xdotool", "mousemove", "--window"] and arguments[-2:] == ["2", "2"]:
22추가: original(
23추가: ["xdotool", "mousemove", "--window", arguments[3], "120", "271"],
24추가: environment,
25추가: )
26추가: time.sleep(0.2)
27추가: original(["xdotool", "click", "1"], environment)
28추가: clicked = True
29추가: time.sleep(0.2)
30추가: return original(arguments, environment, **kwargs)
31추가:
32추가: capture.command = command
33추가: output = capture.ROOT / "tests/ui-redesign/runs/row-selection"
34추가: sys.argv = [
35추가: sys.argv[0], "--binary", str(args.binary), "--variant", "after",
36추가: "--states", "opened", "--output", str(output),
37추가: ]
38추가: capture.main()
39추가: if not clicked:
40추가: raise AssertionError("행 클릭을 실행하지 못함")
41추가: pixel = subprocess.check_output(
42추가: ["convert", str(output / "opened.png"), "-format", "%[pixel:p{500,271}]", "info:"],
43추가: text=True,
44추가: ).strip()
45추가: if pixel != "srgb(232,240,254)":
46추가: raise AssertionError(f"행 선택 배경 불일치: {pixel}")
47추가: print("실제 파일 이름 클릭 후 선택 표시 확인")
48추가:
49추가:
50추가: if __name__ == "__main__":
51추가: main()
수정tests/ui-redesign/screenshots/after/password-create.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
수정tests/ui-redesign/screenshots/after/password-retry.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
수정tests/ui-redesign/screenshots/after/password.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
수정tests/ui-redesign/screenshots/after/progress-unknown.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
수정tests/ui-redesign/screenshots/minimum/password-create.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
수정tests/ui-redesign/screenshots/minimum/password-retry.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
수정tests/ui-redesign/screenshots/minimum/password.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
수정tests/ui-redesign/screenshots/minimum/progress-unknown.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기