Merge pull request #194 from pop-os/wallpapers
Wallpaper settings improvements
This commit is contained in:
commit
37e5bcc402
7 changed files with 151 additions and 121 deletions
84
Cargo.lock
generated
84
Cargo.lock
generated
|
|
@ -157,9 +157,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anyhow"
|
name = "anyhow"
|
||||||
version = "1.0.80"
|
version = "1.0.81"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1"
|
checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "apply"
|
name = "apply"
|
||||||
|
|
@ -318,9 +318,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-io"
|
name = "async-io"
|
||||||
version = "2.3.1"
|
version = "2.3.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65"
|
checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-lock 3.3.0",
|
"async-lock 3.3.0",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
|
@ -389,7 +389,7 @@ version = "0.2.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5"
|
checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-io 2.3.1",
|
"async-io 2.3.2",
|
||||||
"async-lock 2.8.0",
|
"async-lock 2.8.0",
|
||||||
"atomic-waker",
|
"atomic-waker",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
|
@ -674,9 +674,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bytemuck_derive"
|
name = "bytemuck_derive"
|
||||||
version = "1.5.0"
|
version = "1.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1"
|
checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|
@ -1076,7 +1076,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-comp-config"
|
name = "cosmic-comp-config"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/cosmic-comp#9cb1adb37cc7e0dab9b5e7076aee292e244c421b"
|
source = "git+https://github.com/pop-os/cosmic-comp#c685440155063dae2d09ebc70e2a41f88180b2c2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cosmic-config",
|
"cosmic-config",
|
||||||
"input",
|
"input",
|
||||||
|
|
@ -1086,7 +1086,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-config"
|
name = "cosmic-config"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atomicwrites",
|
"atomicwrites",
|
||||||
"calloop",
|
"calloop",
|
||||||
|
|
@ -1104,7 +1104,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#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.109",
|
"syn 1.0.109",
|
||||||
|
|
@ -1113,7 +1113,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-panel-config"
|
name = "cosmic-panel-config"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/cosmic-panel#e51be500fc0e62afe5a9002fd11f230f9fcbae41"
|
source = "git+https://github.com/pop-os/cosmic-panel#07fcaee64f80d9aa498be53d40077bc0a510437b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"cosmic-config",
|
"cosmic-config",
|
||||||
|
|
@ -1241,9 +1241,9 @@ dependencies = [
|
||||||
"dirs 5.0.1",
|
"dirs 5.0.1",
|
||||||
"freedesktop-icons",
|
"freedesktop-icons",
|
||||||
"futures-lite 2.2.0",
|
"futures-lite 2.2.0",
|
||||||
|
"futures-util",
|
||||||
"image",
|
"image",
|
||||||
"infer",
|
"infer",
|
||||||
"rayon",
|
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
@ -1251,7 +1251,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-text"
|
name = "cosmic-text"
|
||||||
version = "0.11.2"
|
version = "0.11.2"
|
||||||
source = "git+https://github.com/pop-os/cosmic-text.git#a53a0b3a8c085143470a9d26ac2c2911cc479033"
|
source = "git+https://github.com/pop-os/cosmic-text.git#18c3d2acec5e7f64a670c6643ee3ab220bc92a89"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.2",
|
"bitflags 2.4.2",
|
||||||
"fontdb",
|
"fontdb",
|
||||||
|
|
@ -1273,7 +1273,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#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"almost",
|
"almost",
|
||||||
"cosmic-config",
|
"cosmic-config",
|
||||||
|
|
@ -1972,9 +1972,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "freedesktop-desktop-entry"
|
name = "freedesktop-desktop-entry"
|
||||||
version = "0.5.0"
|
version = "0.5.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "45157175a725e81f3f594382430b6b78af5f8f72db9bd51b94f0785f80fc6d29"
|
checksum = "287f89b1a3d88dd04d2b65dfec39f3c381efbcded7b736456039c4ee49d54b17"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dirs 3.0.2",
|
"dirs 3.0.2",
|
||||||
"gettext-rs",
|
"gettext-rs",
|
||||||
|
|
@ -2496,7 +2496,7 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"toml 0.8.10",
|
"toml 0.8.11",
|
||||||
"unic-langid",
|
"unic-langid",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -2559,7 +2559,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced"
|
name = "iced"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_accessibility",
|
"iced_accessibility",
|
||||||
"iced_core",
|
"iced_core",
|
||||||
|
|
@ -2574,7 +2574,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#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"accesskit",
|
"accesskit",
|
||||||
"accesskit_unix",
|
"accesskit_unix",
|
||||||
|
|
@ -2583,7 +2583,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#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 1.3.2",
|
||||||
"iced_accessibility",
|
"iced_accessibility",
|
||||||
|
|
@ -2602,7 +2602,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#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"iced_core",
|
"iced_core",
|
||||||
|
|
@ -2615,7 +2615,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#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 1.3.2",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -2639,7 +2639,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#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_graphics",
|
"iced_graphics",
|
||||||
"iced_tiny_skia",
|
"iced_tiny_skia",
|
||||||
|
|
@ -2651,7 +2651,7 @@ 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#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_accessibility",
|
"iced_accessibility",
|
||||||
"iced_core",
|
"iced_core",
|
||||||
|
|
@ -2663,7 +2663,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#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"enum-repr",
|
"enum-repr",
|
||||||
"float-cmp",
|
"float-cmp",
|
||||||
|
|
@ -2689,7 +2689,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#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_core",
|
"iced_core",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
|
@ -2699,7 +2699,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#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"cosmic-text",
|
"cosmic-text",
|
||||||
|
|
@ -2716,7 +2716,7 @@ 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#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 1.3.2",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -2735,7 +2735,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_widget"
|
name = "iced_widget"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_renderer",
|
"iced_renderer",
|
||||||
"iced_runtime",
|
"iced_runtime",
|
||||||
|
|
@ -3132,7 +3132,7 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libcosmic"
|
name = "libcosmic"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#52491e08ee83254e64d1c3730fed221a40696a85"
|
source = "git+https://github.com/pop-os/libcosmic#64ecb0ea48f262e13b1036757211b70432fd42e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"apply",
|
"apply",
|
||||||
"ashpd 0.7.0",
|
"ashpd 0.7.0",
|
||||||
|
|
@ -4013,9 +4013,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.78"
|
version = "1.0.79"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
|
checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
@ -4956,7 +4956,7 @@ dependencies = [
|
||||||
"cfg-expr",
|
"cfg-expr",
|
||||||
"heck",
|
"heck",
|
||||||
"pkg-config",
|
"pkg-config",
|
||||||
"toml 0.8.10",
|
"toml 0.8.11",
|
||||||
"version-compare",
|
"version-compare",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -5012,18 +5012,18 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror"
|
name = "thiserror"
|
||||||
version = "1.0.57"
|
version = "1.0.58"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b"
|
checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"thiserror-impl",
|
"thiserror-impl",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror-impl"
|
name = "thiserror-impl"
|
||||||
version = "1.0.57"
|
version = "1.0.58"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81"
|
checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|
@ -5161,14 +5161,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toml"
|
name = "toml"
|
||||||
version = "0.8.10"
|
version = "0.8.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290"
|
checksum = "af06656561d28735e9c1cd63dfd57132c8155426aa6af24f36a00a351f88c48e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_spanned",
|
"serde_spanned",
|
||||||
"toml_datetime",
|
"toml_datetime",
|
||||||
"toml_edit 0.22.6",
|
"toml_edit 0.22.7",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -5204,9 +5204,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toml_edit"
|
name = "toml_edit"
|
||||||
version = "0.22.6"
|
version = "0.22.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6"
|
checksum = "18769cd1cec395d70860ceb4d932812a0b4d06b1a4bb336745a4d21b9496e992"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ use crate::pages::desktop::{
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use crate::pages::input::{self, keyboard};
|
use crate::pages::input::{self, keyboard};
|
||||||
use crate::pages::{display, sound, system, time};
|
use crate::pages::{self, display, sound, system, time};
|
||||||
use crate::subscription::desktop_files;
|
use crate::subscription::desktop_files;
|
||||||
use crate::widget::{page_title, search_header};
|
use crate::widget::{page_title, search_header};
|
||||||
use crate::PageCommands;
|
use crate::PageCommands;
|
||||||
|
|
@ -21,7 +21,7 @@ use cosmic::iced::Subscription;
|
||||||
use cosmic::widget::{button, row, text_input};
|
use cosmic::widget::{button, row, text_input};
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
app::{Command, Core},
|
app::{Command, Core},
|
||||||
cosmic_config::config_subscription,
|
cosmic_config::{config_state_subscription, config_subscription},
|
||||||
iced::{
|
iced::{
|
||||||
self,
|
self,
|
||||||
event::{self, wayland, PlatformSpecific},
|
event::{self, wayland, PlatformSpecific},
|
||||||
|
|
@ -228,6 +228,11 @@ impl cosmic::Application for SettingsApp {
|
||||||
|
|
||||||
Message::PanelConfig(update.config)
|
Message::PanelConfig(update.config)
|
||||||
}),
|
}),
|
||||||
|
config_state_subscription(0, cosmic_bg_config::NAME.into(), 1).map(|update| {
|
||||||
|
Message::PageMessage(pages::Message::DesktopWallpaper(
|
||||||
|
pages::desktop::wallpaper::Message::UpdateState(update.config),
|
||||||
|
))
|
||||||
|
}),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -259,7 +259,7 @@ impl Page {
|
||||||
button(text(fl!("add")))
|
button(text(fl!("add")))
|
||||||
.style(button::Style::Custom {
|
.style(button::Style::Custom {
|
||||||
active: Box::new(|focused, theme| {
|
active: Box::new(|focused, theme| {
|
||||||
let mut style = theme.active(focused, &button::Style::Text);
|
let mut style = theme.active(focused, false, &button::Style::Text);
|
||||||
style.text_color = Some(theme.cosmic().accent_color().into());
|
style.text_color = Some(theme.cosmic().accent_color().into());
|
||||||
style
|
style
|
||||||
}),
|
}),
|
||||||
|
|
@ -271,12 +271,12 @@ impl Page {
|
||||||
style
|
style
|
||||||
}),
|
}),
|
||||||
hovered: Box::new(|focused, theme| {
|
hovered: Box::new(|focused, theme| {
|
||||||
let mut style = theme.hovered(focused, &theme::Button::Text);
|
let mut style = theme.hovered(focused, false, &theme::Button::Text);
|
||||||
style.text_color = Some(theme.cosmic().accent_color().into());
|
style.text_color = Some(theme.cosmic().accent_color().into());
|
||||||
style
|
style
|
||||||
}),
|
}),
|
||||||
pressed: Box::new(|focused, theme| {
|
pressed: Box::new(|focused, theme| {
|
||||||
let mut style = theme.pressed(focused, &theme::Button::Text);
|
let mut style = theme.pressed(focused, false, &theme::Button::Text);
|
||||||
style.text_color = Some(theme.cosmic().accent_color().into());
|
style.text_color = Some(theme.cosmic().accent_color().into());
|
||||||
style
|
style
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ mod config;
|
||||||
pub mod widgets;
|
pub mod widgets;
|
||||||
|
|
||||||
pub use config::Config;
|
pub use config::Config;
|
||||||
|
use futures::StreamExt;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
|
|
@ -114,6 +115,8 @@ pub enum Message {
|
||||||
Select(DefaultKey),
|
Select(DefaultKey),
|
||||||
/// Changes the slideshow parameter.
|
/// Changes the slideshow parameter.
|
||||||
Slideshow(bool),
|
Slideshow(bool),
|
||||||
|
/// State change from cosmic-bg
|
||||||
|
UpdateState(cosmic_bg_config::state::State),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<Message> for crate::app::Message {
|
impl From<Message> for crate::app::Message {
|
||||||
|
|
@ -138,6 +141,9 @@ pub enum Category {
|
||||||
|
|
||||||
/// The page struct for the wallpaper view.
|
/// The page struct for the wallpaper view.
|
||||||
pub struct Page {
|
pub struct Page {
|
||||||
|
/// Whether to show the tab_bar or not.
|
||||||
|
show_tab_bar: bool,
|
||||||
|
|
||||||
/// The display that is currently being configured.
|
/// The display that is currently being configured.
|
||||||
///
|
///
|
||||||
/// If set to `None`, all displays will have the same wallpaper.
|
/// If set to `None`, all displays will have the same wallpaper.
|
||||||
|
|
@ -203,10 +209,12 @@ impl page::Page<crate::pages::Message> for Page {
|
||||||
fn reload(&mut self, _page: page::Entity) -> Command<crate::pages::Message> {
|
fn reload(&mut self, _page: page::Entity) -> Command<crate::pages::Message> {
|
||||||
let current_folder = self.config.current_folder().to_owned();
|
let current_folder = self.config.current_folder().to_owned();
|
||||||
|
|
||||||
|
let recurse = self.categories.selected == Some(Category::Wallpapers);
|
||||||
|
|
||||||
command::future(async move {
|
command::future(async move {
|
||||||
let (service_config, displays) = wallpaper::config().await;
|
let (service_config, displays) = wallpaper::config().await;
|
||||||
|
|
||||||
let selection = change_folder(current_folder).await;
|
let selection = change_folder(current_folder, recurse).await;
|
||||||
|
|
||||||
crate::pages::Message::DesktopWallpaper(Message::Init(Box::new(InitUpdate {
|
crate::pages::Message::DesktopWallpaper(Message::Init(Box::new(InitUpdate {
|
||||||
service_config,
|
service_config,
|
||||||
|
|
@ -222,6 +230,7 @@ impl page::AutoBind<crate::pages::Message> for Page {}
|
||||||
impl Default for Page {
|
impl Default for Page {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
let mut page = Page {
|
let mut page = Page {
|
||||||
|
show_tab_bar: false,
|
||||||
active_output: None,
|
active_output: None,
|
||||||
cached_display_handle: None,
|
cached_display_handle: None,
|
||||||
categories: {
|
categories: {
|
||||||
|
|
@ -507,7 +516,7 @@ impl Page {
|
||||||
if self.config.current_folder.is_some() {
|
if self.config.current_folder.is_some() {
|
||||||
let _ = self.config.set_current_folder(None);
|
let _ = self.config.set_current_folder(None);
|
||||||
command = cosmic::command::future(async move {
|
command = cosmic::command::future(async move {
|
||||||
let folder = change_folder(Config::default_folder().to_owned()).await;
|
let folder = change_folder(Config::default_folder().to_owned(), true).await;
|
||||||
Message::ChangeFolder(folder).into()
|
Message::ChangeFolder(folder).into()
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -527,7 +536,7 @@ impl Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
command = cosmic::command::future(async move {
|
command = cosmic::command::future(async move {
|
||||||
Message::ChangeFolder(change_folder(path).await).into()
|
Message::ChangeFolder(change_folder(path, false).await).into()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -608,6 +617,12 @@ impl Page {
|
||||||
#[allow(clippy::too_many_lines)]
|
#[allow(clippy::too_many_lines)]
|
||||||
pub fn update(&mut self, message: Message) -> Command<crate::app::Message> {
|
pub fn update(&mut self, message: Message) -> Command<crate::app::Message> {
|
||||||
match message {
|
match message {
|
||||||
|
Message::UpdateState(_state) => {
|
||||||
|
if let Choice::Slideshow = self.selection.active {
|
||||||
|
self.cache_display_image();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Message::DragColorDialog => {
|
Message::DragColorDialog => {
|
||||||
return cosmic::iced_sctk::commands::window::start_drag_window(self.color_dialog)
|
return cosmic::iced_sctk::commands::window::start_drag_window(self.color_dialog)
|
||||||
}
|
}
|
||||||
|
|
@ -819,9 +834,12 @@ impl Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Avoid walking user-selected folders.
|
||||||
|
let recurse = self.categories.selected == Some(Category::Wallpapers);
|
||||||
|
|
||||||
// Load the wallpapers from the selected folder into the view.
|
// Load the wallpapers from the selected folder into the view.
|
||||||
return cosmic::command::future(async move {
|
return cosmic::command::future(async move {
|
||||||
let message = Message::ChangeFolder(change_folder(path).await);
|
let message = Message::ChangeFolder(change_folder(path, recurse).await);
|
||||||
let page_message = crate::pages::Message::DesktopWallpaper(message);
|
let page_message = crate::pages::Message::DesktopWallpaper(message);
|
||||||
crate::Message::PageMessage(page_message)
|
crate::Message::PageMessage(page_message)
|
||||||
});
|
});
|
||||||
|
|
@ -842,8 +860,7 @@ impl Page {
|
||||||
|
|
||||||
// Loads a single custom image and its thumbnail for display in the backgrounds view.
|
// Loads a single custom image and its thumbnail for display in the backgrounds view.
|
||||||
return cosmic::command::future(async move {
|
return cosmic::command::future(async move {
|
||||||
let result =
|
let result = wallpaper::load_image_with_thumbnail(path);
|
||||||
wallpaper::load_image_with_thumbnail(&mut Vec::new(), path).await;
|
|
||||||
|
|
||||||
let message = Message::ImageAdd(result.map(Arc::new));
|
let message = Message::ImageAdd(result.map(Arc::new));
|
||||||
let page_message = crate::pages::Message::DesktopWallpaper(message);
|
let page_message = crate::pages::Message::DesktopWallpaper(message);
|
||||||
|
|
@ -856,6 +873,7 @@ impl Page {
|
||||||
self.outputs.clear();
|
self.outputs.clear();
|
||||||
self.wallpaper_service_config = update.service_config;
|
self.wallpaper_service_config = update.service_config;
|
||||||
self.selection = update.selection;
|
self.selection = update.selection;
|
||||||
|
self.show_tab_bar = update.displays.len() > 1;
|
||||||
|
|
||||||
// Sync custom colors from config.
|
// Sync custom colors from config.
|
||||||
for color in self.config.custom_colors() {
|
for color in self.config.custom_colors() {
|
||||||
|
|
@ -881,8 +899,7 @@ impl Page {
|
||||||
// Load preview images concurrently for each custom image stored in the on-disk config.
|
// Load preview images concurrently for each custom image stored in the on-disk config.
|
||||||
return cosmic::command::batch(custom_images.iter().cloned().map(|path| {
|
return cosmic::command::batch(custom_images.iter().cloned().map(|path| {
|
||||||
cosmic::command::future(async move {
|
cosmic::command::future(async move {
|
||||||
let result =
|
let result = wallpaper::load_image_with_thumbnail(path);
|
||||||
wallpaper::load_image_with_thumbnail(&mut Vec::new(), path).await;
|
|
||||||
|
|
||||||
Message::ImageAdd(result.map(Arc::new)).into()
|
Message::ImageAdd(result.map(Arc::new)).into()
|
||||||
})
|
})
|
||||||
|
|
@ -1042,11 +1059,11 @@ impl Context {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn change_folder(current_folder: PathBuf) -> Context {
|
pub async fn change_folder(current_folder: PathBuf, recurse: bool) -> Context {
|
||||||
let mut update = Context::default();
|
let mut update = Context::default();
|
||||||
let mut wallpapers = wallpaper::load_each_from_path(current_folder);
|
let mut wallpapers = wallpaper::load_each_from_path(current_folder, recurse).await;
|
||||||
|
|
||||||
while let Some((path, display_image, selection_image)) = wallpapers.recv().await {
|
while let Some((path, display_image, selection_image)) = wallpapers.next().await {
|
||||||
let id = update.paths.insert(path);
|
let id = update.paths.insert(path);
|
||||||
|
|
||||||
update.display_images.insert(id, display_image);
|
update.display_images.insert(id, display_image);
|
||||||
|
|
@ -1109,8 +1126,8 @@ pub fn settings() -> Section<crate::pages::Message> {
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
|
|
||||||
children.push(if page.wallpaper_service_config.same_on_all {
|
if page.wallpaper_service_config.same_on_all {
|
||||||
text(fl!("all-displays"))
|
let element = text(fl!("all-displays"))
|
||||||
.font(cosmic::font::FONT_SEMIBOLD)
|
.font(cosmic::font::FONT_SEMIBOLD)
|
||||||
.horizontal_alignment(alignment::Horizontal::Center)
|
.horizontal_alignment(alignment::Horizontal::Center)
|
||||||
.vertical_alignment(alignment::Vertical::Center)
|
.vertical_alignment(alignment::Vertical::Center)
|
||||||
|
|
@ -1118,13 +1135,16 @@ pub fn settings() -> Section<crate::pages::Message> {
|
||||||
.height(Length::Fill)
|
.height(Length::Fill)
|
||||||
.apply(cosmic::widget::container)
|
.apply(cosmic::widget::container)
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.height(Length::Fixed(32.0))
|
.height(Length::Fixed(32.0));
|
||||||
.into()
|
|
||||||
} else {
|
children.push(element.into());
|
||||||
tab_bar::horizontal(&page.outputs)
|
} else if page.show_tab_bar {
|
||||||
.on_activate(Message::Output)
|
let element = tab_bar::horizontal(&page.outputs)
|
||||||
.into()
|
.button_alignment(Alignment::Center)
|
||||||
});
|
.on_activate(Message::Output);
|
||||||
|
|
||||||
|
children.push(element.into());
|
||||||
|
}
|
||||||
|
|
||||||
let wallpaper_fit =
|
let wallpaper_fit =
|
||||||
cosmic::widget::dropdown(&page.fit_options, Some(page.selected_fit), Message::Fit);
|
cosmic::widget::dropdown(&page.fit_options, Some(page.selected_fit), Message::Fit);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ pub mod text;
|
||||||
use crate::{app, pages};
|
use crate::{app, pages};
|
||||||
use apply::Apply;
|
use apply::Apply;
|
||||||
use arrangement::Arrangement;
|
use arrangement::Arrangement;
|
||||||
use cosmic::iced::Length;
|
use cosmic::iced::{Alignment, Length};
|
||||||
use cosmic::iced_widget::scrollable::{Direction, Properties, RelativeOffset};
|
use cosmic::iced_widget::scrollable::{Direction, Properties, RelativeOffset};
|
||||||
use cosmic::widget::{
|
use cosmic::widget::{
|
||||||
column, container, dropdown, list_column, segmented_button, tab_bar, toggler,
|
column, container, dropdown, list_column, segmented_button, tab_bar, toggler,
|
||||||
|
|
@ -459,8 +459,9 @@ impl Page {
|
||||||
let mut content = column().spacing(theme.cosmic().space_m());
|
let mut content = column().spacing(theme.cosmic().space_m());
|
||||||
|
|
||||||
if self.list.outputs.len() > 1 {
|
if self.list.outputs.len() > 1 {
|
||||||
let display_switcher =
|
let display_switcher = tab_bar::horizontal(&self.display_tabs)
|
||||||
tab_bar::horizontal(&self.display_tabs).on_activate(Message::Display);
|
.button_alignment(Alignment::Center)
|
||||||
|
.on_activate(Message::Display);
|
||||||
|
|
||||||
let display_enable = list_column().add(cosmic::widget::settings::item(
|
let display_enable = list_column().add(cosmic::widget::settings::item(
|
||||||
&*text::DISPLAY_ENABLE,
|
&*text::DISPLAY_ENABLE,
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ cosmic-randr-shell = { workspace = true }
|
||||||
dirs = "5.0.1"
|
dirs = "5.0.1"
|
||||||
freedesktop-icons = "0.2.5"
|
freedesktop-icons = "0.2.5"
|
||||||
futures-lite = "2.2.0"
|
futures-lite = "2.2.0"
|
||||||
|
futures-util = "0.3.30"
|
||||||
image = "0.24.8"
|
image = "0.24.8"
|
||||||
infer = "0.15.0"
|
infer = "0.15.0"
|
||||||
rayon = "1.8.1"
|
|
||||||
tokio = { version = "1.35.1", features = ["sync"] }
|
tokio = { version = "1.35.1", features = ["sync"] }
|
||||||
tracing = "0.1.40"
|
tracing = "0.1.40"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
pub use cosmic_bg_config::{Color, Config, Entry, Gradient, ScalingMode, Source};
|
pub use cosmic_bg_config::{Color, Config, Entry, Gradient, ScalingMode, Source};
|
||||||
|
|
||||||
|
use futures_lite::Stream;
|
||||||
use image::{DynamicImage, ImageBuffer, Rgba, RgbaImage};
|
use image::{DynamicImage, ImageBuffer, Rgba, RgbaImage};
|
||||||
use std::{
|
use std::{
|
||||||
borrow::Cow,
|
borrow::Cow,
|
||||||
|
|
@ -7,8 +8,8 @@ use std::{
|
||||||
hash::{Hash, Hasher},
|
hash::{Hash, Hasher},
|
||||||
io::Read,
|
io::Read,
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
|
pin::Pin,
|
||||||
};
|
};
|
||||||
use tokio::sync::mpsc::{self, Receiver};
|
|
||||||
|
|
||||||
pub const DEFAULT_COLORS: &[Color] = &[
|
pub const DEFAULT_COLORS: &[Color] = &[
|
||||||
Color::Single([0.580, 0.922, 0.922]),
|
Color::Single([0.580, 0.922, 0.922]),
|
||||||
|
|
@ -87,12 +88,11 @@ pub fn cache_dir() -> Option<PathBuf> {
|
||||||
|
|
||||||
/// Loads wallpapers in parallel by spawning tasks with a rayon thread pool.
|
/// Loads wallpapers in parallel by spawning tasks with a rayon thread pool.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn load_each_from_path(path: PathBuf) -> Receiver<(PathBuf, RgbaImage, RgbaImage)> {
|
pub async fn load_each_from_path(
|
||||||
let (tx, rx) = mpsc::channel(1);
|
path: PathBuf,
|
||||||
|
recurse: bool,
|
||||||
tokio::task::spawn(async move {
|
) -> Pin<Box<dyn Send + Stream<Item = (PathBuf, RgbaImage, RgbaImage)>>> {
|
||||||
// Scratch space for storing images into.
|
let wallpapers = tokio::task::spawn_blocking(move || {
|
||||||
let mut buffer = Vec::new();
|
|
||||||
// Directories to search recursively.
|
// Directories to search recursively.
|
||||||
let mut paths = vec![path];
|
let mut paths = vec![path];
|
||||||
// Discovered image files that will be loaded as wallpapers.
|
// Discovered image files that will be loaded as wallpapers.
|
||||||
|
|
@ -108,7 +108,7 @@ pub fn load_each_from_path(path: PathBuf) -> Receiver<(PathBuf, RgbaImage, RgbaI
|
||||||
let path = entry.path();
|
let path = entry.path();
|
||||||
|
|
||||||
// Recursively search directories, while storing only image files.
|
// Recursively search directories, while storing only image files.
|
||||||
if file_type.is_dir() {
|
if recurse && file_type.is_dir() {
|
||||||
paths.push(path);
|
paths.push(path);
|
||||||
} else if file_type.is_file() {
|
} else if file_type.is_file() {
|
||||||
let Ok(Some(kind)) = infer::get_from_path(&path) else {
|
let Ok(Some(kind)) = infer::get_from_path(&path) else {
|
||||||
|
|
@ -117,24 +117,34 @@ pub fn load_each_from_path(path: PathBuf) -> Receiver<(PathBuf, RgbaImage, RgbaI
|
||||||
|
|
||||||
if infer::MatcherType::Image == kind.matcher_type() {
|
if infer::MatcherType::Image == kind.matcher_type() {
|
||||||
wallpapers.insert(path);
|
wallpapers.insert(path);
|
||||||
|
|
||||||
|
if wallpapers.len() > 99 {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for path in wallpapers {
|
wallpapers
|
||||||
if let Some(value) = load_image_with_thumbnail(&mut buffer, path).await {
|
|
||||||
let _res = tx.send(value).await;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
rx
|
if let Ok(wallpapers) = wallpapers.await {
|
||||||
|
use futures_util::StreamExt;
|
||||||
|
let future = futures_util::stream::iter(wallpapers)
|
||||||
|
.map(|path| tokio::task::spawn_blocking(|| load_image_with_thumbnail(path)))
|
||||||
|
.buffered(4)
|
||||||
|
.filter_map(|value| async { value.ok()? });
|
||||||
|
|
||||||
|
Box::pin(future)
|
||||||
|
} else {
|
||||||
|
Box::pin(futures_lite::stream::empty())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn load_image_with_thumbnail(
|
#[must_use]
|
||||||
buffer: &mut Vec<u8>,
|
pub fn load_image_with_thumbnail(
|
||||||
path: PathBuf,
|
path: PathBuf,
|
||||||
) -> Option<(
|
) -> Option<(
|
||||||
PathBuf,
|
PathBuf,
|
||||||
|
|
@ -142,54 +152,48 @@ pub async fn load_image_with_thumbnail(
|
||||||
ImageBuffer<Rgba<u8>, Vec<u8>>,
|
ImageBuffer<Rgba<u8>, Vec<u8>>,
|
||||||
)> {
|
)> {
|
||||||
let cache_dir = cache_dir();
|
let cache_dir = cache_dir();
|
||||||
let image_operation = load_thumbnail(buffer, cache_dir.as_deref(), &path);
|
let image_operation = load_thumbnail(&mut Vec::new(), cache_dir.as_deref(), &path);
|
||||||
|
|
||||||
let (tx, rx) = tokio::sync::oneshot::channel();
|
|
||||||
|
|
||||||
if let Some(image_operation) = image_operation {
|
if let Some(image_operation) = image_operation {
|
||||||
let tokio_handle = tokio::runtime::Handle::current();
|
let tokio_handle = tokio::runtime::Handle::current();
|
||||||
|
|
||||||
rayon::spawn_fifo(move || {
|
let display_thumbnail = match image_operation {
|
||||||
let display_thumbnail = match image_operation {
|
ImageOperation::Cached(thumbnail) => thumbnail.to_rgba8(),
|
||||||
ImageOperation::Cached(thumbnail) => thumbnail.to_rgba8(),
|
|
||||||
|
|
||||||
ImageOperation::GenerateThumbnail { path, image } => {
|
ImageOperation::GenerateThumbnail { path, image } => {
|
||||||
let image = image.thumbnail(300, 169).to_rgba8();
|
let image = image.thumbnail(300, 169).to_rgba8();
|
||||||
|
|
||||||
if let Some(path) = path {
|
if let Some(path) = path {
|
||||||
// Save thumbnail to disk without blocking.
|
// Save thumbnail to disk without blocking.
|
||||||
tokio_handle.spawn_blocking({
|
tokio_handle.spawn_blocking({
|
||||||
let image = image.clone();
|
let image = image.clone();
|
||||||
move || {
|
move || {
|
||||||
if let Err(why) = image.save(&path) {
|
if let Err(why) = image.save(&path) {
|
||||||
tracing::error!(?path, ?why, "failed to save image thumbnail");
|
tracing::error!(?path, ?why, "failed to save image thumbnail");
|
||||||
|
|
||||||
let _res = std::fs::remove_file(&path);
|
let _res = std::fs::remove_file(&path);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
image
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
let mut selection_thumbnail = image::imageops::resize(
|
image
|
||||||
&display_thumbnail,
|
}
|
||||||
158,
|
};
|
||||||
105,
|
|
||||||
image::imageops::FilterType::Lanczos3,
|
|
||||||
);
|
|
||||||
|
|
||||||
round(&mut selection_thumbnail, [8, 8, 8, 8]);
|
let mut selection_thumbnail = image::imageops::resize(
|
||||||
|
&display_thumbnail,
|
||||||
|
158,
|
||||||
|
105,
|
||||||
|
image::imageops::FilterType::Lanczos3,
|
||||||
|
);
|
||||||
|
|
||||||
let _res = tx.send(Some((path, display_thumbnail, selection_thumbnail)));
|
round(&mut selection_thumbnail, [8, 8, 8, 8]);
|
||||||
});
|
|
||||||
|
Some((path, display_thumbnail, selection_thumbnail))
|
||||||
} else {
|
} else {
|
||||||
let _res = tx.send(None);
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
rx.await.unwrap_or(None)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ImageOperation {
|
enum ImageOperation {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue