Merge branch 'pop-os:master' into master

This commit is contained in:
Weeesly 2024-07-21 20:09:57 -03:00 • committed by GitHub
commit 910bf0349b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 288 additions and 162 deletions

220
Cargo.lock generated
View file

@ -353,9 +353,9 @@ dependencies = [
[[package]] [[package]]
name = "async-executor" name = "async-executor"
version = "1.12.0" version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8828ec6e544c02b0d6691d21ed9f9218d0384a82542855073c2a3f58304aaf0" checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7"
dependencies = [ dependencies = [
"async-task", "async-task",
"concurrent-queue", "concurrent-queue",
@ -502,14 +502,14 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
name = "async-signal" name = "async-signal"
version = "0.2.8" version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "794f185324c2f00e771cd9f1ae8b5ac68be2ca7abb129a87afd6e86d228bc54d" checksum = "dfb3634b73397aa844481f814fad23bbf07fdb0eabec10f2eb95e58944b1ec32"
dependencies = [ dependencies = [
"async-io 2.3.3", "async-io 2.3.3",
"async-lock 3.4.0", "async-lock 3.4.0",
@ -537,7 +537,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -772,7 +772,7 @@ checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -783,9 +783,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]] [[package]]
name = "bytes" name = "bytes"
version = "1.6.0" version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952"
[[package]] [[package]]
name = "calloop" name = "calloop"
@ -841,13 +841,12 @@ dependencies = [
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.1.0" version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052"
dependencies = [ dependencies = [
"jobserver", "jobserver",
"libc", "libc",
"once_cell",
] ]
[[package]] [[package]]
@ -1106,14 +1105,14 @@ source = "git+https://github.com/pop-os/cosmic-protocols?rev=c8d3a1c#c8d3a1c3d40
dependencies = [ dependencies = [
"cosmic-protocols", "cosmic-protocols",
"libc", "libc",
"smithay-client-toolkit 0.19.1", "smithay-client-toolkit 0.19.2",
"wayland-client", "wayland-client",
] ]
[[package]] [[package]]
name = "cosmic-config" name = "cosmic-config"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"atomicwrites", "atomicwrites",
"cosmic-config-derive", "cosmic-config-derive",
@ -1132,7 +1131,7 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-config-derive" name = "cosmic-config-derive"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"quote", "quote",
"syn 1.0.109", "syn 1.0.109",
@ -1190,8 +1189,8 @@ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"wayland-backend", "wayland-backend",
"wayland-client", "wayland-client",
"wayland-protocols 0.32.2", "wayland-protocols 0.32.3",
"wayland-protocols-wlr 0.3.2", "wayland-protocols-wlr 0.3.3",
"wayland-scanner", "wayland-scanner",
"wayland-server", "wayland-server",
] ]
@ -1221,7 +1220,7 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-theme" name = "cosmic-theme"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"almost", "almost",
"cosmic-config", "cosmic-config",
@ -1362,7 +1361,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"strsim 0.11.1", "strsim 0.11.1",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -1373,7 +1372,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806"
dependencies = [ dependencies = [
"darling_core", "darling_core",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -1424,7 +1423,7 @@ dependencies = [
"darling", "darling",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -1513,7 +1512,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -1542,7 +1541,7 @@ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"mime 0.1.0", "mime 0.1.0",
"raw-window-handle", "raw-window-handle",
"smithay-client-toolkit 0.19.1", "smithay-client-toolkit 0.19.2",
"smithay-clipboard", "smithay-clipboard",
] ]
@ -1632,7 +1631,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -1947,7 +1946,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -2119,7 +2118,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -2309,7 +2308,7 @@ dependencies = [
"proc-macro-crate 3.1.0", "proc-macro-crate 3.1.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -2582,7 +2581,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"strsim 0.10.0", "strsim 0.10.0",
"syn 2.0.70", "syn 2.0.71",
"unic-langid", "unic-langid",
] ]
@ -2596,7 +2595,7 @@ dependencies = [
"i18n-config", "i18n-config",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -2625,7 +2624,7 @@ dependencies = [
[[package]] [[package]]
name = "iced" name = "iced"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"dnd", "dnd",
"iced_accessibility", "iced_accessibility",
@ -2644,7 +2643,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_accessibility" name = "iced_accessibility"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"accesskit", "accesskit",
"accesskit_unix", "accesskit_unix",
@ -2654,7 +2653,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_core" name = "iced_core"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"dnd", "dnd",
@ -2665,7 +2664,7 @@ dependencies = [
"palette", "palette",
"raw-window-handle", "raw-window-handle",
"serde", "serde",
"smithay-client-toolkit 0.19.1", "smithay-client-toolkit 0.19.2",
"smol_str", "smol_str",
"thiserror", "thiserror",
"web-time", "web-time",
@ -2676,7 +2675,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_futures" name = "iced_futures"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"futures", "futures",
"iced_core", "iced_core",
@ -2689,7 +2688,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_graphics" name = "iced_graphics"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"bytemuck", "bytemuck",
@ -2713,7 +2712,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_renderer" name = "iced_renderer"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"iced_graphics", "iced_graphics",
"iced_tiny_skia", "iced_tiny_skia",
@ -2725,13 +2724,13 @@ dependencies = [
[[package]] [[package]]
name = "iced_runtime" name = "iced_runtime"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"dnd", "dnd",
"iced_accessibility", "iced_accessibility",
"iced_core", "iced_core",
"iced_futures", "iced_futures",
"smithay-client-toolkit 0.19.1", "smithay-client-toolkit 0.19.2",
"thiserror", "thiserror",
"window_clipboard", "window_clipboard",
] ]
@ -2739,7 +2738,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_sctk" name = "iced_sctk"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"enum-repr", "enum-repr",
"float-cmp", "float-cmp",
@ -2752,11 +2751,11 @@ dependencies = [
"itertools", "itertools",
"lazy_static", "lazy_static",
"raw-window-handle", "raw-window-handle",
"smithay-client-toolkit 0.19.1", "smithay-client-toolkit 0.19.2",
"thiserror", "thiserror",
"tracing", "tracing",
"wayland-backend", "wayland-backend",
"wayland-protocols 0.32.2", "wayland-protocols 0.32.3",
"window_clipboard", "window_clipboard",
"xkbcommon", "xkbcommon",
"xkbcommon-dl", "xkbcommon-dl",
@ -2766,7 +2765,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_style" name = "iced_style"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"iced_core", "iced_core",
"once_cell", "once_cell",
@ -2776,7 +2775,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_tiny_skia" name = "iced_tiny_skia"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"cosmic-text", "cosmic-text",
@ -2793,8 +2792,9 @@ dependencies = [
[[package]] [[package]]
name = "iced_wgpu" name = "iced_wgpu"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"as-raw-xcb-connection",
"bitflags 2.6.0", "bitflags 2.6.0",
"bytemuck", "bytemuck",
"futures", "futures",
@ -2808,18 +2808,20 @@ dependencies = [
"raw-window-handle", "raw-window-handle",
"resvg", "resvg",
"rustix 0.38.34", "rustix 0.38.34",
"smithay-client-toolkit 0.19.1", "smithay-client-toolkit 0.19.2",
"tiny-xlib",
"wayland-backend", "wayland-backend",
"wayland-client", "wayland-client",
"wayland-protocols 0.32.2", "wayland-protocols 0.32.3",
"wayland-sys", "wayland-sys",
"wgpu", "wgpu",
"x11rb",
] ]
[[package]] [[package]]
name = "iced_widget" name = "iced_widget"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"dnd", "dnd",
"iced_accessibility", "iced_accessibility",
@ -2828,7 +2830,7 @@ dependencies = [
"iced_style", "iced_style",
"num-traits", "num-traits",
"ouroboros", "ouroboros",
"smithay-client-toolkit 0.19.1", "smithay-client-toolkit 0.19.2",
"thiserror", "thiserror",
"unicode-segmentation", "unicode-segmentation",
"window_clipboard", "window_clipboard",
@ -2837,7 +2839,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_winit" name = "iced_winit"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"dnd", "dnd",
"iced_accessibility", "iced_accessibility",
@ -3014,7 +3016,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -3335,7 +3337,7 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
[[package]] [[package]]
name = "libcosmic" name = "libcosmic"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/pop-os/libcosmic.git#1e566c13aaa86a48695876a8badda38c8b828596" source = "git+https://github.com/pop-os/libcosmic.git#2dd55f2f20cc0a5bd09f834779dd6cf1dcb23bcf"
dependencies = [ dependencies = [
"apply", "apply",
"ashpd", "ashpd",
@ -3930,7 +3932,7 @@ dependencies = [
"proc-macro-crate 3.1.0", "proc-macro-crate 3.1.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -4113,7 +4115,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -4153,7 +4155,7 @@ dependencies = [
"by_address", "by_address",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -4205,7 +4207,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
"redox_syscall 0.5.2", "redox_syscall 0.5.3",
"smallvec", "smallvec",
"windows-targets 0.52.6", "windows-targets 0.52.6",
] ]
@ -4258,7 +4260,7 @@ dependencies = [
"phf_shared", "phf_shared",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -4577,9 +4579,9 @@ dependencies = [
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.5.2" version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
] ]
@ -4687,9 +4689,9 @@ dependencies = [
[[package]] [[package]]
name = "rgb" name = "rgb"
version = "0.8.44" version = "0.8.45"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1aee83dc281d5a3200d37b299acd13b81066ea126a7f16f0eae70fc9aed241d9" checksum = "ade4539f42266ded9e755c605bdddf546242b2c961b03b06a7375260788a0523"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
] ]
@ -4732,7 +4734,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rust-embed-utils", "rust-embed-utils",
"syn 2.0.70", "syn 2.0.71",
"walkdir", "walkdir",
] ]
@ -4906,7 +4908,7 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -4929,7 +4931,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -5069,9 +5071,9 @@ dependencies = [
[[package]] [[package]]
name = "smithay-client-toolkit" name = "smithay-client-toolkit"
version = "0.19.1" version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "837d3067369e24aeda699a5d9fc5aa14ca14a84dd70aeed7156bfa04a5605b32" checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"bytemuck", "bytemuck",
@ -5088,8 +5090,8 @@ dependencies = [
"wayland-client", "wayland-client",
"wayland-csd-frame", "wayland-csd-frame",
"wayland-cursor", "wayland-cursor",
"wayland-protocols 0.32.2", "wayland-protocols 0.32.3",
"wayland-protocols-wlr 0.3.2", "wayland-protocols-wlr 0.3.3",
"wayland-scanner", "wayland-scanner",
"xkbcommon", "xkbcommon",
"xkeysym", "xkeysym",
@ -5102,7 +5104,7 @@ source = "git+https://github.com/pop-os/smithay-clipboard?tag=pop-dnd-5#d099e82a
dependencies = [ dependencies = [
"libc", "libc",
"raw-window-handle", "raw-window-handle",
"smithay-client-toolkit 0.19.1", "smithay-client-toolkit 0.19.2",
"wayland-backend", "wayland-backend",
] ]
@ -5256,9 +5258,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.70" version = "2.0.71"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -5273,7 +5275,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -5361,7 +5363,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -5372,22 +5374,22 @@ checksum = "d321c8576c2b47e43953e9cce236550d4cd6af0a6ce518fe084340082ca6037b"
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.61" version = "1.0.62"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.61" version = "1.0.62"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -5519,9 +5521,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.38.0" version = "1.38.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df"
dependencies = [ dependencies = [
"backtrace", "backtrace",
"bytes", "bytes",
@ -5544,7 +5546,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -5642,7 +5644,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -6028,7 +6030,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -6062,7 +6064,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -6090,9 +6092,9 @@ dependencies = [
[[package]] [[package]]
name = "wayland-backend" name = "wayland-backend"
version = "0.3.5" version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "269c04f203640d0da2092d1b8d89a2d081714ae3ac2f1b53e99f205740517198" checksum = "f90e11ce2ca99c97b940ee83edbae9da2d56a08f9ea8158550fd77fa31722993"
dependencies = [ dependencies = [
"cc", "cc",
"downcast-rs", "downcast-rs",
@ -6104,9 +6106,9 @@ dependencies = [
[[package]] [[package]]
name = "wayland-client" name = "wayland-client"
version = "0.31.4" version = "0.31.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08bd0f46c069d3382a36c8666c1b9ccef32b8b04f41667ca1fef06a1adcc2982" checksum = "7e321577a0a165911bdcfb39cf029302479d7527b517ee58ab0f6ad09edf0943"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"rustix 0.38.34", "rustix 0.38.34",
@ -6127,9 +6129,9 @@ dependencies = [
[[package]] [[package]]
name = "wayland-cursor" name = "wayland-cursor"
version = "0.31.4" version = "0.31.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09414bcf0fd8d9577d73e9ac4659ebc45bcc9cff1980a350543ad8e50ee263b2" checksum = "6ef9489a8df197ebf3a8ce8a7a7f0a2320035c3743f3c1bd0bdbccf07ce64f95"
dependencies = [ dependencies = [
"rustix 0.38.34", "rustix 0.38.34",
"wayland-client", "wayland-client",
@ -6150,9 +6152,9 @@ dependencies = [
[[package]] [[package]]
name = "wayland-protocols" name = "wayland-protocols"
version = "0.32.2" version = "0.32.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1794d82d869f38439d15c24b26f06f6c8603d27d47b4f786d5197c99044de415" checksum = "62989625a776e827cc0f15d41444a3cea5205b963c3a25be48ae1b52d6b4daaa"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"wayland-backend", "wayland-backend",
@ -6189,23 +6191,23 @@ dependencies = [
[[package]] [[package]]
name = "wayland-protocols-wlr" name = "wayland-protocols-wlr"
version = "0.3.2" version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa43c961473aed713d44c1f616f775186249dfca657f256d8841ca0690366aba" checksum = "fd993de54a40a40fbe5601d9f1fbcaef0aebcc5fda447d7dc8f6dcbaae4f8953"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"wayland-backend", "wayland-backend",
"wayland-client", "wayland-client",
"wayland-protocols 0.32.2", "wayland-protocols 0.32.3",
"wayland-scanner", "wayland-scanner",
"wayland-server", "wayland-server",
] ]
[[package]] [[package]]
name = "wayland-scanner" name = "wayland-scanner"
version = "0.31.3" version = "0.31.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edf466fc49a4feb65a511ca403fec3601494d0dee85dbf37fff6fa0dd4eec3b6" checksum = "d7b56f89937f1cf2ee1f1259cf2936a17a1f45d8f0aa1019fae6d470d304cfa6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quick-xml", "quick-xml",
@ -6214,9 +6216,9 @@ dependencies = [
[[package]] [[package]]
name = "wayland-server" name = "wayland-server"
version = "0.31.3" version = "0.31.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a29060303e79e4c3d44936efdcf00941a78c86850bf67a88078dd1d6c99702b9" checksum = "2f0a4bab6d420ee4a609b63ef4d5f9b5d309c6b93a029fccab70f2594c0cb3ae"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"downcast-rs", "downcast-rs",
@ -6228,9 +6230,9 @@ dependencies = [
[[package]] [[package]]
name = "wayland-sys" name = "wayland-sys"
version = "0.31.3" version = "0.31.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a6754825230fa5b27bafaa28c30b3c9e72c55530581220cef401fa422c0fae7" checksum = "43676fe2daf68754ecf1d72026e4e6c15483198b5d24e888b74d3f22f887a148"
dependencies = [ dependencies = [
"dlib", "dlib",
"log", "log",
@ -6489,7 +6491,7 @@ checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -6511,7 +6513,7 @@ checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -6949,7 +6951,7 @@ checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
"synstructure", "synstructure",
] ]
@ -7057,7 +7059,7 @@ dependencies = [
"proc-macro-crate 3.1.0", "proc-macro-crate 3.1.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
"zvariant_utils 2.0.0", "zvariant_utils 2.0.0",
] ]
@ -7106,7 +7108,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -7126,7 +7128,7 @@ checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
"synstructure", "synstructure",
] ]
@ -7149,7 +7151,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]
[[package]] [[package]]
@ -7211,7 +7213,7 @@ dependencies = [
"proc-macro-crate 3.1.0", "proc-macro-crate 3.1.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
"zvariant_utils 2.0.0", "zvariant_utils 2.0.0",
] ]
@ -7234,5 +7236,5 @@ checksum = "fc242db087efc22bd9ade7aa7809e4ba828132edc312871584a6b4391bdf8786"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.71",
] ]

View file

@ -11,6 +11,7 @@ modified = 修改時間
size = 大小 size = 大小
# Dialogs # Dialogs
## Empty Trash Dialog ## Empty Trash Dialog
empty-trash = 清空垃圾桶 empty-trash = 清空垃圾桶
empty-trash-warning = 確定要永久刪除垃圾桶中的所有項目嗎? empty-trash-warning = 確定要永久刪除垃圾桶中的所有項目嗎?
@ -26,7 +27,6 @@ name-hidden = 名稱以 "." 開頭將被隱藏。
name-invalid = 名稱不能為 "{$filename}"。 name-invalid = 名稱不能為 "{$filename}"。
name-no-slashes = 名稱不能包含斜線。 name-no-slashes = 名稱不能包含斜線。
## Open/Save Dialog ## Open/Save Dialog
cancel = 取消 cancel = 取消
open = 開啟 open = 開啟
@ -47,17 +47,58 @@ rename-folder = 重命名資料夾
replace = 替換 replace = 替換
replace-title = {$filename} 已存在於此位置。 replace-title = {$filename} 已存在於此位置。
replace-warning = 您想用您正在儲存的檔案替換它嗎?替換將會覆蓋其內容。 replace-warning = 您想用您正在儲存的檔案替換它嗎?替換將會覆蓋其內容。
replace-warning-operation = 您想要替換它嗎? 替換將會覆蓋其內容。
original-file = 原始檔案
#replace-with = Replace with # Can't translate due to word order
apply-to-all = 全部套用
keep-both = 保留兩者
skip = 跳過
# Context Pages # Context Pages
## About ## About
git-description = Git 提交 {$hash} 於 {$date} git-description = Git 提交 {$hash} 於 {$date}
## Operations ## Operations
operations = 操作 edit-history = 編輯歷史
history = 歷史
no-history = 沒有歷史項目
pending = 待處理 pending = 待處理
failed = 失敗 failed = 失敗
complete = 完成 complete = 完成
copy_noun = 複製
creating = 正在建立 {$name} 於 {$parent}
created = 已建立 {$name} 於 {$parent}
copying = 正在從 {$from} 複製 {$items} {$items ->
[one] 個項目
*[other] 個項目
} 到 {$to}
copied = 已從 {$from} 複製 {$items} {$items ->
[one] 個項目
*[other] 個項目
} 到 {$to}
emptying-trash = 正在清空 {trash}
emptied-trash = 已清空 {trash}
moving = 正在從 {$from} 移動 {$items} {$items ->
[one] 個項目
*[other] 項目
} 到 {$to}
moved = 已從 {$from} 移動 {$items} {$items ->
[one] 項目
*[other] 項目
} 到 {$to}
renaming = 正在重新命名 {$from} 為 {$to}
renamed = 已將 {$from} 重新命名為 {$to}
restoring = 正在從 {$trash} 還原 {$items} {$items ->
[one] 個項目
*[other] 個項目
}
restored = 已從 {$trash} 還原 {$items} {$items ->
[one] 個項目
*[other] 個項目
}
undo = 撤銷
unknown-folder = 未知的資料夾
## Open with ## Open with
open-with = 使用應用程式開啟 open-with = 使用應用程式開啟
@ -70,6 +111,7 @@ properties = 屬性
settings = 設定 settings = 設定
settings-tab = 分頁 settings-tab = 分頁
settings-show-hidden = 顯示隱藏檔案 settings-show-hidden = 顯示隱藏檔案
default-view = 預設檢視
icon-size-list = 圖示大小(清單) icon-size-list = 圖示大小(清單)
icon-size-grid = 圖示大小(網格) icon-size-grid = 圖示大小(網格)
sorting-name = 排序方式 sorting-name = 排序方式
@ -102,7 +144,7 @@ sort-by-size = 依大小排序
file = 檔案 file = 檔案
new-tab = 新分頁 new-tab = 新分頁
new-window = 新視窗 new-window = 新視窗
rename = 重命名 rename = 重新命名
close-tab = 關閉分頁 close-tab = 關閉分頁
quit = 退出 quit = 退出
@ -114,8 +156,13 @@ paste = 貼上
select-all = 全選 select-all = 全選
## View ## View
zoom-in = 放大
default-size = 預設大小
zoom-out = 縮小
view = 檢視 view = 檢視
grid-view = 網格視圖 grid-view = 網格視圖
list-view = 清單視圖 list-view = 清單視圖
show-hidden-files = 顯示隱藏檔案
list-directories-first = 優先列出目錄
menu-settings = 設定... menu-settings = 設定...
menu-about = 關於 COSMIC 檔案總管... menu-about = 關於 COSMIC 檔案總管...

View file

@ -8,7 +8,8 @@ base-dir := absolute_path(clean(rootdir / prefix))
export INSTALL_DIR := base-dir / 'share' export INSTALL_DIR := base-dir / 'share'
bin-src := 'target' / 'release' / name cargo-target-dir := env('CARGO_TARGET_DIR', 'target')
bin-src := cargo-target-dir / 'release' / name
bin-dst := base-dir / 'bin' / name bin-dst := base-dir / 'bin' / name
desktop := APPID + '.desktop' desktop := APPID + '.desktop'

View file

@ -1,14 +1,11 @@
// Copyright 2023 System76 <info@system76.com> // Copyright 2023 System76 <info@system76.com>
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use cosmic::iced::clipboard::dnd::DndAction;
use cosmic::widget::dnd_destination::DragId;
use cosmic::widget::menu::action::MenuAction;
use cosmic::widget::menu::key_bind::KeyBind;
use cosmic::{ use cosmic::{
app::{message, Command, Core}, app::{message, Command, Core},
cosmic_config, cosmic_theme, executor, cosmic_config, cosmic_theme, executor,
iced::{ iced::{
clipboard::dnd::DndAction,
event, event,
futures::{self, SinkExt}, futures::{self, SinkExt},
keyboard::{Event as KeyEvent, Key, Modifiers}, keyboard::{Event as KeyEvent, Key, Modifiers},
@ -20,6 +17,8 @@ use cosmic::{
style, theme, style, theme,
widget::{ widget::{
self, self,
dnd_destination::DragId,
menu::{action::MenuAction, key_bind::KeyBind},
segmented_button::{self, Entity}, segmented_button::{self, Entity},
}, },
Application, ApplicationExt, Element, Application, ApplicationExt, Element,
@ -42,18 +41,17 @@ use std::{
}; };
use tokio::sync::mpsc; use tokio::sync::mpsc;
use crate::localize::LANGUAGE_SORTER;
use crate::tab::HOVER_DURATION;
use crate::{ use crate::{
clipboard::{ClipboardCopy, ClipboardKind, ClipboardPaste}, clipboard::{ClipboardCopy, ClipboardKind, ClipboardPaste},
config::{AppTheme, Config, Favorite, IconSizes, TabConfig, CONFIG_VERSION}, config::{AppTheme, Config, Favorite, IconSizes, TabConfig, CONFIG_VERSION},
fl, home_dir, fl, home_dir,
key_bind::key_binds, key_bind::key_binds,
localize::LANGUAGE_SORTER,
menu, mime_app, menu, mime_app,
mounter::{mounters, MounterItem, MounterItems, MounterKey, Mounters}, mounter::{mounters, MounterItem, MounterItems, MounterKey, Mounters},
operation::{Operation, ReplaceResult}, operation::{Operation, ReplaceResult},
spawn_detached::spawn_detached, spawn_detached::spawn_detached,
tab::{self, HeadingOptions, ItemMetadata, Location, Tab}, tab::{self, HeadingOptions, ItemMetadata, Location, Tab, HOVER_DURATION},
}; };
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
@ -814,7 +812,7 @@ impl App {
widget::settings::item::builder(fl!("icon-size-list")) widget::settings::item::builder(fl!("icon-size-list"))
.description(format!("{}%", list)) .description(format!("{}%", list))
.control( .control(
widget::slider(75..=500, list, move |list| { widget::slider(50..=500, list, move |list| {
Message::TabConfig(TabConfig { Message::TabConfig(TabConfig {
icon_sizes: IconSizes { icon_sizes: IconSizes {
list: NonZeroU16::new(list).unwrap(), list: NonZeroU16::new(list).unwrap(),
@ -2391,7 +2389,9 @@ impl Application for App {
/// Creates a view after each update. /// Creates a view after each update.
fn view(&self) -> Element<Self::Message> { fn view(&self) -> Element<Self::Message> {
let cosmic_theme::Spacing { space_xxs, .. } = theme::active().cosmic().spacing; let cosmic_theme::Spacing {
space_xxs, space_s, ..
} = theme::active().cosmic().spacing;
let mut tab_column = widget::column::with_capacity(1); let mut tab_column = widget::column::with_capacity(1);
@ -2411,7 +2411,8 @@ impl Application for App {
.drag_id(self.tab_drag_id), .drag_id(self.tab_drag_id),
) )
.style(style::Container::Background) .style(style::Container::Background)
.width(Length::Fill), .width(Length::Fill)
.padding([0, space_s]),
); );
} }

View file

@ -1,9 +1,11 @@
use cosmic::widget::menu::key_bind::KeyBind; use cosmic::{
use cosmic::{iced::keyboard::Key, iced_core::keyboard::key::Named}; iced::keyboard::Key,
iced_core::keyboard::key::Named,
widget::menu::key_bind::{KeyBind, Modifier},
};
use std::collections::HashMap; use std::collections::HashMap;
use crate::app::Action; use crate::app::Action;
use cosmic::widget::menu::key_bind::Modifier;
//TODO: load from config //TODO: load from config
pub fn key_binds() -> HashMap<KeyBind, Action> { pub fn key_binds() -> HashMap<KeyBind, Action> {

View file

@ -1,22 +1,20 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
use cosmic::widget::menu::key_bind::KeyBind;
use cosmic::widget::menu::{self, ItemHeight, ItemWidth, MenuBar};
use cosmic::{ use cosmic::{
//TODO: export iced::widget::horizontal_rule in cosmic::widget //TODO: export iced::widget::horizontal_rule in cosmic::widget
iced::{widget::horizontal_rule, Alignment, Background, Border, Length}, iced::{widget::horizontal_rule, Alignment, Background, Border, Length},
theme, theme,
widget, widget,
widget::menu::{self, key_bind::KeyBind, ItemHeight, ItemWidth, MenuBar},
Element, Element,
}; };
use std::collections::HashMap; use std::collections::HashMap;
use crate::tab::LocationMenuAction;
use crate::{ use crate::{
app::{Action, Message}, app::{Action, Message},
config::TabConfig, config::TabConfig,
fl, fl,
tab::{self, HeadingOptions, Location, Tab}, tab::{self, HeadingOptions, Location, LocationMenuAction, Tab},
}; };
macro_rules! menu_button { macro_rules! menu_button {

View file

@ -1,9 +1,3 @@
use cosmic::iced::clipboard::dnd::DndAction;
use cosmic::iced::Border;
use cosmic::iced_core::widget::tree;
use cosmic::widget::menu::action::MenuAction;
use cosmic::widget::menu::key_bind::KeyBind;
use cosmic::widget::{vertical_space, Id, Widget};
use cosmic::{ use cosmic::{
cosmic_theme, font, cosmic_theme, font,
iced::{ iced::{
@ -12,6 +6,7 @@ use cosmic::{
text::{self, Paragraph}, text::{self, Paragraph},
}, },
alignment::{Horizontal, Vertical}, alignment::{Horizontal, Vertical},
clipboard::dnd::DndAction,
futures::SinkExt, futures::SinkExt,
keyboard::Modifiers, keyboard::Modifiers,
subscription::{self, Subscription}, subscription::{self, Subscription},
@ -21,6 +16,7 @@ use cosmic::{
scrollable::{AbsoluteOffset, Viewport}, scrollable::{AbsoluteOffset, Viewport},
}, },
Alignment, Alignment,
Border,
Color, Color,
ContentFit, ContentFit,
Length, Length,
@ -28,36 +24,42 @@ use cosmic::{
Rectangle, Rectangle,
Size, Size,
}, },
theme, widget, Element, iced_core::widget::tree,
theme, widget,
widget::{
menu::{action::MenuAction, key_bind::KeyBind},
vertical_space, DndDestination, DndSource, Id, Widget,
},
Element,
}; };
use mime_guess::{mime, Mime}; use mime_guess::{mime, Mime};
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::cell::RefCell;
use std::sync::{Arc, Mutex};
use std::{ use std::{
cell::Cell, cell::{Cell, RefCell},
cmp::Ordering, cmp::Ordering,
collections::HashMap, collections::HashMap,
fmt, fmt,
fs::{self, Metadata}, fs::{self, Metadata},
num::NonZeroU16, num::NonZeroU16,
path::PathBuf, path::PathBuf,
sync::{Arc, Mutex},
time::{Duration, Instant}, time::{Duration, Instant},
}; };
use crate::clipboard::{ClipboardCopy, ClipboardKind, ClipboardPaste};
use crate::localize::{LANGUAGE_CHRONO, LANGUAGE_SORTER};
use crate::{ use crate::{
app::{self, Action}, app::{self, Action},
clipboard::{ClipboardCopy, ClipboardKind, ClipboardPaste},
config::{IconSizes, TabConfig, ICON_SCALE_MAX, ICON_SIZE_GRID}, config::{IconSizes, TabConfig, ICON_SCALE_MAX, ICON_SIZE_GRID},
dialog::DialogKind, dialog::DialogKind,
fl, menu, fl,
localize::{LANGUAGE_CHRONO, LANGUAGE_SORTER},
menu,
mime_app::{mime_apps, MimeApp}, mime_app::{mime_apps, MimeApp},
mime_icon::{mime_for_path, mime_icon}, mime_icon::{mime_for_path, mime_icon},
mouse_area, mouse_area,
}; };
use cosmic::widget::{DndDestination, DndSource};
pub const DOUBLE_CLICK_DURATION: Duration = Duration::from_millis(500); pub const DOUBLE_CLICK_DURATION: Duration = Duration::from_millis(500);
pub const HOVER_DURATION: Duration = Duration::from_millis(1600); pub const HOVER_DURATION: Duration = Duration::from_millis(1600);
@ -1303,9 +1305,70 @@ impl Tab {
if let Some(range) = self.select_range { if let Some(range) = self.select_range {
let min = range.0.min(range.1); let min = range.0.min(range.1);
let max = range.0.max(range.1); let max = range.0.max(range.1);
if let Some(ref mut items) = self.items_opt { if self.config.sort_name == HeadingOptions::Name
for (i, item) in items.iter_mut().enumerate() { && self.config.sort_direction
item.selected = i >= min && i <= max; {
// A default/unsorted tab's view is consistent with how the
// Items are laid out internally (items_opt), so Items can be
// linearly selected
if let Some(ref mut items) = self.items_opt {
for item in items.iter_mut().skip(min).take(max - min + 1) {
item.selected = true;
}
}
} else {
// A sorted tab's items can't be linearly selected
// Let's say we have:
// index | file
// 0 | file0
// 1 | file1
// 2 | file2
// This is both the default sort and internal ordering
// When sorted it may be displayed as:
// 1 | file1
// 0 | file0
// 2 | file2
// However, the internal ordering is still the same thus
// linearly selecting items doesn't work. Shift selecting
// file0 and file2 would select indices 0 to 2 when it should
// select indices 0 AND 2 from items_opt
let indices: Vec<_> = self
.column_sort()
.map(|sorted| sorted.into_iter().map(|(i, _)| i).collect())
.unwrap_or_else(|| {
let len = self
.items_opt
.as_deref()
.map(|items| items.len())
.unwrap_or_default();
(0..len).collect()
});
// Find the true indices for the min and max element w.r.t.
// a sorted tab.
let min = indices
.iter()
.position(|&offset| offset == min)
.unwrap_or_default();
// We can't skip `min_real` elements here because the index of
// `max` may actually be before `min` in a sorted tab
let max = indices
.iter()
.position(|&offset| offset == max)
.unwrap_or_else(|| indices.len());
let min_real = min.min(max);
let max_real = max.max(min);
if let Some(ref mut items) = self.items_opt {
for index in indices
.into_iter()
.skip(min_real)
.take(max_real - min_real + 1)
{
if let Some(item) = items.get_mut(index) {
item.selected = true;
}
}
} }
} }
} }
@ -1923,7 +1986,9 @@ impl Tab {
} = theme::active().cosmic().spacing; } = theme::active().cosmic().spacing;
let size = self.size_opt.get().unwrap_or(Size::new(0.0, 0.0)); let size = self.size_opt.get().unwrap_or(Size::new(0.0, 0.0));
let mut row = widget::row::with_capacity(5).align_items(Alignment::Center); let mut row = widget::row::with_capacity(5)
.align_items(Alignment::Center)
.padding([space_xxxs, 0]);
let mut w = 0.0; let mut w = 0.0;
let mut prev_button = let mut prev_button =
@ -1963,9 +2028,13 @@ impl Tab {
.on_input(|input| { .on_input(|input| {
Message::EditLocation(Some(Location::Path(PathBuf::from(input)))) Message::EditLocation(Some(Location::Path(PathBuf::from(input))))
}) })
.on_submit(Message::Location(location.clone())), .on_submit(Message::Location(location.clone()))
.line_height(1.0),
); );
return row.into(); let mut column = widget::column::with_capacity(2).padding([0, space_s]);
column = column.push(row);
column = column.push(horizontal_rule(1));
return column.into();
} }
_ => { _ => {
//TODO: allow editing other locations //TODO: allow editing other locations
@ -2135,8 +2204,11 @@ impl Tab {
for child in children { for child in children {
row = row.push(child); row = row.push(child);
} }
let mut column = widget::column::with_capacity(2).padding([0, space_s]);
column = column.push(row);
column = column.push(horizontal_rule(1));
let mouse_area = crate::mouse_area::MouseArea::new(row) let mouse_area = crate::mouse_area::MouseArea::new(column)
.on_right_press(Message::LocationContextMenuPoint); .on_right_press(Message::LocationContextMenuPoint);
let mut popover = widget::popover(mouse_area); let mut popover = widget::popover(mouse_area);
@ -2230,7 +2302,7 @@ impl Tab {
let mut grid = widget::grid() let mut grid = widget::grid()
.column_spacing(column_spacing) .column_spacing(column_spacing)
.row_spacing(space_xxs) .row_spacing(space_xxs)
.padding([0, space_m].into()); .padding(space_xxs.into());
let mut dnd_items: Vec<(usize, (usize, usize), &Item)> = Vec::new(); let mut dnd_items: Vec<(usize, (usize, usize), &Item)> = Vec::new();
let mut drag_w_i = usize::MAX; let mut drag_w_i = usize::MAX;
let mut drag_n_i = usize::MAX; let mut drag_n_i = usize::MAX;
@ -2384,7 +2456,7 @@ impl Tab {
} }
} }
let spacer_height = height let spacer_height = height
.checked_sub(max_bottom + 4 * (space_xxs as usize)) .checked_sub(max_bottom + 7 * (space_xxs as usize))
.unwrap_or(0); .unwrap_or(0);
if spacer_height > 0 { if spacer_height > 0 {
children.push( children.push(
@ -2400,7 +2472,7 @@ impl Tab {
let mut dnd_grid = widget::grid() let mut dnd_grid = widget::grid()
.column_spacing(column_spacing) .column_spacing(column_spacing)
.row_spacing(space_xxs) .row_spacing(space_xxs)
.padding([0, space_m].into()); .padding(space_xxs.into());
let mut dnd_item_i = 0; let mut dnd_item_i = 0;
for r in drag_n_i..=drag_s_i { for r in drag_n_i..=drag_s_i {
@ -2472,7 +2544,10 @@ impl Tab {
bool, bool,
) { ) {
let cosmic_theme::Spacing { let cosmic_theme::Spacing {
space_m, space_xxs, .. space_m,
space_s,
space_xxs,
..
} = theme::active().cosmic().spacing; } = theme::active().cosmic().spacing;
let TabConfig { let TabConfig {
@ -2532,8 +2607,8 @@ impl Tab {
heading_item(fl!("size"), Length::Fixed(size_width), HeadingOptions::Size), heading_item(fl!("size"), Length::Fixed(size_width), HeadingOptions::Size),
]) ])
.align_items(Alignment::Center) .align_items(Alignment::Center)
.height(Length::Fixed(row_height as f32)) .height(Length::Fixed((space_m + 4).into()))
.padding(space_xxs) .padding([0, space_xxs])
.spacing(space_xxs) .spacing(space_xxs)
.into(), .into(),
); );
@ -2635,7 +2710,7 @@ impl Tab {
.width(Length::Fill) .width(Length::Fill)
.height(Length::Fixed(row_height as f32)) .height(Length::Fixed(row_height as f32))
.id(item.button_id.clone()) .id(item.button_id.clone())
.padding(space_xxs) .padding(if icon_size < 24 { 7 } else { space_xxs })
.style(button_style(item.selected, true, false)), .style(button_style(item.selected, true, false)),
) )
.on_press(move |_| Message::Click(Some(i))) .on_press(move |_| Message::Click(Some(i)))
@ -2765,7 +2840,7 @@ impl Tab {
} }
//TODO: HACK If we don't reach the bottom of the view, go ahead and add a spacer to do that //TODO: HACK If we don't reach the bottom of the view, go ahead and add a spacer to do that
{ {
let spacer_height = size.height as i32 - y as i32 - 4 * space_xxs as i32; let spacer_height = size.height as i32 - y as i32 - 5 * space_xxs as i32;
if spacer_height > 0 { if spacer_height > 0 {
children.push( children.push(
widget::container(vertical_space(Length::Fixed(spacer_height as f32))).into(), widget::container(vertical_space(Length::Fixed(spacer_height as f32))).into(),
@ -2780,7 +2855,7 @@ impl Tab {
( (
drag_col, drag_col,
mouse_area::MouseArea::new( mouse_area::MouseArea::new(
widget::column::with_children(children).padding([0, space_m]), widget::column::with_children(children).padding([0, space_s]),
) )
.with_id(Id::new("list-view")) .with_id(Id::new("list-view"))
.on_press(|_| Message::Click(None)) .on_press(|_| Message::Click(None))