team-ljyzipelo

공개

툴바와 폴더 탐색 및 기본 파일 창을 적용함

작성자
호시노 히나타
작성 시각
커밋
0729e1f93186fdfb121022793e086162c4c3ef75
부모
c583264
이 시점의 파일 보기

변경된 파일 28개

+1,366-730

변경 내용이 커서 일부 파일의 Diff를 생략했어요. 생략한 파일은 파일 보기나 Raw로 확인할 수 있어요.

수정experiments/rust-ui-memory-app/Cargo.lock+492-11
@@ -205,6 +205,25 @@ version = "1.0.1"
205205source = "registry+https://github.com/rust-lang/crates.io-index"
206206checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b"
207207
208추가: [[package]]
209추가: name = "ashpd"
210추가: version = "0.11.1"
211추가: source = "registry+https://github.com/rust-lang/crates.io-index"
212추가: checksum = "d2f3f79755c74fd155000314eb349864caa787c6592eace6c6882dad873d9c39"
213추가: dependencies = [
214추가: "async-fs",
215추가: "async-net",
216추가: "enumflags2",
217추가: "futures-channel",
218추가: "futures-util",
219추가: "rand",
220추가: "raw-window-handle",
221추가: "serde",
222추가: "serde_repr",
223추가: "url",
224추가: "zbus",
225추가: ]
226추가:
208227[[package]]
209228name = "async-broadcast"
210229version = "0.7.2"
@@ -243,6 +262,17 @@ dependencies = [
243262 "slab",
244263]
245264
265추가: [[package]]
266추가: name = "async-fs"
267추가: version = "2.2.0"
268추가: source = "registry+https://github.com/rust-lang/crates.io-index"
269추가: checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5"
270추가: dependencies = [
271추가: "async-lock",
272추가: "blocking",
273추가: "futures-lite",
274추가: ]
275추가:
246276[[package]]
247277name = "async-io"
248278version = "2.6.0"
@@ -272,6 +302,17 @@ dependencies = [
272302 "pin-project-lite",
273303]
274304
305추가: [[package]]
306추가: name = "async-net"
307추가: version = "2.0.0"
308추가: source = "registry+https://github.com/rust-lang/crates.io-index"
309추가: checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7"
310추가: dependencies = [
311추가: "async-io",
312추가: "blocking",
313추가: "futures-lite",
314추가: ]
315추가:
275316[[package]]
276317name = "async-process"
277318version = "2.5.0"
@@ -748,9 +789,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
748789checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38"
749790dependencies = [
750791 "bitflags 2.13.2",
792추가: "block2 0.6.2",
793추가: "libc",
751794 "objc2 0.6.5",
752795]
753796
797추가: [[package]]
798추가: name = "displaydoc"
799추가: version = "0.2.7"
800추가: source = "registry+https://github.com/rust-lang/crates.io-index"
801추가: checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
802추가: dependencies = [
803추가: "proc-macro2",
804추가: "quote",
805추가: "syn 3.0.10",
806추가: ]
807추가:
754808[[package]]
755809name = "dlib"
756810version = "0.5.3"
@@ -816,7 +870,7 @@ dependencies = [
816870 "objc2-foundation 0.3.2",
817871 "parking_lot",
818872 "percent-encoding",
819삭제: "pollster",
873추가: "pollster 1.0.1",
820874 "profiling",
821875 "raw-window-handle",
822876 "send_wrapper",
@@ -1160,6 +1214,24 @@ version = "0.3.1"
11601214source = "registry+https://github.com/rust-lang/crates.io-index"
11611215checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
11621216
1217추가: [[package]]
1218추가: name = "form_urlencoded"
1219추가: version = "1.2.2"
1220추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1221추가: checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
1222추가: dependencies = [
1223추가: "percent-encoding",
1224추가: ]
1225추가:
1226추가: [[package]]
1227추가: name = "futures-channel"
1228추가: version = "0.3.34"
1229추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1230추가: checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"
1231추가: dependencies = [
1232추가: "futures-core",
1233추가: ]
1234추가:
11631235[[package]]
11641236name = "futures-core"
11651237version = "0.3.34"
@@ -1209,8 +1281,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
12091281checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
12101282dependencies = [
12111283 "futures-core",
1284추가: "futures-io",
12121285 "futures-macro",
12131286 "futures-task",
1287추가: "memchr",
12141288 "pin-project-lite",
12151289 "slab",
12161290]
@@ -1462,6 +1536,110 @@ dependencies = [
14621536 "digest",
14631537]
14641538
1539추가: [[package]]
1540추가: name = "icu_collections"
1541추가: version = "2.4.0"
1542추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1543추가: checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd"
1544추가: dependencies = [
1545추가: "displaydoc",
1546추가: "potential_utf",
1547추가: "utf8_iter",
1548추가: "yoke",
1549추가: "zerofrom",
1550추가: "zerovec",
1551추가: ]
1552추가:
1553추가: [[package]]
1554추가: name = "icu_locale_core"
1555추가: version = "2.4.0"
1556추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1557추가: checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0"
1558추가: dependencies = [
1559추가: "displaydoc",
1560추가: "litemap",
1561추가: "tinystr",
1562추가: "writeable",
1563추가: "zerovec",
1564추가: ]
1565추가:
1566추가: [[package]]
1567추가: name = "icu_normalizer"
1568추가: version = "2.4.0"
1569추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1570추가: checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599"
1571추가: dependencies = [
1572추가: "icu_collections",
1573추가: "icu_normalizer_data",
1574추가: "icu_properties",
1575추가: "icu_provider",
1576추가: "smallvec",
1577추가: "zerovec",
1578추가: ]
1579추가:
1580추가: [[package]]
1581추가: name = "icu_normalizer_data"
1582추가: version = "2.4.0"
1583추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1584추가: checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc"
1585추가:
1586추가: [[package]]
1587추가: name = "icu_properties"
1588추가: version = "2.4.0"
1589추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1590추가: checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f"
1591추가: dependencies = [
1592추가: "displaydoc",
1593추가: "icu_collections",
1594추가: "icu_locale_core",
1595추가: "icu_properties_data",
1596추가: "icu_provider",
1597추가: "zerotrie",
1598추가: "zerovec",
1599추가: ]
1600추가:
1601추가: [[package]]
1602추가: name = "icu_properties_data"
1603추가: version = "2.4.0"
1604추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1605추가: checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf"
1606추가:
1607추가: [[package]]
1608추가: name = "icu_provider"
1609추가: version = "2.4.0"
1610추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1611추가: checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514"
1612추가: dependencies = [
1613추가: "displaydoc",
1614추가: "icu_locale_core",
1615추가: "writeable",
1616추가: "yoke",
1617추가: "zerofrom",
1618추가: "zerotrie",
1619추가: "zerovec",
1620추가: ]
1621추가:
1622추가: [[package]]
1623추가: name = "idna"
1624추가: version = "1.1.0"
1625추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1626추가: checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
1627추가: dependencies = [
1628추가: "idna_adapter",
1629추가: "smallvec",
1630추가: "utf8_iter",
1631추가: ]
1632추가:
1633추가: [[package]]
1634추가: name = "idna_adapter"
1635추가: version = "1.2.2"
1636추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1637추가: checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"
1638추가: dependencies = [
1639추가: "icu_normalizer",
1640추가: "icu_properties",
1641추가: ]
1642추가:
14651643[[package]]
14661644name = "image"
14671645version = "0.25.10"
@@ -1653,6 +1831,12 @@ version = "0.12.1"
16531831source = "registry+https://github.com/rust-lang/crates.io-index"
16541832checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
16551833
1834추가: [[package]]
1835추가: name = "litemap"
1836추가: version = "0.8.3"
1837추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1838추가: checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae"
1839추가:
16561840[[package]]
16571841name = "litrs"
16581842version = "1.0.1"
@@ -2398,6 +2582,12 @@ dependencies = [
23982582 "windows-sys 0.61.2",
23992583]
24002584
2585추가: [[package]]
2586추가: name = "pollster"
2587추가: version = "0.4.0"
2588추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2589추가: checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3"
2590추가:
24012591[[package]]
24022592name = "pollster"
24032593version = "1.0.1"
@@ -2428,6 +2618,24 @@ dependencies = [
24282618 "portable-atomic",
24292619]
24302620
2621추가: [[package]]
2622추가: name = "potential_utf"
2623추가: version = "0.1.6"
2624추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2625추가: checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661"
2626추가: dependencies = [
2627추가: "zerovec",
2628추가: ]
2629추가:
2630추가: [[package]]
2631추가: name = "ppv-lite86"
2632추가: version = "0.2.21"
2633추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2634추가: checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
2635추가: dependencies = [
2636추가: "zerocopy",
2637추가: ]
2638추가:
24312639[[package]]
24322640name = "presser"
24332641version = "0.3.1"
@@ -2500,6 +2708,35 @@ version = "6.0.0"
25002708source = "registry+https://github.com/rust-lang/crates.io-index"
25012709checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
25022710
2711추가: [[package]]
2712추가: name = "rand"
2713추가: version = "0.9.5"
2714추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2715추가: checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41"
2716추가: dependencies = [
2717추가: "rand_chacha",
2718추가: "rand_core",
2719추가: ]
2720추가:
2721추가: [[package]]
2722추가: name = "rand_chacha"
2723추가: version = "0.9.0"
2724추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2725추가: checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
2726추가: dependencies = [
2727추가: "ppv-lite86",
2728추가: "rand_core",
2729추가: ]
2730추가:
2731추가: [[package]]
2732추가: name = "rand_core"
2733추가: version = "0.9.5"
2734추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2735추가: checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
2736추가: dependencies = [
2737추가: "getrandom 0.3.4",
2738추가: ]
2739추가:
25032740[[package]]
25042741name = "range-alloc"
25052742version = "0.1.5"
@@ -2556,6 +2793,30 @@ version = "1.1.0"
25562793source = "registry+https://github.com/rust-lang/crates.io-index"
25572794checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832"
25582795
2796추가: [[package]]
2797추가: name = "rfd"
2798추가: version = "0.16.0"
2799추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2800추가: checksum = "a15ad77d9e70a92437d8f74c35d99b4e4691128df018833e99f90bcd36152672"
2801추가: dependencies = [
2802추가: "ashpd",
2803추가: "block2 0.6.2",
2804추가: "dispatch2",
2805추가: "js-sys",
2806추가: "log",
2807추가: "objc2 0.6.5",
2808추가: "objc2-app-kit 0.3.2",
2809추가: "objc2-core-foundation",
2810추가: "objc2-foundation 0.3.2",
2811추가: "pollster 0.4.0",
2812추가: "raw-window-handle",
2813추가: "urlencoding",
2814추가: "wasm-bindgen",
2815추가: "wasm-bindgen-futures",
2816추가: "web-sys",
2817추가: "windows-sys 0.60.2",
2818추가: ]
2819추가:
25592820[[package]]
25602821name = "roxmltree"
25612822version = "0.21.2"
@@ -2867,6 +3128,12 @@ dependencies = [
28673128 "serde",
28683129]
28693130
3131추가: [[package]]
3132추가: name = "stable_deref_trait"
3133추가: version = "1.2.1"
3134추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3135추가: checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
3136추가:
28703137[[package]]
28713138name = "static_assertions"
28723139version = "1.1.0"
@@ -2901,6 +3168,17 @@ dependencies = [
29013168 "unicode-ident",
29023169]
29033170
3171추가: [[package]]
3172추가: name = "synstructure"
3173추가: version = "0.14.0"
3174추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3175추가: checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02"
3176추가: dependencies = [
3177추가: "proc-macro2",
3178추가: "quote",
3179추가: "syn 3.0.10",
3180추가: ]
3181추가:
29043182[[package]]
29053183name = "sys-locale"
29063184version = "0.3.2"
@@ -2977,6 +3255,16 @@ dependencies = [
29773255 "zune-jpeg",
29783256]
29793257
3258추가: [[package]]
3259추가: name = "tinystr"
3260추가: version = "0.8.5"
3261추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3262추가: checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a"
3263추가: dependencies = [
3264추가: "displaydoc",
3265추가: "zerovec",
3266추가: ]
3267추가:
29803268[[package]]
29813269name = "tokio"
29823270version = "1.54.1"
@@ -3127,6 +3415,40 @@ version = "0.2.3"
31273415source = "registry+https://github.com/rust-lang/crates.io-index"
31283416checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557"
31293417
3418추가: [[package]]
3419추가: name = "url"
3420추가: version = "2.5.8"
3421추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3422추가: checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
3423추가: dependencies = [
3424추가: "form_urlencoded",
3425추가: "idna",
3426추가: "percent-encoding",
3427추가: "serde",
3428추가: "serde_derive",
3429추가: ]
3430추가:
3431추가: [[package]]
3432추가: name = "urlencoding"
3433추가: version = "2.1.3"
3434추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3435추가: checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
3436추가:
3437추가: [[package]]
3438추가: name = "utf8_iter"
3439추가: version = "1.1.0"
3440추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3441추가: checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0"
3442추가: dependencies = [
3443추가: "utf_types",
3444추가: ]
3445추가:
3446추가: [[package]]
3447추가: name = "utf_types"
3448추가: version = "1.0.0"
3449추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3450추가: checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6"
3451추가:
31303452[[package]]
31313453name = "uuid"
31323454version = "1.29.2"
@@ -3654,7 +3976,7 @@ version = "0.52.0"
36543976source = "registry+https://github.com/rust-lang/crates.io-index"
36553977checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
36563978dependencies = [
3657삭제: "windows-targets",
3979추가: "windows-targets 0.52.6",
36583980]
36593981
36603982[[package]]
@@ -3663,7 +3985,16 @@ version = "0.59.0"
36633985source = "registry+https://github.com/rust-lang/crates.io-index"
36643986checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
36653987dependencies = [
3666삭제: "windows-targets",
3988추가: "windows-targets 0.52.6",
3989추가: ]
3990추가:
3991추가: [[package]]
3992추가: name = "windows-sys"
3993추가: version = "0.60.2"
3994추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3995추가: checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
3996추가: dependencies = [
3997추가: "windows-targets 0.53.5",
36673998]
36683999
36694000[[package]]
@@ -3681,14 +4012,31 @@ version = "0.52.6"
36814012source = "registry+https://github.com/rust-lang/crates.io-index"
36824013checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
36834014dependencies = [
3684삭제: "windows_aarch64_gnullvm",
3685삭제: "windows_aarch64_msvc",
3686삭제: "windows_i686_gnu",
3687삭제: "windows_i686_gnullvm",
3688삭제: "windows_i686_msvc",
3689삭제: "windows_x86_64_gnu",
3690삭제: "windows_x86_64_gnullvm",
3691삭제: "windows_x86_64_msvc",
4015추가: "windows_aarch64_gnullvm 0.52.6",
4016추가: "windows_aarch64_msvc 0.52.6",
4017추가: "windows_i686_gnu 0.52.6",
4018추가: "windows_i686_gnullvm 0.52.6",
4019추가: "windows_i686_msvc 0.52.6",
4020추가: "windows_x86_64_gnu 0.52.6",
4021추가: "windows_x86_64_gnullvm 0.52.6",
4022추가: "windows_x86_64_msvc 0.52.6",
4023추가: ]
4024추가:
4025추가: [[package]]
4026추가: name = "windows-targets"
4027추가: version = "0.53.5"
4028추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4029추가: checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
4030추가: dependencies = [
4031추가: "windows-link",
4032추가: "windows_aarch64_gnullvm 0.53.1",
4033추가: "windows_aarch64_msvc 0.53.1",
4034추가: "windows_i686_gnu 0.53.1",
4035추가: "windows_i686_gnullvm 0.53.1",
4036추가: "windows_i686_msvc 0.53.1",
4037추가: "windows_x86_64_gnu 0.53.1",
4038추가: "windows_x86_64_gnullvm 0.53.1",
4039추가: "windows_x86_64_msvc 0.53.1",
36924040]
36934041
36944042[[package]]
@@ -3706,48 +4054,96 @@ version = "0.52.6"
37064054source = "registry+https://github.com/rust-lang/crates.io-index"
37074055checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
37084056
4057추가: [[package]]
4058추가: name = "windows_aarch64_gnullvm"
4059추가: version = "0.53.1"
4060추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4061추가: checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
4062추가:
37094063[[package]]
37104064name = "windows_aarch64_msvc"
37114065version = "0.52.6"
37124066source = "registry+https://github.com/rust-lang/crates.io-index"
37134067checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
37144068
4069추가: [[package]]
4070추가: name = "windows_aarch64_msvc"
4071추가: version = "0.53.1"
4072추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4073추가: checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
4074추가:
37154075[[package]]
37164076name = "windows_i686_gnu"
37174077version = "0.52.6"
37184078source = "registry+https://github.com/rust-lang/crates.io-index"
37194079checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
37204080
4081추가: [[package]]
4082추가: name = "windows_i686_gnu"
4083추가: version = "0.53.1"
4084추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4085추가: checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
4086추가:
37214087[[package]]
37224088name = "windows_i686_gnullvm"
37234089version = "0.52.6"
37244090source = "registry+https://github.com/rust-lang/crates.io-index"
37254091checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
37264092
4093추가: [[package]]
4094추가: name = "windows_i686_gnullvm"
4095추가: version = "0.53.1"
4096추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4097추가: checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
4098추가:
37274099[[package]]
37284100name = "windows_i686_msvc"
37294101version = "0.52.6"
37304102source = "registry+https://github.com/rust-lang/crates.io-index"
37314103checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
37324104
4105추가: [[package]]
4106추가: name = "windows_i686_msvc"
4107추가: version = "0.53.1"
4108추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4109추가: checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
4110추가:
37334111[[package]]
37344112name = "windows_x86_64_gnu"
37354113version = "0.52.6"
37364114source = "registry+https://github.com/rust-lang/crates.io-index"
37374115checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
37384116
4117추가: [[package]]
4118추가: name = "windows_x86_64_gnu"
4119추가: version = "0.53.1"
4120추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4121추가: checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
4122추가:
37394123[[package]]
37404124name = "windows_x86_64_gnullvm"
37414125version = "0.52.6"
37424126source = "registry+https://github.com/rust-lang/crates.io-index"
37434127checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
37444128
4129추가: [[package]]
4130추가: name = "windows_x86_64_gnullvm"
4131추가: version = "0.53.1"
4132추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4133추가: checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
4134추가:
37454135[[package]]
37464136name = "windows_x86_64_msvc"
37474137version = "0.52.6"
37484138source = "registry+https://github.com/rust-lang/crates.io-index"
37494139checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
37504140
4141추가: [[package]]
4142추가: name = "windows_x86_64_msvc"
4143추가: version = "0.53.1"
4144추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4145추가: checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
4146추가:
37514147[[package]]
37524148name = "winit"
37534149version = "0.30.13"
@@ -3832,6 +4228,12 @@ dependencies = [
38324228 "wayland-protocols-wlr",
38334229]
38344230
4231추가: [[package]]
4232추가: name = "writeable"
4233추가: version = "0.6.4"
4234추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4235추가: checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
4236추가:
38354237[[package]]
38364238name = "x11-dl"
38374239version = "2.21.0"
@@ -3906,6 +4308,29 @@ dependencies = [
39064308 "pkg-config",
39074309]
39084310
4311추가: [[package]]
4312추가: name = "yoke"
4313추가: version = "0.8.4"
4314추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4315추가: checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3"
4316추가: dependencies = [
4317추가: "stable_deref_trait",
4318추가: "yoke-derive",
4319추가: "zerofrom",
4320추가: ]
4321추가:
4322추가: [[package]]
4323추가: name = "yoke-derive"
4324추가: version = "0.8.4"
4325추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4326추가: checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71"
4327추가: dependencies = [
4328추가: "proc-macro2",
4329추가: "quote",
4330추가: "syn 3.0.10",
4331추가: "synstructure",
4332추가: ]
4333추가:
39094334[[package]]
39104335name = "zbus"
39114336version = "5.19.0"
@@ -4032,6 +4457,27 @@ dependencies = [
40324457 "syn 2.0.119",
40334458]
40344459
4460추가: [[package]]
4461추가: name = "zerofrom"
4462추가: version = "0.1.8"
4463추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4464추가: checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272"
4465추가: dependencies = [
4466추가: "zerofrom-derive",
4467추가: ]
4468추가:
4469추가: [[package]]
4470추가: name = "zerofrom-derive"
4471추가: version = "0.1.8"
4472추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4473추가: checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a"
4474추가: dependencies = [
4475추가: "proc-macro2",
4476추가: "quote",
4477추가: "syn 3.0.10",
4478추가: "synstructure",
4479추가: ]
4480추가:
40354481[[package]]
40364482name = "zeroize"
40374483version = "1.9.1"
@@ -4052,6 +4498,39 @@ dependencies = [
40524498 "syn 2.0.119",
40534499]
40544500
4501추가: [[package]]
4502추가: name = "zerotrie"
4503추가: version = "0.2.5"
4504추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4505추가: checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f"
4506추가: dependencies = [
4507추가: "displaydoc",
4508추가: "yoke",
4509추가: "zerofrom",
4510추가: ]
4511추가:
4512추가: [[package]]
4513추가: name = "zerovec"
4514추가: version = "0.11.9"
4515추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4516추가: checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40"
4517추가: dependencies = [
4518추가: "yoke",
4519추가: "zerofrom",
4520추가: "zerovec-derive",
4521추가: ]
4522추가:
4523추가: [[package]]
4524추가: name = "zerovec-derive"
4525추가: version = "0.11.7"
4526추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4527추가: checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a"
4528추가: dependencies = [
4529추가: "proc-macro2",
4530추가: "quote",
4531추가: "syn 3.0.10",
4532추가: ]
4533추가:
40554534[[package]]
40564535name = "zip"
40574536version = "9.5.0"
@@ -4121,6 +4600,7 @@ name = "zipelo-ui-memory-app"
41214600version = "0.1.0"
41224601dependencies = [
41234602 "eframe",
4603추가: "rfd",
41244604 "wgpu",
41254605 "zipelo-app-core-memory",
41264606 "zipelo-archive-worker",
@@ -4156,6 +4636,7 @@ dependencies = [
41564636 "endi",
41574637 "enumflags2",
41584638 "serde",
4639추가: "url",
41594640 "winnow",
41604641 "zcheapstr",
41614642 "zvariant_derive",
수정experiments/rust-ui-memory-app/Cargo.toml+7-1
@@ -14,7 +14,7 @@ doctest = false
1414
1515[features]
1616default = []
17삭제: ui = ["dep:eframe", "dep:wgpu"]
17추가: ui = ["dep:eframe", "dep:wgpu", "dep:rfd"]
1818ui-fixture = ["ui"]
1919
2020[dependencies]
@@ -43,6 +43,12 @@ path = "../../tests/rust-app-real-worker/flows.rs"
4343name = "format_contract"
4444path = "../../tests/rust-app-real-worker/formats.rs"
4545
46추가: [target.'cfg(target_os = "linux")'.dependencies]
47추가: rfd = { version = "=0.16.0", optional = true, default-features = false, features = ["xdg-portal", "async-std"] }
48추가:
49추가: [target.'cfg(not(target_os = "linux"))'.dependencies]
50추가: rfd = { version = "=0.16.0", optional = true, default-features = false }
51추가:
4652[target.'cfg(target_os = "windows")'.dependencies]
4753wgpu = { version = "=30.0.1", optional = true, default-features = false, features = ["std", "dx12"] }
4854eframe = { version = "=0.37.0", optional = true, default-features = false, features = ["wgpu_no_default_features"] }
추가experiments/rust-ui-memory-app/src/archive_browser.rs+96-0
@@ -0,0 +1,96 @@
1추가: use crate::archive_ui::{Entry, Kind};
2추가: use std::collections::{BTreeMap, BTreeSet};
3추가:
4추가: #[derive(Clone, Debug)]
5추가: pub struct Row {
6추가: pub path: String,
7추가: pub name: String,
8추가: pub directory: bool,
9추가: pub ids: BTreeSet<u32>,
10추가: pub bytes: Option<u64>,
11추가: pub encrypted: bool,
12추가: }
13추가:
14추가: pub fn normalized(name: &str) -> Option<String> {
15추가: let name = name.replace('\\', "/");
16추가: let name = name.trim_end_matches('/');
17추가: if name.is_empty()
18추가: || name.starts_with('/')
19추가: || name.contains(':')
20추가: || name
21추가: .split('/')
22추가: .any(|part| part.is_empty() || part == "." || part == ".." || part.contains('\0'))
23추가: {
24추가: return None;
25추가: }
26추가: Some(name.to_owned())
27추가: }
28추가:
29추가: pub fn rows(entries: &[Entry], current: &str, query: &str) -> Vec<Row> {
30추가: let prefix = if current.is_empty() {
31추가: String::new()
32추가: } else {
33추가: format!("{current}/")
34추가: };
35추가: let mut rows = BTreeMap::<String, Row>::new();
36추가: for entry in entries {
37추가: let Some(path) = normalized(&entry.name) else {
38추가: continue;
39추가: };
40추가: let Some(relative) = path.strip_prefix(&prefix) else {
41추가: continue;
42추가: };
43추가: if relative.is_empty() {
44추가: continue;
45추가: }
46추가: let (name, implicit) = relative
47추가: .split_once('/')
48추가: .map_or((relative, false), |(first, _)| (first, true));
49추가: let directory = implicit || entry.kind == Kind::Directory;
50추가: let row = rows.entry(name.to_owned()).or_insert_with(|| Row {
51추가: path: format!("{prefix}{name}"),
52추가: name: name.to_owned(),
53추가: directory,
54추가: ids: BTreeSet::new(),
55추가: bytes: None,
56추가: encrypted: false,
57추가: });
58추가: row.directory |= directory;
59추가: if matches!(entry.kind, Kind::File | Kind::Directory) {
60추가: row.ids.insert(entry.id);
61추가: }
62추가: if !directory {
63추가: row.bytes = entry.bytes;
64추가: }
65추가: row.encrypted |= entry.encrypted;
66추가: }
67추가: let query = query.to_lowercase();
68추가: let mut rows = rows
69추가: .into_values()
70추가: .filter(|row| row.name.to_lowercase().contains(&query))
71추가: .collect::<Vec<_>>();
72추가: rows.sort_by(|a, b| {
73추가: b.directory
74추가: .cmp(&a.directory)
75추가: .then_with(|| a.name.cmp(&b.name))
76추가: });
77추가: rows
78추가: }
79추가:
80추가: pub fn expand_selection(entries: &[Entry], selected: &BTreeSet<u32>) -> BTreeSet<u32> {
81추가: let directories = entries
82추가: .iter()
83추가: .filter(|entry| entry.kind == Kind::Directory && selected.contains(&entry.id))
84추가: .filter_map(|entry| normalized(&entry.name).map(|path| format!("{path}/")))
85추가: .collect::<Vec<_>>();
86추가: entries
87추가: .iter()
88추가: .filter(|entry| {
89추가: selected.contains(&entry.id)
90추가: || normalized(&entry.name)
91추가: .is_some_and(|name| directories.iter().any(|prefix| name.starts_with(prefix)))
92추가: })
93추가: .filter(|entry| matches!(entry.kind, Kind::File | Kind::Directory))
94추가: .map(|entry| entry.id)
95추가: .collect()
96추가: }
추가experiments/rust-ui-memory-app/src/archive_dialog.rs+55-0
@@ -0,0 +1,55 @@
1추가: use std::path::PathBuf;
2추가:
3추가: #[derive(Clone, Copy, Debug, Eq, PartialEq)]
4추가: pub enum Purpose {
5추가: Open,
6추가: Files,
7추가: Folder,
8추가: Destination,
9추가: Retry,
10추가: SaveZip,
11추가: }
12추가:
13추가: #[derive(Clone, Debug)]
14추가: pub struct DialogRequest {
15추가: pub purpose: Purpose,
16추가: pub directory: PathBuf,
17추가: pub file_name: String,
18추가: }
19추가:
20추가: pub trait Dialogs {
21추가: fn choose(&mut self, request: DialogRequest) -> Result<Option<Vec<PathBuf>>, String>;
22추가: }
23추가:
24추가: #[derive(Default)]
25추가: pub struct NativeDialogs;
26추가:
27추가: impl Dialogs for NativeDialogs {
28추가: fn choose(&mut self, request: DialogRequest) -> Result<Option<Vec<PathBuf>>, String> {
29추가: let dialog = rfd::FileDialog::new().set_directory(request.directory);
30추가: let answer =
31추가: std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| match request.purpose {
32추가: Purpose::Open => dialog
33추가: .set_title("압축파일 열기")
34추가: .add_filter("압축파일", &["zip", "7z", "tar", "gz", "tgz"])
35추가: .pick_file()
36추가: .map(|path| vec![path]),
37추가: Purpose::Files => dialog.set_title("파일 추가").pick_files(),
38추가: Purpose::Folder => dialog
39추가: .set_title("폴더 추가")
40추가: .pick_folder()
41추가: .map(|path| vec![path]),
42추가: Purpose::Destination | Purpose::Retry => dialog
43추가: .set_title("압축을 풀 폴더 선택")
44추가: .pick_folder()
45추가: .map(|path| vec![path]),
46추가: Purpose::SaveZip => dialog
47추가: .set_title("ZIP 파일 저장")
48추가: .set_file_name(request.file_name)
49추가: .add_filter("ZIP 압축파일", &["zip"])
50추가: .save_file()
51추가: .map(|path| vec![path]),
52추가: }));
53추가: answer.map_err(|_| "파일 선택 창을 열지 못했습니다. 다시 시도하세요".to_owned())
54추가: }
55추가: }
삭제experiments/rust-ui-memory-app/src/archive_picker.rs+0-263
@@ -1,263 +0,0 @@
1삭제: use crate::{archive_present as present, archive_theme as theme};
2삭제: use eframe::egui::{self, Align, Layout};
3삭제: use std::path::{Path, PathBuf};
4삭제:
5삭제: #[derive(Clone, Copy, PartialEq)]
6삭제: pub enum Purpose {
7삭제: Open,
8삭제: Destination,
9삭제: Retry,
10삭제: Files,
11삭제: Folder,
12삭제: ZipFolder,
13삭제: }
14삭제:
15삭제: pub enum Choice {
16삭제: Cancel,
17삭제: Paths(Vec<PathBuf>),
18삭제: }
19삭제:
20삭제: pub struct Picker {
21삭제: pub purpose: Purpose,
22삭제: current: PathBuf,
23삭제: entries: Vec<present::BrowserEntry>,
24삭제: selected: Vec<PathBuf>,
25삭제: error: bool,
26삭제: }
27삭제:
28삭제: impl Picker {
29삭제: pub fn new(purpose: Purpose, start: &Path) -> Self {
30삭제: let current = if start.is_dir() {
31삭제: start.to_path_buf()
32삭제: } else {
33삭제: start
34삭제: .parent()
35삭제: .filter(|p| p.is_dir())
36삭제: .map(Path::to_path_buf)
37삭제: .unwrap_or_else(present::home_directory)
38삭제: };
39삭제: let mut picker = Self {
40삭제: purpose,
41삭제: current,
42삭제: entries: Vec::new(),
43삭제: selected: Vec::new(),
44삭제: error: false,
45삭제: };
46삭제: picker.reload();
47삭제: picker
48삭제: }
49삭제:
50삭제: fn reload(&mut self) {
51삭제: self.selected.clear();
52삭제: match present::directory_entries(&self.current) {
53삭제: Ok(entries) => {
54삭제: self.entries = entries;
55삭제: self.error = false;
56삭제: }
57삭제: Err(_) => {
58삭제: self.entries.clear();
59삭제: self.error = true;
60삭제: }
61삭제: }
62삭제: }
63삭제:
64삭제: fn directory_mode(&self) -> bool {
65삭제: matches!(
66삭제: self.purpose,
67삭제: Purpose::Destination | Purpose::Retry | Purpose::Folder | Purpose::ZipFolder
68삭제: )
69삭제: }
70삭제:
71삭제: pub fn show(&mut self, ctx: &egui::Context) -> Option<Choice> {
72삭제: let mut choice = None;
73삭제: let mut navigate = None;
74삭제: let width = (ctx.content_rect().width() - 64.0).min(720.0);
75삭제: let height = (ctx.content_rect().height() - 280.0).clamp(160.0, 340.0);
76삭제: let title = match self.purpose {
77삭제: Purpose::Open => "파일 열기",
78삭제: Purpose::Destination | Purpose::Retry => "풀 위치 선택",
79삭제: Purpose::Files => "묶을 파일 선택",
80삭제: Purpose::Folder => "묶을 폴더 선택",
81삭제: Purpose::ZipFolder => "ZIP 저장 폴더 선택",
82삭제: };
83삭제: let title = if self.purpose == Purpose::Open {
84삭제: "파일 열기"
85삭제: } else {
86삭제: title
87삭제: };
88삭제: let modal = egui::Modal::new(egui::Id::unique("archive-picker")).show(ctx, |ui| {
89삭제: ui.set_width(width);
90삭제: ui.heading(title);
91삭제: egui::ScrollArea::horizontal()
92삭제: .id_salt("breadcrumbs")
93삭제: .show(ui, |ui| {
94삭제: ui.horizontal(|ui| {
95삭제: let mut ancestors = self.current.ancestors().collect::<Vec<_>>();
96삭제: ancestors.reverse();
97삭제: for path in ancestors {
98삭제: let label = path
99삭제: .file_name()
100삭제: .unwrap_or(path.as_os_str())
101삭제: .to_string_lossy();
102삭제: if ui
103삭제: .button(label.as_ref())
104삭제: .on_hover_text(path.display().to_string())
105삭제: .clicked()
106삭제: {
107삭제: navigate = Some(path.to_path_buf());
108삭제: }
109삭제: }
110삭제: });
111삭제: });
112삭제: ui.separator();
113삭제: ui.horizontal_top(|ui| {
114삭제: ui.allocate_ui_with_layout(
115삭제: egui::vec2(128.0, height),
116삭제: Layout::top_down(Align::Min),
117삭제: |ui| {
118삭제: ui.set_min_size(egui::vec2(128.0, height));
119삭제: for (label, path) in present::shortcuts() {
120삭제: if theme::action(ui, &label, false, true).clicked() {
121삭제: navigate = Some(path);
122삭제: }
123삭제: }
124삭제: if let Some(parent) = self.current.parent() {
125삭제: if theme::action(ui, "상위 폴더", false, true).clicked() {
126삭제: navigate = Some(parent.to_path_buf());
127삭제: }
128삭제: }
129삭제: },
130삭제: );
131삭제: ui.add_space(theme::SPACE);
132삭제: ui.allocate_ui_with_layout(
133삭제: egui::vec2((width - 160.0).max(240.0), height),
134삭제: Layout::top_down(Align::Min),
135삭제: |ui| {
136삭제: ui.set_min_size(egui::vec2((width - 160.0).max(240.0), height));
137삭제: if self.error {
138삭제: ui.colored_label(
139삭제: theme::ERROR,
140삭제: "이 폴더를 열 수 없습니다. 접근 권한을 확인하세요",
141삭제: );
142삭제: } else if self.entries.is_empty() {
143삭제: ui.label("이 폴더는 비어 있습니다");
144삭제: }
145삭제: egui::ScrollArea::vertical()
146삭제: .id_salt("picker-entries")
147삭제: .max_height(height)
148삭제: .show_rows(ui, theme::ROW, self.entries.len(), |ui, rows| {
149삭제: for index in rows {
150삭제: let entry = &self.entries[index];
151삭제: let selected = self.selected.contains(&entry.path);
152삭제: let response = ui
153삭제: .horizontal(|ui| {
154삭제: theme::icon(
155삭제: ui,
156삭제: if entry.directory {
157삭제: theme::Icon::Folder
158삭제: } else {
159삭제: theme::Icon::File
160삭제: },
161삭제: 20.0,
162삭제: );
163삭제: let name = if entry.link {
164삭제: format!("{} (링크)", entry.name)
165삭제: } else {
166삭제: entry.name.clone()
167삭제: };
168삭제: ui.add_sized(
169삭제: [ui.available_width(), theme::ROW],
170삭제: egui::Button::new("")
171삭제: .left_text(present::middle_text(&name, 38))
172삭제: .selected(selected),
173삭제: )
174삭제: .on_hover_text(entry.path.display().to_string())
175삭제: })
176삭제: .inner;
177삭제: theme::focus(&response);
178삭제: if response.clicked() {
179삭제: if self.purpose == Purpose::Files
180삭제: && ui.input(|i| i.modifiers.command || i.modifiers.ctrl)
181삭제: {
182삭제: if selected {
183삭제: self.selected.retain(|p| p != &entry.path);
184삭제: } else if !entry.directory {
185삭제: self.selected.push(entry.path.clone());
186삭제: }
187삭제: } else {
188삭제: self.selected = vec![entry.path.clone()];
189삭제: }
190삭제: }
191삭제: let keyboard_activation = response.has_focus()
192삭제: && ui.input(|i| {
193삭제: i.key_pressed(egui::Key::Enter)
194삭제: || i.key_pressed(egui::Key::Space)
195삭제: });
196삭제: if response.double_clicked() || keyboard_activation {
197삭제: if entry.directory && !entry.link {
198삭제: navigate = Some(entry.path.clone());
199삭제: } else if !self.directory_mode() {
200삭제: choice = Some(Choice::Paths(vec![entry.path.clone()]));
201삭제: }
202삭제: }
203삭제: }
204삭제: });
205삭제: },
206삭제: );
207삭제: });
208삭제: ui.separator();
209삭제: ui.horizontal(|ui| {
210삭제: if self.purpose == Purpose::Files {
211삭제: ui.label("Ctrl을 누르면 여러 파일을 고를 수 있습니다");
212삭제: }
213삭제: ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
214삭제: let selected_directory = self.selected.first().filter(|path| {
215삭제: self.entries
216삭제: .iter()
217삭제: .any(|e| &e.path == *path && (e.directory || e.link))
218삭제: });
219삭제: let paths = if self.directory_mode() {
220삭제: vec![
221삭제: selected_directory
222삭제: .cloned()
223삭제: .unwrap_or_else(|| self.current.clone()),
224삭제: ]
225삭제: } else {
226삭제: self.selected
227삭제: .iter()
228삭제: .filter(|path| {
229삭제: self.entries
230삭제: .iter()
231삭제: .any(|e| &e.path == *path && !e.directory)
232삭제: })
233삭제: .cloned()
234삭제: .collect()
235삭제: };
236삭제: let label = if self.directory_mode() {
237삭제: "이 폴더 선택"
238삭제: } else if self.purpose == Purpose::Files {
239삭제: "추가"
240삭제: } else {
241삭제: "열기"
242삭제: };
243삭제: let enabled = !paths.is_empty() && !self.error;
244삭제: let (cancel, confirm) = theme::action_pair(ui, "취소", Some((label, enabled)));
245삭제: if navigate.is_none() && confirm {
246삭제: choice = Some(Choice::Paths(paths));
247삭제: }
248삭제: if cancel {
249삭제: choice = Some(Choice::Cancel);
250삭제: }
251삭제: });
252삭제: });
253삭제: });
254삭제: if modal.should_close() {
255삭제: choice = Some(Choice::Cancel);
256삭제: }
257삭제: if let Some(path) = navigate {
258삭제: self.current = path;
259삭제: self.reload();
260삭제: }
261삭제: choice
262삭제: }
263삭제: }
수정experiments/rust-ui-memory-app/src/archive_screen.rs+411-410
@@ -1,5 +1,6 @@
11use crate::{
2삭제: archive_picker::{Choice, Picker, Purpose},
2추가: archive_browser as browser,
3추가: archive_dialog::{DialogRequest, Dialogs, NativeDialogs, Purpose},
34 archive_present as present,
45 archive_theme::{self as theme, Icon},
56 archive_ui::*,
@@ -28,8 +29,9 @@ pub struct ArchiveApp {
2829 create: bool,
2930 selected_only: bool,
3031 method: Method,
31삭제: fixture: bool,
32삭제: picker: Option<Picker>,
32추가: dialogs: Box<dyn Dialogs>,
33추가: folder: String,
34추가: search: String,
3335 last_request: Option<Start>,
3436 targets: Option<BTreeSet<String>>,
3537 directories: BTreeSet<String>,
@@ -41,7 +43,7 @@ pub struct ArchiveApp {
4143}
4244
4345impl ArchiveApp {
44삭제: pub fn new(factory: Box<dyn Factory>, startup: Option<PathBuf>, fixture: bool) -> Self {
46추가: pub fn new(factory: Box<dyn Factory>, startup: Option<PathBuf>, _fixture: bool) -> Self {
4547 let mut app = Self {
4648 model: Model::default(),
4749 factory,
@@ -60,8 +62,9 @@ impl ArchiveApp {
6062 create: false,
6163 selected_only: false,
6264 method: Method::Deflate,
63삭제: fixture,
64삭제: picker: None,
65추가: dialogs: Box::new(NativeDialogs),
66추가: folder: String::new(),
67추가: search: String::new(),
6568 last_request: None,
6669 targets: None,
6770 directories: BTreeSet::new(),
@@ -77,6 +80,23 @@ impl ArchiveApp {
7780 app
7881 }
7982
83추가: pub fn set_dialogs(&mut self, dialogs: Box<dyn Dialogs>) {
84추가: self.dialogs = dialogs;
85추가: }
86추가:
87추가: pub fn browse_folder(&mut self, folder: &str) {
88추가: self.folder = folder.trim_matches('/').to_owned();
89추가: self.search.clear();
90추가: }
91추가:
92추가: pub fn show_create(&mut self, encrypted: bool) {
93추가: if !self.model.busy() {
94추가: self.create = true;
95추가: self.aes256 = encrypted;
96추가: self.ui_error = None;
97추가: }
98추가: }
99추가:
80100 fn clear_password(&mut self) {
81101 for value in [&mut self.password, &mut self.password_confirm] {
82102 let mut bytes = std::mem::take(value).into_bytes();
@@ -100,6 +120,8 @@ impl ArchiveApp {
100120 .unwrap_or("압축 해제 파일")
101121 .into();
102122 self.selected_only = false;
123추가: self.folder.clear();
124추가: self.search.clear();
103125 self.targets = None;
104126 self.directories.clear();
105127 self.start(Start::List { archive });
@@ -124,6 +146,31 @@ impl ArchiveApp {
124146 if self.model.busy() {
125147 return;
126148 }
149추가: let mut validated = Vec::new();
150추가: for path in paths {
151추가: let Ok(metadata) = std::fs::symlink_metadata(&path) else {
152추가: self.ui_error = Some("파일이나 폴더를 찾지 못했습니다. 다시 선택하세요".into());
153추가: return;
154추가: };
155추가: if metadata.file_type().is_symlink() || !(metadata.is_file() || metadata.is_dir()) {
156추가: self.ui_error = Some("일반 파일과 폴더만 추가할 수 있습니다".into());
157추가: return;
158추가: }
159추가: let Ok(path) = path.canonicalize() else {
160추가: return;
161추가: };
162추가: if path.to_str().is_none()
163추가: || !path
164추가: .file_name()
165추가: .and_then(|name| name.to_str())
166추가: .is_some_and(valid_leaf)
167추가: {
168추가: self.ui_error = Some("파일이나 폴더의 이름을 확인하세요".into());
169추가: return;
170추가: }
171추가: validated.push(path);
172추가: }
173추가: let paths = validated;
127174 if self.sources.is_empty() {
128175 if let Some(first) = paths.first() {
129176 self.zip_folder = first.parent().unwrap_or(Path::new("/")).to_path_buf();
@@ -161,7 +208,11 @@ impl ArchiveApp {
161208 .as_ref()
162209 .is_some_and(|id| id.format == Format::Gzip);
163210 let selection = if self.selected_only {
164삭제: Selection::EntryIds(self.model.selected.iter().copied().collect())
211추가: Selection::EntryIds(
212추가: browser::expand_selection(&self.model.entries, &self.model.selected)
213추가: .into_iter()
214추가: .collect(),
215추가: )
165216 } else {
166217 Selection::All
167218 };
@@ -232,24 +283,66 @@ impl ArchiveApp {
232283 }
233284
234285 fn open_picker(&mut self, purpose: Purpose) {
235삭제: let start = match purpose {
236삭제: Purpose::Destination | Purpose::Retry => self.destination.clone(),
237삭제: Purpose::ZipFolder => self.zip_folder.clone(),
238삭제: Purpose::Open => self
286추가: if self.model.busy() {
287추가: return;
288추가: }
289추가: let directory = match purpose {
290추가: Purpose::SaveZip => self.zip_folder.clone(),
291추가: Purpose::Destination => self
239292 .model
240293 .archive
241삭제: .as_deref()
242삭제: .and_then(Path::parent)
294추가: .as_ref()
295추가: .and_then(|path| path.parent())
243296 .map(Path::to_path_buf)
244297 .unwrap_or_else(present::home_directory),
298추가: Purpose::Retry => self.destination.clone(),
245299 _ => self
246300 .sources
247301 .last()
248삭제: .and_then(|p| p.parent())
302추가: .and_then(|path| path.parent())
249303 .map(Path::to_path_buf)
250304 .unwrap_or_else(present::home_directory),
251305 };
252삭제: self.picker = Some(Picker::new(purpose, &start));
306추가: let request = DialogRequest {
307추가: purpose,
308추가: directory,
309추가: file_name: self.zip_name.clone(),
310추가: };
311추가: match self.dialogs.choose(request) {
312추가: Ok(Some(paths)) if !paths.is_empty() => {
313추가: let path = paths[0].clone();
314추가: match purpose {
315추가: Purpose::Open => {
316추가: if std::fs::symlink_metadata(&path)
317추가: .is_ok_and(|m| m.is_file() && !m.file_type().is_symlink())
318추가: {
319추가: self.open_path(path);
320추가: } else {
321추가: self.ui_error = Some("일반 압축파일을 선택하세요".into());
322추가: }
323추가: }
324추가: Purpose::Files | Purpose::Folder => self.add_sources(paths),
325추가: Purpose::Destination | Purpose::Retry => {
326추가: self.choose_destination(path);
327추가: self.selected_only = !self.model.selected.is_empty();
328추가: if purpose == Purpose::Retry {
329추가: self.retry();
330추가: } else {
331추가: self.begin_extract();
332추가: }
333추가: }
334추가: Purpose::SaveZip => {
335추가: if let Some(name) = path.file_name().and_then(|name| name.to_str()) {
336추가: self.zip_name = name.to_owned();
337추가: self.zip_folder = path.parent().unwrap_or(Path::new("/")).to_path_buf();
338추가: self.begin_zip();
339추가: }
340추가: }
341추가: }
342추가: }
343추가: Ok(_) => {}
344추가: Err(error) => self.ui_error = Some(error),
345추가: }
253346 }
254347
255348 fn retry(&mut self) {
@@ -278,34 +371,18 @@ impl ArchiveApp {
278371 }
279372 }
280373
281삭제: fn show_picker(&mut self, ctx: &egui::Context) {
282삭제: let answer = self.picker.as_mut().and_then(|picker| picker.show(ctx));
283삭제: if let Some(answer) = answer {
284삭제: let purpose = self.picker.take().unwrap().purpose;
285삭제: if let Choice::Paths(paths) = answer {
286삭제: if let Some(path) = paths.first() {
287삭제: match purpose {
288삭제: Purpose::Open => self.open_path(path.clone()),
289삭제: Purpose::Destination | Purpose::Retry => {
290삭제: self.choose_destination(path.clone());
291삭제: if purpose == Purpose::Retry {
292삭제: self.retry();
293삭제: }
294삭제: }
295삭제: Purpose::ZipFolder => self.zip_folder = path.clone(),
296삭제: Purpose::Files | Purpose::Folder => self.add_sources(paths),
297삭제: }
298삭제: }
299삭제: }
300삭제: }
301삭제: }
302삭제:
303374 fn on_drop(&mut self, paths: Vec<PathBuf>) {
304삭제: if self.model.busy() || paths.is_empty() || self.picker.is_some() {
375추가: if self.model.busy() || paths.is_empty() {
305376 return;
306377 }
307378 if paths.len() == 1 && !self.create && !paths[0].is_dir() {
308삭제: self.open_path(paths[0].clone());
379추가: if std::fs::symlink_metadata(&paths[0])
380추가: .is_ok_and(|m| m.is_file() && !m.file_type().is_symlink())
381추가: {
382추가: self.open_path(paths[0].clone());
383추가: } else {
384추가: self.ui_error = Some("일반 압축파일을 선택하세요".into());
385추가: }
309386 } else {
310387 self.add_sources(paths);
311388 }
@@ -358,45 +435,79 @@ impl ArchiveApp {
358435 if self.model.close == Close::Allowed {
359436 ctx.send_viewport_cmd(egui::ViewportCommand::Close);
360437 }
438추가: let title = self
439추가: .model
440추가: .archive
441추가: .as_ref()
442추가: .map(|path| {
443추가: let full = if path.is_absolute() {
444추가: path.clone()
445추가: } else {
446추가: std::env::current_dir().unwrap_or_default().join(path)
447추가: };
448추가: format!("{} — Zipelo", full.display())
449추가: })
450추가: .unwrap_or_else(|| "Zipelo".into());
451추가: ctx.send_viewport_cmd(egui::ViewportCommand::Title(title));
361452 egui::Panel::top("archive-actions")
362삭제: .frame(theme::panel(theme::PANEL).corner_radius(0))
453추가: .frame(
454추가: theme::panel(theme::PANEL)
455추가: .corner_radius(0)
456추가: .inner_margin(egui::Margin::symmetric(16, 4)),
457추가: )
458추가: .show(root, |ui| {
459추가: ui.horizontal(|ui| {
460추가: let idle = !self.model.busy() && self.model.close == Close::Open;
461추가: if theme::tool(ui, "열기", theme::OPEN, idle, false).clicked() {
462추가: self.open_picker(Purpose::Open);
463추가: }
464추가: if theme::tool(ui, "압축하기", theme::CREATE, idle, false).clicked() {
465추가: self.show_create(false);
466추가: }
467추가: if theme::tool(
468추가: ui,
469추가: "압축해제",
470추가: theme::EXTRACT,
471추가: self.model.can_extract(),
472추가: true,
473추가: )
474추가: .clicked()
475추가: {
476추가: self.open_picker(Purpose::Destination);
477추가: }
478추가: if theme::tool(ui, "암호화", theme::PROTECT, idle, false).clicked() {
479추가: self.show_create(true);
480추가: }
481추가: });
482추가: });
483추가: egui::Panel::bottom("archive-status")
484추가: .frame(
485추가: theme::panel(theme::STRIPE)
486추가: .corner_radius(0)
487추가: .inner_margin(egui::Margin::symmetric(16, 8)),
488추가: )
363489 .show(root, |ui| {
364490 ui.horizontal(|ui| {
365삭제: theme::icon(ui, Icon::Archive, 24.0);
366삭제: ui.heading("Zipelo");
491추가: ui.label(format!(
492추가: "{}개 항목",
493추가: browser::rows(&self.model.entries, &self.folder, &self.search).len()
494추가: ));
367495 ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
368삭제: if theme::action(
369삭제: ui,
370삭제: "ZIP 만들기",
371삭제: false,
372삭제: !self.model.busy() && self.model.close == Close::Open,
373삭제: )
374삭제: .on_disabled_hover_text("작업이 끝나면 ZIP을 만들 수 있습니다")
375삭제: .clicked()
376삭제: {
377삭제: self.create = true;
378삭제: self.ui_error = None;
379삭제: }
496추가: ui.label(format!("선택 {}개", self.model.selected.len()));
380497 });
381498 });
382삭제: if self.fixture {
383삭제: ui.colored_label(
384삭제: theme::WARNING,
385삭제: "화면 시험 모드 / 파일을 읽거나 저장하지 않습니다",
386삭제: );
387삭제: }
388499 });
389삭제: if self.model.archive.is_some()
390삭제: || self.model.busy()
391삭제: || self.result_visible()
392삭제: || self.ui_error.is_some()
393삭제: {
500추가: if self.model.busy() || self.result_visible() || self.ui_error.is_some() {
394501 egui::Panel::bottom("archive-work")
395502 .frame(theme::panel(theme::PANEL).corner_radius(0))
396503 .show(root, |ui| self.work_area(ui));
397504 }
398505 egui::CentralPanel::default()
399삭제: .frame(theme::panel(theme::BACKGROUND))
506추가: .frame(
507추가: theme::panel(theme::PANEL)
508추가: .corner_radius(0)
509추가: .inner_margin(egui::Margin::ZERO),
510추가: )
400511 .show(root, |ui| {
401512 if self.model.archive.is_some() {
402513 self.archive_list(ui);
@@ -407,7 +518,6 @@ impl ArchiveApp {
407518 if self.create && !self.model.busy() {
408519 self.create_dialog(&ctx);
409520 }
410삭제: self.show_picker(&ctx);
411521 if self.model.challenge.is_some() {
412522 self.password_dialog(&ctx, new_challenge);
413523 }
@@ -492,222 +602,170 @@ impl ArchiveApp {
492602 }
493603
494604 fn archive_list(&mut self, ui: &mut egui::Ui) {
495삭제: let archive = self.model.archive.as_ref().unwrap().clone();
496삭제: ui.horizontal(|ui| {
497삭제: theme::icon(ui, Icon::Archive, 32.0);
498삭제: let name = archive.file_name().unwrap_or_default().to_string_lossy();
499삭제: let limit = ((ui.available_width() - 144.0) / theme::TITLE).max(10.0) as usize;
500삭제: ui.heading(present::middle_text(&name, limit))
501삭제: .on_hover_text(archive.display().to_string());
502삭제: ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
503삭제: if theme::action(ui, "다른 파일", false, !self.model.busy()).clicked() {
504삭제: self.open_picker(Purpose::Open);
605추가: theme::panel(theme::STRIPE).corner_radius(0).show(ui, |ui| {
606추가: ui.horizontal(|ui| {
607추가: let up = theme::icon_button(
608추가: ui,
609추가: "위로",
610추가: theme::UP,
611추가: !self.folder.is_empty() && !self.model.busy(),
612추가: );
613추가: if up.clicked() {
614추가: let parent = self
615추가: .folder
616추가: .rsplit_once('/')
617추가: .map_or("", |(parent, _)| parent)
618추가: .to_owned();
619추가: self.browse_folder(&parent);
505620 }
621추가: ui.label("현재 경로");
622추가: let mut path = format!("/{}", self.folder);
623추가: ui.add_sized(
624추가: [ui.available_width() - 270.0, 36.0],
625추가: egui::TextEdit::singleline(&mut path).interactive(false),
626추가: );
627추가: let (rect, _) =
628추가: ui.allocate_exact_size(egui::vec2(20.0, 20.0), egui::Sense::hover());
629추가: theme::svg_icon(ui.painter(), rect, theme::SEARCH, theme::MUTED);
630추가: let search = ui.add_sized(
631추가: [220.0, 36.0],
632추가: egui::TextEdit::singleline(&mut self.search)
633추가: .id(egui::Id::unique("archive-search"))
634추가: .hint_text("파일 찾기"),
635추가: );
636추가: theme::focus(&search);
506637 });
507638 });
508삭제: let bytes = self
509삭제: .model
510삭제: .entries
511삭제: .iter()
512삭제: .filter_map(|entry| entry.bytes)
513삭제: .sum();
514삭제: ui.colored_label(
515삭제: theme::MUTED,
516삭제: format!(
517삭제: "항목 {}개, {}",
518삭제: self.model.entries.len(),
519삭제: present::bytes_text(bytes)
520삭제: ),
521삭제: );
522삭제: ui.add_space(theme::SPACE);
523삭제: let selectable = self
524삭제: .model
525삭제: .entries
639추가: let rows = browser::rows(&self.model.entries, &self.folder, &self.search);
640추가: let visible = rows
526641 .iter()
527삭제: .filter(|e| matches!(e.kind, Kind::File | Kind::Directory))
528삭제: .map(|e| e.id)
642추가: .flat_map(|row| row.ids.iter().copied())
529643 .collect::<BTreeSet<_>>();
530삭제: let mut all = !selectable.is_empty() && selectable.is_subset(&self.model.selected);
531삭제: let widths =
532삭제: (ui.available_width() - 32.0 - 96.0 - 64.0 - theme::SPACE * 4.0 - 32.0).max(160.0);
533삭제: theme::panel(theme::PANEL)
534삭제: .inner_margin(egui::Margin::symmetric(theme::SPACE as i8, 0))
535삭제: .show(ui, |ui| {
536삭제: ui.horizontal(|ui| {
537삭제: let response = ui
538삭제: .add_enabled(
539삭제: !self.model.busy() && !selectable.is_empty(),
540삭제: egui::Checkbox::without_text(&mut all),
541삭제: )
542삭제: .on_hover_text("전체 선택");
543삭제: response.widget_info(|| {
544삭제: egui::WidgetInfo::selected(
545삭제: egui::Role::CheckBox,
546삭제: !self.model.busy(),
547삭제: all,
548삭제: "전체 선택",
549삭제: )
550삭제: });
551삭제: theme::focus(&response);
552삭제: if response.changed() {
553삭제: self.model.selected = if all {
554삭제: selectable.clone()
555삭제: } else {
556삭제: BTreeSet::new()
557삭제: };
558삭제: }
559삭제: theme::column_label(ui, RichText::new("이름").strong(), widths, Align::Min);
560삭제: theme::column_label(ui, "크기", 96.0, Align::Max);
561삭제: theme::column_label(ui, "암호", 64.0, Align::Min);
562삭제: });
563삭제: ui.separator();
564삭제: if self.model.entries.is_empty() {
565삭제: ui.vertical_centered(|ui| {
566삭제: ui.add_space(theme::SPACE * 8.0);
567삭제: ui.label(if self.model.list_id.is_some() {
568삭제: "이 압축파일은 비어 있습니다"
569삭제: } else {
570삭제: "압축파일을 읽는 중"
571삭제: });
572삭제: });
644추가: let mut all = !visible.is_empty() && visible.is_subset(&self.model.selected);
645추가: let name_width = (ui.available_width() - 32.0 - 96.0 - 64.0 - 64.0).max(160.0);
646추가: ui.horizontal(|ui| {
647추가: ui.add_space(16.0);
648추가: let check = ui
649추가: .add_enabled(
650추가: !self.model.busy() && !visible.is_empty(),
651추가: egui::Checkbox::without_text(&mut all),
652추가: )
653추가: .on_hover_text("전체 선택");
654추가: if check.changed() {
655추가: if all {
656추가: self.model.selected.extend(&visible);
573657 } else {
574삭제: egui::ScrollArea::vertical()
575삭제: .id_salt("archive-rows")
576삭제: .auto_shrink([false, false])
577삭제: .show_rows(ui, theme::ROW, self.model.entries.len(), |ui, rows| {
578삭제: for index in rows {
579삭제: let entry = &self.model.entries[index];
580삭제: let enabled = !self.model.busy()
581삭제: && matches!(entry.kind, Kind::File | Kind::Directory);
582삭제: let mut selected = self.model.selected.contains(&entry.id);
583삭제: let width = ui.available_width();
584삭제: let (rect, row) = ui.allocate_exact_size(
585삭제: egui::vec2(width, theme::ROW),
586삭제: if enabled {
587삭제: egui::Sense::click()
588삭제: } else {
589삭제: egui::Sense::hover()
590삭제: },
591삭제: );
592삭제: ui.painter().rect_filled(
593삭제: rect,
594삭제: 0,
595삭제: if selected {
596삭제: theme::SELECTED
597삭제: } else if index % 2 == 0 {
598삭제: theme::PANEL
599삭제: } else {
600삭제: theme::STRIPE
601삭제: },
602삭제: );
603삭제: let mut changed = false;
604삭제: ui.scope_builder(
605삭제: egui::UiBuilder::new()
606삭제: .max_rect(rect)
607삭제: .layout(Layout::left_to_right(Align::Center)),
658추가: self.model.selected.retain(|id| !visible.contains(id));
659추가: }
660추가: }
661추가: theme::focus(&check);
662추가: theme::column_label(ui, RichText::new("이름").strong(), name_width, Align::Min);
663추가: theme::column_label(ui, "크기", 96.0, Align::Max);
664추가: theme::column_label(ui, "암호", 64.0, Align::Min);
665추가: });
666추가: ui.separator();
667추가: egui::ScrollArea::vertical()
668추가: .id_salt("archive-rows")
669추가: .auto_shrink([false, false])
670추가: .show_rows(ui, 38.0, rows.len(), |ui, range| {
671추가: for index in range {
672추가: let row = &rows[index];
673추가: let mut selected =
674추가: !row.ids.is_empty() && row.ids.is_subset(&self.model.selected);
675추가: let response = ui
676추가: .horizontal(|ui| {
677추가: ui.set_min_height(36.0);
678추가: ui.add_space(16.0);
679추가: let check = ui.add_enabled(
680추가: !self.model.busy() && !row.ids.is_empty(),
681추가: egui::Checkbox::without_text(&mut selected),
682추가: );
683추가: check.widget_info(|| {
684추가: egui::WidgetInfo::selected(
685추가: egui::Role::CheckBox,
686추가: !self.model.busy(),
687추가: selected,
688추가: &row.name,
689추가: )
690추가: });
691추가: theme::focus(&check);
692추가: if check.changed() {
693추가: if selected {
694추가: self.model.selected.extend(&row.ids);
695추가: } else {
696추가: self.model.selected.retain(|id| !row.ids.contains(id));
697추가: }
698추가: }
699추가: theme::icon(
700추가: ui,
701추가: if row.directory {
702추가: Icon::Folder
703추가: } else {
704추가: Icon::File
705추가: },
706추가: 20.0,
707추가: );
708추가: let label = ui
709추가: .allocate_ui_with_layout(
710추가: egui::vec2(name_width - 28.0, 34.0),
711추가: Layout::left_to_right(Align::Center),
608712 |ui| {
609삭제: let check = ui.add_enabled(
610삭제: enabled,
611삭제: egui::Checkbox::without_text(&mut selected),
612삭제: );
613삭제: check.widget_info(|| {
614삭제: egui::WidgetInfo::selected(
615삭제: egui::Role::CheckBox,
616삭제: enabled,
617삭제: selected,
618삭제: &entry.name,
619삭제: )
620삭제: });
621삭제: theme::focus(&check);
622삭제: changed = check.changed();
623삭제: ui.allocate_ui_with_layout(
624삭제: egui::vec2(widths, theme::ROW),
625삭제: Layout::left_to_right(Align::Center),
626삭제: |ui| {
627삭제: ui.set_min_width(widths);
628삭제: theme::icon(
629삭제: ui,
630삭제: if entry.kind == Kind::Directory {
631삭제: Icon::Folder
632삭제: } else {
633삭제: Icon::File
634삭제: },
635삭제: 20.0,
636삭제: );
637삭제: let name = if matches!(
638삭제: entry.kind,
639삭제: Kind::Link | Kind::Other
640삭제: ) {
641삭제: format!("{} (링크)", entry.name)
642삭제: } else {
643삭제: entry.name.clone()
644삭제: };
645삭제: let limit = ((widths - 32.0) / theme::BODY).max(8.0)
646삭제: as usize;
647삭제: ui.label(present::middle_text(&name, limit));
648삭제: },
649삭제: );
650삭제: ui.allocate_ui_with_layout(
651삭제: egui::vec2(96.0, theme::ROW),
652삭제: Layout::right_to_left(Align::Center),
653삭제: |ui| {
654삭제: ui.set_min_width(96.0);
655삭제: ui.label(entry.bytes.map_or_else(
656삭제: || "알 수 없음".into(),
657삭제: present::bytes_text,
658삭제: ));
659삭제: },
660삭제: );
661삭제: ui.allocate_ui_with_layout(
662삭제: egui::vec2(64.0, theme::ROW),
663삭제: Layout::left_to_right(Align::Center),
664삭제: |ui| {
665삭제: ui.set_min_width(64.0);
666삭제: if entry.encrypted {
667삭제: theme::icon(ui, Icon::Lock, 16.0);
668삭제: ui.label("있음");
669삭제: }
670삭제: },
671삭제: );
672삭제: },
673삭제: );
674삭제: row.widget_info(|| {
675삭제: egui::WidgetInfo::selected(
676삭제: egui::Role::Button,
677삭제: enabled,
678삭제: selected,
679삭제: &entry.name,
680삭제: )
681삭제: });
682삭제: row.clone().on_hover_text(&entry.name);
683삭제: theme::focus(&row);
684삭제: let content = ui.interact(
685삭제: egui::Rect::from_min_max(
686삭제: rect.min + egui::vec2(32.0, 0.0),
687삭제: rect.max,
688삭제: ),
689삭제: row.id.with("content"),
690삭제: if enabled {
691삭제: egui::Sense::CLICK
692삭제: } else {
693삭제: egui::Sense::hover()
713추가: ui.set_min_width(name_width - 28.0);
714추가: ui.add_enabled(
715추가: !self.model.busy(),
716추가: egui::Button::new(&row.name)
717추가: .selected(selected)
718추가: .frame(false)
719추가: .min_size(egui::vec2(0.0, 34.0)),
720추가: )
694721 },
695삭제: );
696삭제: if enabled && !changed && (row.clicked() || content.clicked()) {
697삭제: selected = !selected;
698삭제: changed = true;
699삭제: }
700삭제: if changed {
701삭제: if selected {
702삭제: self.model.selected.insert(entry.id);
703삭제: } else {
704삭제: self.model.selected.remove(&entry.id);
705삭제: }
722추가: )
723추가: .inner;
724추가: theme::focus(&label);
725추가: let enter =
726추가: label.has_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter));
727추가: if row.directory && (label.double_clicked() || enter) {
728추가: self.browse_folder(&row.path);
729추가: } else if !row.directory && label.clicked() {
730추가: if selected {
731추가: self.model.selected.retain(|id| !row.ids.contains(id));
732추가: } else {
733추가: self.model.selected.extend(&row.ids);
706734 }
707735 }
708삭제: });
736추가: theme::column_label(
737추가: ui,
738추가: if row.directory {
739추가: "0 B".into()
740추가: } else {
741추가: row.bytes
742추가: .map(present::bytes_text)
743추가: .unwrap_or_else(|| "—".into())
744추가: },
745추가: 96.0,
746추가: Align::Max,
747추가: );
748추가: if row.encrypted {
749추가: theme::icon(ui, Icon::Lock, 16.0);
750추가: }
751추가: })
752추가: .response;
753추가: ui.painter().hline(
754추가: response.rect.x_range(),
755추가: response.rect.bottom(),
756추가: egui::Stroke::new(1.0, theme::BORDER),
757추가: );
709758 }
710759 });
760추가: if rows.is_empty() {
761추가: ui.centered_and_justified(|ui| {
762추가: ui.label(if self.search.is_empty() {
763추가: "이 폴더는 비어 있습니다"
764추가: } else {
765추가: "일치하는 항목이 없습니다"
766추가: });
767추가: });
768추가: }
711769 }
712770
713771 fn result_visible(&self) -> bool {
@@ -729,53 +787,6 @@ impl ArchiveApp {
729787 self.progress(ui);
730788 } else if self.result_visible() {
731789 self.result(ui);
732삭제: } else if self.model.list_id.is_some() {
733삭제: ui.horizontal(|ui| {
734삭제: ui.strong("풀 위치");
735삭제: let width = ui.available_width() - 136.0;
736삭제: theme::column_label(
737삭제: ui,
738삭제: present::middle_text(
739삭제: &self.destination.display().to_string(),
740삭제: (width / theme::BODY).max(10.0) as usize,
741삭제: ),
742삭제: width,
743삭제: Align::Min,
744삭제: )
745삭제: .on_hover_text(self.destination.display().to_string());
746삭제: if theme::action(ui, "폴더 바꾸기", false, true).clicked() {
747삭제: self.open_picker(Purpose::Destination);
748삭제: }
749삭제: });
750삭제: if self
751삭제: .model
752삭제: .list_id
753삭제: .as_ref()
754삭제: .is_some_and(|id| id.format == Format::Gzip)
755삭제: {
756삭제: ui.horizontal(|ui| {
757삭제: ui.label("저장할 파일 이름");
758삭제: let edit = ui.add(
759삭제: egui::TextEdit::singleline(&mut self.gzip_name)
760삭제: .id(egui::Id::unique("gzip-name")),
761삭제: );
762삭제: theme::focus(&edit);
763삭제: });
764삭제: }
765삭제: ui.horizontal(|ui| {
766삭제: let response = ui.checkbox(&mut self.selected_only, "선택한 항목만 풀기");
767삭제: theme::focus(&response);
768삭제: ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
769삭제: let enabled = self.model.can_extract()
770삭제: && (!self.selected_only || !self.model.selected.is_empty());
771삭제: if theme::action(ui, "풀기", true, enabled)
772삭제: .on_disabled_hover_text("풀 항목을 선택하세요")
773삭제: .clicked()
774삭제: {
775삭제: self.begin_extract();
776삭제: }
777삭제: });
778삭제: });
779790 }
780791 if let Some(error) = &self.ui_error {
781792 ui.colored_label(theme::ERROR, error);
@@ -1076,64 +1087,82 @@ impl ArchiveApp {
10761087 }
10771088
10781089 fn create_dialog(&mut self, ctx: &egui::Context) {
1079삭제: let mut create = false;
1090추가: let mut compress = false;
10801091 let mut pick = None;
1092추가: let mut cancel = false;
10811093 let modal = egui::Modal::new(egui::Id::unique("create-zip")).show(ctx, |ui| {
1082삭제: ui.set_width((ctx.content_rect().width() - 64.0).min(560.0));
1083삭제: ui.heading("ZIP 만들기");
1094추가: ui.set_width((ctx.content_rect().width() - 64.0).min(600.0));
1095추가: ui.horizontal(|ui| {
1096추가: ui.heading("ZIP 만들기");
1097추가: ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
1098추가: let close = theme::icon_button(ui, "닫기", theme::CLOSE, true);
1099추가: theme::focus(&close);
1100추가: cancel = close.clicked();
1101추가: });
1102추가: });
10841103 egui::ScrollArea::vertical()
10851104 .id_salt("create-fields")
1086삭제: .scroll_bar_visibility(if ctx.content_rect().height() < 600.0 {
1087삭제: egui::scroll_area::ScrollBarVisibility::AlwaysVisible
1088삭제: } else {
1089삭제: egui::scroll_area::ScrollBarVisibility::VisibleWhenNeeded
1090삭제: })
1091삭제: .max_height((ctx.content_rect().height() - 200.0).max(240.0))
1105추가: .max_height((ctx.content_rect().height() - 180.0).max(180.0))
10921106 .show(ui, |ui| {
1093삭제: ui.strong("1. 묶을 파일과 폴더");
1094삭제: let mut remove = None;
1095삭제: theme::panel(theme::STRIPE).show(ui, |ui| {
1096삭제: egui::ScrollArea::vertical()
1097삭제: .id_salt("zip-sources")
1098삭제: .max_height(128.0)
1099삭제: .show(ui, |ui| {
1100삭제: if self.sources.is_empty() {
1101삭제: ui.label("여기에 파일이나 폴더를 끌어 놓으세요");
1102삭제: }
1103삭제: for (index, path) in self.sources.iter().enumerate() {
1104삭제: ui.horizontal(|ui| {
1105삭제: theme::icon(
1106삭제: ui,
1107삭제: if path.is_dir() {
1108삭제: Icon::Folder
1109삭제: } else {
1110삭제: Icon::File
1111삭제: },
1112삭제: 20.0,
1113삭제: );
1114삭제: theme::column_label(
1115삭제: ui,
1116삭제: present::middle_text(
1117삭제: &path
1118삭제: .file_name()
1119삭제: .unwrap_or_default()
1120삭제: .to_string_lossy(),
1121삭제: 28,
1122삭제: ),
1123삭제: ui.available_width() - 80.0,
1124삭제: Align::Min,
1125삭제: )
1126삭제: .on_hover_text(path.display().to_string());
1127삭제: if theme::action(ui, "빼기", false, true).clicked() {
1128삭제: remove = Some(index);
1129삭제: }
1130삭제: });
1131삭제: }
1107추가: ui.add_space(16.0);
1108추가: let frame = theme::panel(theme::STRIPE)
1109추가: .stroke(egui::Stroke::new(1.0, theme::DASH))
1110추가: .inner_margin(egui::Margin::same(24));
1111추가: let area = frame
1112추가: .show(ui, |ui| {
1113추가: ui.set_min_size(egui::vec2(ui.available_width(), 144.0));
1114추가: ui.vertical_centered(|ui| {
1115추가: theme::icon(ui, Icon::File, 44.0);
1116추가: ui.add_space(16.0);
1117추가: ui.label(
1118추가: RichText::new("파일이나 폴더를 여기에 끌어 놓으세요")
1119추가: .size(18.0),
1120추가: );
11321121 });
1122추가: })
1123추가: .response;
1124추가: let drop = ui.interact(
1125추가: area.rect,
1126추가: egui::Id::unique("zip-source-drop"),
1127추가: egui::Sense::click(),
1128추가: );
1129추가: theme::focus(&drop);
1130추가: drop.widget_info(|| {
1131추가: egui::WidgetInfo::labeled(egui::Role::Button, true, "파일 추가")
11331132 });
1134삭제: if let Some(index) = remove {
1135삭제: self.sources.remove(index);
1133추가: if drop.clicked() {
1134추가: pick = Some(Purpose::Files);
11361135 }
1136추가: egui::ScrollArea::vertical()
1137추가: .id_salt("zip-sources")
1138추가: .max_height(86.0)
1139추가: .show(ui, |ui| {
1140추가: let mut remove = None;
1141추가: for (index, path) in self.sources.iter().enumerate() {
1142추가: ui.horizontal(|ui| {
1143추가: theme::icon(
1144추가: ui,
1145추가: if path.is_dir() {
1146추가: Icon::Folder
1147추가: } else {
1148추가: Icon::File
1149추가: },
1150추가: 20.0,
1151추가: );
1152추가: ui.label(present::middle_text(
1153추가: &path.file_name().unwrap_or_default().to_string_lossy(),
1154추가: 36,
1155추가: ))
1156추가: .on_hover_text(path.display().to_string());
1157추가: if ui.button("빼기").clicked() {
1158추가: remove = Some(index);
1159추가: }
1160추가: });
1161추가: }
1162추가: if let Some(index) = remove {
1163추가: self.sources.remove(index);
1164추가: }
1165추가: });
11371166 ui.horizontal(|ui| {
11381167 if theme::action(ui, "파일 추가", false, true).clicked() {
11391168 pick = Some(Purpose::Files);
@@ -1142,61 +1171,33 @@ impl ArchiveApp {
11421171 pick = Some(Purpose::Folder);
11431172 }
11441173 });
1145삭제: ui.add_space(theme::SPACE);
1146삭제: ui.strong("2. 저장 위치");
1174추가: ui.add_space(16.0);
11471175 ui.horizontal(|ui| {
1148삭제: ui.label("이름");
1149삭제: let edit = ui.add(
1150삭제: egui::TextEdit::singleline(&mut self.zip_name)
1151삭제: .id(egui::Id::unique("zip-name"))
1152삭제: .desired_width(ui.available_width()),
1153삭제: );
1154삭제: theme::focus(&edit);
1176추가: theme::icon(ui, Icon::Lock, 24.0);
1177추가: ui.strong("암호화");
11551178 });
1179추가: let check = ui.checkbox(&mut self.aes256, "암호로 보호하기");
1180추가: theme::focus(&check);
11561181 if let Some(error) = &self.ui_error {
11571182 ui.colored_label(theme::ERROR, error);
11581183 }
1159삭제: ui.horizontal(|ui| {
1160삭제: ui.label("폴더");
1161삭제: theme::column_label(
1162삭제: ui,
1163삭제: present::middle_text(&self.zip_folder.display().to_string(), 30),
1164삭제: ui.available_width() - 136.0,
1165삭제: Align::Min,
1166삭제: )
1167삭제: .on_hover_text(self.zip_folder.display().to_string());
1168삭제: if theme::action(ui, "폴더 바꾸기", false, true).clicked() {
1169삭제: pick = Some(Purpose::ZipFolder);
1170삭제: }
1171삭제: });
1172삭제: ui.add_space(theme::SPACE);
1173삭제: ui.strong("3. 보호");
1174삭제: let response = ui.checkbox(&mut self.aes256, "암호로 보호하기");
1175삭제: theme::focus(&response);
1176삭제: ui.collapsing("자세한 설정", |ui| {
1177삭제: ui.radio_value(&mut self.method, Method::Deflate, "작게 압축(기본)");
1178삭제: ui.radio_value(&mut self.method, Method::Store, "빠르게 묶기");
1179삭제: });
1184추가: ui.add_space(16.0);
11801185 });
1181삭제: ui.separator();
1182삭제: let can_create = !self.sources.is_empty() && !self.zip_name.is_empty();
1183삭제: let (cancel, confirm) = theme::action_pair(ui, "취소", Some(("만들기", can_create)));
1184삭제: if cancel {
1185삭제: self.create = false;
1186삭제: self.ui_error = None;
1187삭제: return;
1188삭제: }
1189삭제: create = confirm;
1186추가: let (dismiss, confirm) =
1187추가: theme::action_pair(ui, "취소", Some(("압축하기", !self.sources.is_empty())));
1188추가: cancel |= dismiss;
1189추가: compress = confirm;
11901190 });
1191삭제: if !self.create || modal.should_close() {
1191추가: if cancel || modal.should_close() {
11921192 self.create = false;
1193추가: self.ui_error = None;
11931194 return;
11941195 }
11951196 if let Some(purpose) = pick {
11961197 self.open_picker(purpose);
11971198 }
1198삭제: if create {
1199삭제: self.begin_zip();
1199추가: if compress {
1200추가: self.open_picker(Purpose::SaveZip);
12001201 }
12011202 }
12021203
수정experiments/rust-ui-memory-app/src/archive_theme.rs+93-2
@@ -18,7 +18,7 @@ pub const WARNING: Color32 = Color32::from_rgb(180, 83, 9);
1818pub const WARNING_BG: Color32 = Color32::from_rgb(255, 247, 232);
1919pub const ERROR: Color32 = Color32::from_rgb(185, 28, 28);
2020pub const ERROR_BG: Color32 = Color32::from_rgb(253, 237, 237);
21삭제: pub const FOLDER: Color32 = Color32::from_rgb(224, 165, 38);
21추가: pub const FOLDER: Color32 = Color32::from_rgb(240, 160, 0);
2222pub const FILE: Color32 = Color32::from_rgb(123, 135, 148);
2323pub const SPACE: f32 = 8.0;
2424pub const PAD: i8 = 16;
@@ -27,7 +27,7 @@ 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 = 15.0;
30추가: pub const BODY: f32 = 17.0;
3131pub const TITLE: f32 = 22.0;
3232
3333pub fn apply(ctx: &egui::Context) {
@@ -279,3 +279,94 @@ pub fn indeterminate(ui: &mut egui::Ui) {
279279 )
280280 });
281281}
282추가:
283추가: pub const OPEN: &str = include_str!("assets/icons/open-archive.svg");
284추가: pub const CREATE: &str = include_str!("assets/icons/create-zip.svg");
285추가: pub const EXTRACT: &str = include_str!("assets/icons/extract-archive.svg");
286추가: pub const PROTECT: &str = include_str!("assets/icons/protect-zip.svg");
287추가: pub const UP: &str = include_str!("assets/icons/navigate-up.svg");
288추가: pub const CLOSE: &str = include_str!("assets/icons/close-dialog.svg");
289추가:
290추가: pub fn svg_icon(painter: &egui::Painter, rect: egui::Rect, asset: &str, color: Color32) {
291추가: for element in asset.split("points=\"").skip(1) {
292추가: let points = element
293추가: .split('"')
294추가: .next()
295추가: .unwrap_or_default()
296추가: .split_whitespace()
297추가: .filter_map(|pair| {
298추가: let (x, y) = pair.split_once(',')?;
299추가: Some(
300추가: rect.min
301추가: + egui::vec2(x.parse::<f32>().ok()?, y.parse::<f32>().ok()?)
302추가: * (rect.width() / 24.0),
303추가: )
304추가: })
305추가: .collect::<Vec<_>>();
306추가: painter.add(egui::Shape::line(
307추가: points,
308추가: Stroke::new(rect.width() / 18.0, color),
309추가: ));
310추가: }
311추가: }
312추가:
313추가: pub fn tool(
314추가: ui: &mut egui::Ui,
315추가: label: &str,
316추가: asset: &str,
317추가: enabled: bool,
318추가: blue: bool,
319추가: ) -> egui::Response {
320추가: let response = ui.add_enabled(
321추가: enabled,
322추가: egui::Button::new(
323추가: egui::RichText::new(label)
324추가: .size(18.0)
325추가: .color(Color32::TRANSPARENT),
326추가: )
327추가: .frame(false)
328추가: .min_size(egui::vec2(108.0, 86.0)),
329추가: );
330추가: let rect = response.rect;
331추가: let color = if enabled {
332추가: if blue { BLUE } else { TEXT }
333추가: } else {
334추가: MUTED
335추가: };
336추가: let icon_rect = egui::Rect::from_center_size(
337추가: egui::pos2(rect.center().x, rect.top() + 27.0),
338추가: egui::vec2(36.0, 36.0),
339추가: );
340추가: ui.painter()
341추가: .rect_filled(rect.shrink2(egui::vec2(1.0, 27.0)), 0, PANEL);
342추가: svg_icon(ui.painter(), icon_rect, asset, color);
343추가: ui.painter().text(
344추가: egui::pos2(rect.center().x, rect.bottom() - 15.0),
345추가: egui::Align2::CENTER_CENTER,
346추가: label,
347추가: FontId::proportional(18.0),
348추가: color,
349추가: );
350추가: focus(&response);
351추가: response
352추가: }
353추가:
354추가: pub const SEARCH: &str = include_str!("assets/icons/search-files.svg");
355추가:
356추가: pub fn icon_button(ui: &mut egui::Ui, name: &str, asset: &str, enabled: bool) -> egui::Response {
357추가: let response = ui
358추가: .add_enabled(
359추가: enabled,
360추가: egui::Button::new("").min_size(egui::vec2(38.0, 36.0)),
361추가: )
362추가: .on_hover_text(name);
363추가: response.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, enabled, name));
364추가: svg_icon(
365추가: ui.painter(),
366추가: egui::Rect::from_center_size(response.rect.center(), egui::vec2(22.0, 22.0)),
367추가: asset,
368추가: if enabled { TEXT } else { MUTED },
369추가: );
370추가: focus(&response);
371추가: response
372추가: }
추가experiments/rust-ui-memory-app/src/assets/icons/close-dialog.svg+1-0
@@ -0,0 +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="4,4 20,20"/><polyline points="20,4 4,20"/></svg>
추가experiments/rust-ui-memory-app/src/assets/icons/create-zip.svg+1-0
@@ -0,0 +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>
추가experiments/rust-ui-memory-app/src/assets/icons/extract-archive.svg+1-0
@@ -0,0 +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>
추가experiments/rust-ui-memory-app/src/assets/icons/navigate-up.svg+1-0
@@ -0,0 +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>
추가experiments/rust-ui-memory-app/src/assets/icons/open-archive.svg+1-0
@@ -0,0 +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>
추가experiments/rust-ui-memory-app/src/assets/icons/protect-zip.svg+1-0
@@ -0,0 +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="6,10 6,22 20,22 20,10 6,10"/><polyline points="9,10 9,5 11,2 15,2 18,5 18,10"/></svg>
추가experiments/rust-ui-memory-app/src/assets/icons/search-files.svg+1-0
@@ -0,0 +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>
수정experiments/rust-ui-memory-app/src/lib.rs+2-1
@@ -14,7 +14,8 @@ pub mod archive_process;
1414
1515pub mod archive_present;
1616
17추가: pub mod archive_browser;
1718#[cfg(feature = "ui")]
18삭제: pub mod archive_picker;
19추가: pub mod archive_dialog;
1920#[cfg(feature = "ui")]
2021pub mod archive_theme;
수정tests/rust-app-real-worker/flows.rs+62-28
@@ -156,19 +156,28 @@ fn completed(model: &Model) {
156156 );
157157}
158158#[cfg(feature = "ui")]
159추가: #[path = "../rust-app-ui/dialogs.rs"]
160추가: mod dialogs;
161추가: #[cfg(feature = "ui")]
159162mod screen {
163추가: use super::dialogs::TestDialogs;
160164 use super::*;
161165 use eframe::egui::{self, epaint::Shape};
162166 use zipelo_ui_memory_app::archive_screen::ArchiveApp;
163167 struct Screen {
164168 context: egui::Context,
165169 app: ArchiveApp,
170추가: dialogs: TestDialogs,
166171 }
167172 impl Screen {
168173 fn new(factory: ObservedFactory) -> Self {
174추가: let dialogs = TestDialogs::default();
175추가: let mut app = ArchiveApp::new(Box::new(factory), None, false);
176추가: app.set_dialogs(Box::new(dialogs.clone()));
169177 Self {
170178 context: egui::Context::default(),
171삭제: app: ArchiveApp::new(Box::new(factory), None, false),
179추가: app,
180추가: dialogs,
172181 }
173182 }
174183 fn render(&mut self, events: Vec<egui::Event>) -> Vec<(String, egui::Pos2)> {
@@ -235,6 +244,10 @@ mod screen {
235244 self.click_at(point);
236245 }
237246 fn set_text(&mut self, id: &str, value: &str) {
247추가: if id == "zip-name" {
248추가: self.dialogs.0.borrow_mut().save_name = Some(value.to_owned());
249추가: return;
250추가: }
238251 self.render(vec![]);
239252 let point = self
240253 .context
@@ -281,7 +294,12 @@ mod screen {
281294 }
282295 fn extract(&mut self, destination: &Path) {
283296 self.app.choose_destination(destination.to_path_buf());
284삭제: self.click("풀기");
297추가: self.dialogs
298추가: .0
299추가: .borrow_mut()
300추가: .answers
301추가: .push_back(Some(vec![destination.to_path_buf()]));
302추가: self.click("압축해제");
285303 assert!(self.app.model.busy());
286304 self.settle();
287305 assert_eq!(
@@ -368,7 +386,7 @@ mod screen {
368386 let mut screen = Screen::new(factory);
369387 screen.app.add_sources(vec![source]);
370388 screen.render(vec![]);
371삭제: screen.click("만들기");
389추가: screen.click("압축하기");
372390 screen.settle();
373391 assert!(archive.is_file());
374392 screen.open(&archive);
@@ -411,7 +429,7 @@ mod screen {
411429 screen.app.add_sources(vec![source.clone()]);
412430 screen.render(vec![]);
413431 screen.set_text("zip-name", archive.file_name().unwrap().to_str().unwrap());
414삭제: screen.click("만들기");
432추가: screen.click("압축하기");
415433 assert!(screen.app.model.busy());
416434 screen.settle();
417435 assert!(archive.is_file());
@@ -449,12 +467,16 @@ fn broken_or_incomplete_worker_output_is_not_success() {
449467 fs::copy(binary("zipelo-real-worker-probe"), &probe).unwrap();
450468 let mut factory = ProcessFactory::new(probe);
451469 let mut model = Model::default();
452삭제: assert!(model.begin(
453삭제: Start::List {
454삭제: archive: scratch.path("sample.zip")
455삭제: },
456삭제: &mut factory
457삭제: ));
470추가: assert!(
471추가: model.begin(
472추가: Start::List {
473추가: archive: scratch.path("sample.zip")
474추가: },
475추가: &mut factory
476추가: ),
477추가: "{:?}",
478추가: model.error
479추가: );
458480 model.request_close();
459481 model.confirm_close();
460482 assert_eq!(model.close, Close::Waiting);
@@ -474,12 +496,16 @@ fn dropping_live_connection_kills_and_reaps_owned_child() {
474496 fs::copy(binary("zipelo-real-worker-probe"), &probe).unwrap();
475497 let mut factory = ProcessFactory::new(probe);
476498 let mut model = Model::default();
477삭제: assert!(model.begin(
478삭제: Start::List {
479삭제: archive: scratch.path("sample.zip")
480삭제: },
481삭제: &mut factory
482삭제: ));
499추가: assert!(
500추가: model.begin(
501추가: Start::List {
502추가: archive: scratch.path("sample.zip")
503추가: },
504추가: &mut factory
505추가: ),
506추가: "{:?}",
507추가: model.error
508추가: );
483509 let deadline = Instant::now() + Duration::from_secs(5);
484510 while !scratch.path("probe.pid").exists() {
485511 assert!(Instant::now() < deadline);
@@ -615,12 +641,16 @@ fn cancel_racing_child_exit_preserves_completed_result_before_poll() {
615641 for iteration in 0..100 {
616642 let mut factory = CompletedFactory(ProcessFactory::new(binary("zipelo-archive-worker")));
617643 let mut model = Model::default();
618삭제: assert!(model.begin(
619삭제: Start::List {
620삭제: archive: archive.clone()
621삭제: },
622삭제: &mut factory
623삭제: ));
644추가: assert!(
645추가: model.begin(
646추가: Start::List {
647추가: archive: archive.clone()
648추가: },
649추가: &mut factory
650추가: ),
651추가: "{:?}",
652추가: model.error
653추가: );
624654 assert!(model.terminal.is_none());
625655 model.cancel();
626656 wait(&mut model);
@@ -637,12 +667,16 @@ fn cancel_racing_exit_without_terminal_remains_unconfirmed() {
637667 fs::copy(binary("zipelo-real-worker-probe"), &probe).unwrap();
638668 let mut factory = ProcessFactory::new(probe);
639669 let mut model = Model::default();
640삭제: assert!(model.begin(
641삭제: Start::List {
642삭제: archive: scratch.path("sample.zip")
643삭제: },
644삭제: &mut factory
645삭제: ));
670추가: assert!(
671추가: model.begin(
672추가: Start::List {
673추가: archive: scratch.path("sample.zip")
674추가: },
675추가: &mut factory
676추가: ),
677추가: "{:?}",
678추가: model.error
679추가: );
646680 std::thread::sleep(Duration::from_millis(2));
647681 model.cancel();
648682 model.request_close();
수정tests/rust-app-real-worker/password_flows.rs+25-5
@@ -48,14 +48,24 @@ impl Screen {
4848 if !text.is_empty() {
4949 assert!(!rendered.iter().any(|(value, _)| value.contains(text)));
5050 }
51삭제: if self.app.model.challenge.is_some_and(|(_, _, encrypt)| encrypt) {
51추가: if self
52추가: .app
53추가: .model
54추가: .challenge
55추가: .is_some_and(|(_, _, encrypt)| encrypt)
56추가: {
5257 self.set_text("archive-password-confirm", text);
5358 }
5459 self.click("확인");
5560 }
5661 fn start_password_extract(&mut self, output: &Path) {
5762 self.app.choose_destination(output.to_path_buf());
58삭제: self.click("풀기");
63추가: self.dialogs
64추가: .0
65추가: .borrow_mut()
66추가: .answers
67추가: .push_back(Some(vec![output.to_path_buf()]));
68추가: self.click("압축해제");
5969 assert!(self.app.model.busy());
6070 }
6171 fn finish_password_job(&mut self, expected: Outcome) {
@@ -74,7 +84,7 @@ impl Screen {
7484 self.render(vec![]);
7585 self.set_text("zip-name", archive.file_name().unwrap().to_str().unwrap());
7686 self.click("암호로 보호하기");
77삭제: self.click("만들기");
87추가: self.click("압축하기");
7888 assert!(self.app.model.busy(), "{}", self.app.model.status());
7989 }
8090}
@@ -245,7 +255,12 @@ fn oversized_utf8_password_stays_in_dialog_then_accepts_valid_input() {
245255 let id = screen.password_request(1, false);
246256 screen.password_answer(&"가".repeat(342));
247257 assert_eq!(screen.app.model.challenge, Some((id, 1, false)));
248삭제: assert!(screen.render(vec![]).iter().any(|(text, _)| text.contains("1~1024바이트")));
258추가: assert!(
259추가: screen
260추가: .render(vec![])
261추가: .iter()
262추가: .any(|(text, _)| text.contains("1~1024바이트"))
263추가: );
249264 assert_eq!(fs::read_dir(&output).unwrap().count(), 0);
250265 screen.password_answer(FIXTURE_PASSWORD);
251266 screen.finish_password_job(Outcome::Completed);
@@ -266,7 +281,12 @@ fn invalid_password_then_cancel(invalid: &str, close: bool) {
266281 if invalid.is_empty() {
267282 assert!(screen.app.model.input_error.is_none());
268283 } else {
269삭제: assert!(screen.render(vec![]).iter().any(|(text, _)| text.contains("1~1024바이트")));
284추가: assert!(
285추가: screen
286추가: .render(vec![])
287추가: .iter()
288추가: .any(|(text, _)| text.contains("1~1024바이트"))
289추가: );
270290 }
271291 if close {
272292 screen.app.model.request_close();
수정tests/rust-app-real-worker/selection_flows.rs+19-7
@@ -36,7 +36,7 @@ fn extraction_completion_matches_actual_worker_selection_matrix() {
3636 screen.app.add_sources(vec![docs, root_file]);
3737 screen.render(vec![]);
3838 screen.set_text("zip-name", "selection.zip");
39삭제: screen.click("만들기");
39추가: screen.click("압축하기");
4040 screen.settle();
4141
4242 let cases: [(&str, Option<&[&str]>, &[&str]); 6] = [
@@ -56,17 +56,21 @@ fn extraction_completion_matches_actual_worker_selection_matrix() {
5656 Some(&["docs/nested/one.txt", "root.txt"]),
5757 &["docs", "docs/nested", "docs/nested/one.txt", "root.txt"],
5858 ),
59삭제: ("directory", Some(&["docs"]), &["docs"]),
59추가: (
60추가: "directory",
61추가: Some(&["docs"]),
62추가: &["docs", "docs/empty", "docs/nested", "docs/nested/one.txt"],
63추가: ),
6064 (
6165 "mixed",
6266 Some(&["docs", "docs/nested/one.txt"]),
63삭제: &["docs", "docs/nested", "docs/nested/one.txt"],
67추가: &["docs", "docs/empty", "docs/nested", "docs/nested/one.txt"],
6468 ),
6569 ("empty", Some(&["docs/empty"]), &["docs", "docs/empty"]),
6670 (
6771 "nested-directory",
6872 Some(&["docs/nested"]),
69삭제: &["docs", "docs/nested"],
73추가: &["docs", "docs/nested", "docs/nested/one.txt"],
7074 ),
7175 ];
7276 for (name, selected, expected) in cases {
@@ -88,7 +92,6 @@ fn extraction_completion_matches_actual_worker_selection_matrix() {
8892 });
8993 if let Some(ids) = &ids {
9094 screen.app.model.selected = ids.clone();
91삭제: screen.click("선택한 항목만 풀기");
9295 }
9396 let output = make_directory(&scratch.path(name));
9497 screen.extract(&output);
@@ -125,7 +128,16 @@ fn extraction_completion_matches_actual_worker_selection_matrix() {
125128 Start::Extract { selection, .. } => match (selection, &ids) {
126129 (Selection::All, None) => {}
127130 (Selection::EntryIds(actual), Some(ids)) => {
128삭제: assert_eq!(actual, &ids.iter().copied().collect::<Vec<_>>(), "{name}");
131추가: assert_eq!(
132추가: actual,
133추가: &zipelo_ui_memory_app::archive_browser::expand_selection(
134추가: &screen.app.model.entries,
135추가: ids
136추가: )
137추가: .into_iter()
138추가: .collect::<Vec<_>>(),
139추가: "{name}"
140추가: );
129141 }
130142 _ => panic!("요청 선택 범위 불일치: {name}"),
131143 },
@@ -193,7 +205,7 @@ fn auto_destination_is_private_under_desktop_umask() {
193205 let (factory, observed) = observed_factory();
194206 let mut screen = Screen::new(factory);
195207 screen.open(&archive);
196삭제: screen.click("풀기");
208추가: assert!(screen.app.begin_extract());
197209 assert!(screen.app.model.busy());
198210 screen.settle();
199211 assert_eq!(
수정tests/rust-app-ui/capture.rs+69-2
@@ -112,6 +112,61 @@ fn entries() -> Vec<Entry> {
112112 },
113113 ]
114114}
115추가: fn toolbar_entries() -> Vec<Entry> {
116추가: let mut entries = vec![
117추가: Entry {
118추가: id: 0,
119추가: name: "Install".into(),
120추가: kind: Kind::Directory,
121추가: bytes: Some(0),
122추가: packed: None,
123추가: encrypted: false,
124추가: },
125추가: Entry {
126추가: id: 1,
127추가: name: "Install.exe".into(),
128추가: kind: Kind::File,
129추가: bytes: Some(234_906),
130추가: packed: None,
131추가: encrypted: false,
132추가: },
133추가: ];
134추가: for (index, name) in [
135추가: "cab1.cab",
136추가: "cab10.cab",
137추가: "cab11.cab",
138추가: "cab12.cab",
139추가: "cab2.cab",
140추가: "cab3.cab",
141추가: "cab4.cab",
142추가: "cab5.cab",
143추가: ]
144추가: .iter()
145추가: .enumerate()
146추가: {
147추가: entries.push(Entry {
148추가: id: index as u32 + 2,
149추가: name: format!("Install/{name}"),
150추가: kind: Kind::File,
151추가: bytes: Some(
152추가: [
153추가: 99_510_272,
154추가: 77_909_197,
155추가: 102_236_160,
156추가: 67_842_867,
157추가: 103_389_594,
158추가: 59_454_669,
159추가: 78_014_054,
160추가: 81_159_782,
161추가: ][index],
162추가: ),
163추가: packed: None,
164추가: encrypted: false,
165추가: });
166추가: }
167추가: entries
168추가: }
169추가:
115170impl Factory for CaptureFactory {
116171 fn connect(&mut self, job: u64) -> Result<Box<dyn Connection>, String> {
117172 Ok(Box::new(CaptureConnection {
@@ -130,11 +185,17 @@ impl Connection for CaptureConnection {
130185 self.event(Event::Accepted { encryption: true });
131186 match start {
132187 Start::List { .. } => {
133삭제: for entry in entries() {
188추가: let entries = if self.mode.starts_with("toolbar-") {
189추가: toolbar_entries()
190추가: } else {
191추가: entries()
192추가: };
193추가: let count = entries.len() as u32;
194추가: for entry in entries {
134195 self.event(Event::Entry(entry));
135196 }
136197 self.event(Event::ListEnd {
137삭제: entry_count: 3,
198추가: entry_count: count,
138199 list_id: ListId {
139200 catalog_version: 1,
140201 format: Format::Zip,
@@ -228,6 +289,12 @@ impl eframe::App for Capture {
228289 }
229290 if !self.triggered && self.app.model.list_id.is_some() {
230291 self.triggered = true;
292추가: if self.mode == "toolbar-folder" {
293추가: self.app.browse_folder("Install");
294추가: }
295추가: if self.mode == "toolbar-create" {
296추가: self.app.show_create(false);
297추가: }
231298 if [
232299 "password",
233300 "password-retry",
추가tests/rust-app-ui/dialogs.rs+28-0
@@ -0,0 +1,28 @@
1추가: use std::{cell::RefCell, collections::VecDeque, path::PathBuf, rc::Rc};
2추가: use zipelo_ui_memory_app::archive_dialog::{DialogRequest, Dialogs, Purpose};
3추가:
4추가: #[derive(Default)]
5추가: pub struct DialogState {
6추가: pub requests: Vec<DialogRequest>,
7추가: pub answers: VecDeque<Option<Vec<PathBuf>>>,
8추가: pub save_name: Option<String>,
9추가: pub cancel_save: bool,
10추가: }
11추가:
12추가: #[derive(Clone, Default)]
13추가: pub struct TestDialogs(pub Rc<RefCell<DialogState>>);
14추가:
15추가: impl Dialogs for TestDialogs {
16추가: fn choose(&mut self, request: DialogRequest) -> Result<Option<Vec<PathBuf>>, String> {
17추가: let mut state = self.0.borrow_mut();
18추가: state.requests.push(request.clone());
19추가: if let Some(answer) = state.answers.pop_front() {
20추가: return Ok(answer);
21추가: }
22추가: if request.purpose == Purpose::SaveZip && !state.cancel_save {
23추가: let name = state.save_name.take().unwrap_or(request.file_name);
24추가: return Ok(Some(vec![request.directory.join(name)]));
25추가: }
26추가: Ok(None)
27추가: }
28추가: }
수정tests/rust-app-ui/presentation.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
수정tests/rust-app-ui/regressions.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-app-ui/toolbar.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
수정tests/ui-redesign/capture.py

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/ui-redesign/screenshots/toolbar/capture.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/ui-redesign/screenshots/toolbar/toolbar-create.png

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

파일 내려받기
추가tests/ui-redesign/screenshots/toolbar/toolbar-folder.png

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

파일 내려받기
추가tests/ui-redesign/screenshots/toolbar/toolbar-root.png

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

파일 내려받기