refactor(wallpaper): integrate flexrow widget in libcosmic
This commit is contained in:
parent
c933f80cde
commit
a109caf0cc
4 changed files with 94 additions and 129 deletions
114
Cargo.lock
generated
114
Cargo.lock
generated
|
|
@ -253,7 +253,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -270,7 +270,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -445,7 +445,7 @@ checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -735,7 +735,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"atomicwrites",
|
||||
"calloop",
|
||||
|
|
@ -750,7 +750,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config-derive"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
|
|
@ -759,7 +759,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-panel-config"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/cosmic-panel#9189de540ccc273f90c6f2635bc368b0898add20"
|
||||
source = "git+https://github.com/pop-os/cosmic-panel#a195fa719b622e60ccd57e522fb6cb591717b2f7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cosmic-config",
|
||||
|
|
@ -878,7 +878,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-theme"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cosmic-config",
|
||||
|
|
@ -1068,7 +1068,7 @@ dependencies = [
|
|||
"proc-macro2",
|
||||
"quote",
|
||||
"strsim",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1090,7 +1090,7 @@ checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a"
|
|||
dependencies = [
|
||||
"darling_core 0.20.1",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1132,7 +1132,7 @@ dependencies = [
|
|||
"darling 0.20.1",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1218,7 +1218,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1291,7 +1291,7 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1575,7 +1575,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1738,7 +1738,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1773,9 +1773,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "generator"
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f3e123d9ae7c02966b4d892e550bdc32164f05853cd40ab570650ad600596a8a"
|
||||
checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
|
|
@ -1855,9 +1855,9 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e"
|
|||
|
||||
[[package]]
|
||||
name = "glam"
|
||||
version = "0.24.0"
|
||||
version = "0.24.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ad83ab008a4fa3b31dfa713dd41b5a9bdea1e94e4cf1e2fc274ffbd49b0271d3"
|
||||
checksum = "42218cb640844e3872cc3c153dc975229e080a6c4733b34709ef445610550226"
|
||||
|
||||
[[package]]
|
||||
name = "glow"
|
||||
|
|
@ -2081,7 +2081,7 @@ dependencies = [
|
|||
"proc-macro2",
|
||||
"quote",
|
||||
"strsim",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
"unic-langid",
|
||||
]
|
||||
|
||||
|
|
@ -2101,7 +2101,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"iced_accessibility",
|
||||
"iced_core",
|
||||
|
|
@ -2117,7 +2117,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_accessibility"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"accesskit_unix",
|
||||
|
|
@ -2126,7 +2126,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_core"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"iced_accessibility",
|
||||
|
|
@ -2141,7 +2141,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_futures"
|
||||
version = "0.6.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"iced_core",
|
||||
|
|
@ -2154,7 +2154,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_graphics"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"bytemuck",
|
||||
|
|
@ -2171,7 +2171,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_renderer"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"iced_graphics",
|
||||
"iced_tiny_skia",
|
||||
|
|
@ -2183,7 +2183,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_runtime"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"iced_accessibility",
|
||||
"iced_core",
|
||||
|
|
@ -2195,7 +2195,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_sctk"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"enum-repr",
|
||||
"float-cmp",
|
||||
|
|
@ -2217,7 +2217,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_style"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"iced_core",
|
||||
"once_cell",
|
||||
|
|
@ -2227,7 +2227,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_tiny_skia"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"cosmic-text",
|
||||
|
|
@ -2245,7 +2245,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_wgpu"
|
||||
version = "0.10.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"bytemuck",
|
||||
|
|
@ -2266,7 +2266,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_widget"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"iced_renderer",
|
||||
"iced_runtime",
|
||||
|
|
@ -2281,7 +2281,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_winit"
|
||||
version = "0.9.1"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"iced_graphics",
|
||||
"iced_runtime",
|
||||
|
|
@ -2596,7 +2596,7 @@ checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b"
|
|||
[[package]]
|
||||
name = "libcosmic"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic#42d7baf0d5cb14ab476120be9dfcaea9bd1d0be4"
|
||||
source = "git+https://github.com/pop-os/libcosmic#b0db23a16923f7fb33faca870f1151951a494fb2"
|
||||
dependencies = [
|
||||
"apply",
|
||||
"cosmic-config",
|
||||
|
|
@ -3258,7 +3258,7 @@ checksum = "3c02bfa6b3ba8af5434fa0531bf5701f750d983d4260acd6867faca51cdc4484"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -3323,9 +3323,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
|
|||
|
||||
[[package]]
|
||||
name = "phf"
|
||||
version = "0.11.1"
|
||||
version = "0.11.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c"
|
||||
checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc"
|
||||
dependencies = [
|
||||
"phf_macros",
|
||||
"phf_shared",
|
||||
|
|
@ -3333,9 +3333,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "phf_generator"
|
||||
version = "0.11.1"
|
||||
version = "0.11.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf"
|
||||
checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0"
|
||||
dependencies = [
|
||||
"phf_shared",
|
||||
"rand",
|
||||
|
|
@ -3343,22 +3343,22 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "phf_macros"
|
||||
version = "0.11.1"
|
||||
version = "0.11.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "92aacdc5f16768709a569e913f7451034034178b05bdc8acda226659a3dccc66"
|
||||
checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b"
|
||||
dependencies = [
|
||||
"phf_generator",
|
||||
"phf_shared",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_shared"
|
||||
version = "0.11.1"
|
||||
version = "0.11.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676"
|
||||
checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b"
|
||||
dependencies = [
|
||||
"siphasher",
|
||||
]
|
||||
|
|
@ -3386,7 +3386,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -3735,7 +3735,7 @@ dependencies = [
|
|||
"proc-macro2",
|
||||
"quote",
|
||||
"rust-embed-utils",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
|
|
@ -3873,7 +3873,7 @@ checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -3884,14 +3884,14 @@ checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_spanned"
|
||||
version = "0.6.2"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d"
|
||||
checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
|
@ -4203,9 +4203,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.18"
|
||||
version = "2.0.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e"
|
||||
checksum = "fcb8d4cebc40aa517dfb69618fa647a346562e67228e2236ae0042ee6ac14775"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
@ -4295,7 +4295,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -4445,9 +4445,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "toml_datetime"
|
||||
version = "0.6.2"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f"
|
||||
checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
|
@ -4485,7 +4485,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -4811,7 +4811,7 @@ dependencies = [
|
|||
"once_cell",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
||||
|
|
@ -4845,7 +4845,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.18",
|
||||
"syn 2.0.20",
|
||||
"wasm-bindgen-backend",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -18,3 +18,9 @@ git = "https://github.com/pop-os/cosmic-bg"
|
|||
|
||||
[workspace.dependencies.cosmic-panel-config]
|
||||
git = "https://github.com/pop-os/cosmic-panel"
|
||||
|
||||
[patch."https://github.com/pop-os/libcosmic"]
|
||||
# libcosmic = { path = "../libcosmic" }
|
||||
# cosmic-config = { path = "../libcosmic/cosmic-config" }
|
||||
# libcosmic = { git = "https://github.com/pop-os/libcosmic?rev=master", branch = "flexalloc" }
|
||||
# cosmic-config = { git = "https://github.com/pop-os/libcosmic?rev=master", branch = "flexalloc" }
|
||||
|
|
@ -15,8 +15,8 @@ use cosmic::widget::{
|
|||
segmented_button::{self, SingleSelectModel},
|
||||
settings, toggler,
|
||||
};
|
||||
use cosmic::{iced::alignment::Horizontal, iced::Length, Element};
|
||||
use cosmic::{iced_core::alignment::Vertical, iced_runtime::core::image::Handle as ImageHandle};
|
||||
use cosmic::{iced::Length, Element};
|
||||
use cosmic::{iced_core::alignment, iced_runtime::core::image::Handle as ImageHandle};
|
||||
use cosmic_settings_desktop::wallpaper::{self, Entry, ScalingMode};
|
||||
use cosmic_settings_page::Section;
|
||||
use cosmic_settings_page::{self as page, section};
|
||||
|
|
@ -521,11 +521,12 @@ pub fn settings() -> Section<crate::pages::Message> {
|
|||
children.push(if page.config.same_on_all {
|
||||
cosmic::widget::text(fl!("all-displays"))
|
||||
.font(cosmic::font::FONT_SEMIBOLD)
|
||||
.horizontal_alignment(Horizontal::Center)
|
||||
.vertical_alignment(Vertical::Center)
|
||||
.horizontal_alignment(alignment::Horizontal::Center)
|
||||
.vertical_alignment(alignment::Vertical::Center)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.apply(cosmic::iced::widget::container)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fixed(32.0))
|
||||
.into()
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -4,17 +4,14 @@
|
|||
use super::Message;
|
||||
use apply::Apply;
|
||||
use cosmic::iced_core::{self, gradient::Linear, Background, BorderRadius, Color, Degrees};
|
||||
use cosmic::iced_core::{alignment, Length};
|
||||
use cosmic::iced_runtime::core::image::Handle as ImageHandle;
|
||||
use cosmic::{
|
||||
iced,
|
||||
iced_widget::{column, row},
|
||||
Element,
|
||||
};
|
||||
use cosmic::{iced, Element};
|
||||
use cosmic_settings_desktop::wallpaper;
|
||||
use slotmap::DefaultKey;
|
||||
|
||||
const COLOR_WIDTH: u16 = 70;
|
||||
const WALLPAPER_WIDTH: f32 = 158.0;
|
||||
const WALLPAPER_WIDTH: u16 = 158;
|
||||
|
||||
const COLUMN_SPACING: u16 = 12;
|
||||
const ROW_SPACING: u16 = 16;
|
||||
|
|
@ -69,78 +66,39 @@ pub fn color_image(
|
|||
|
||||
/// Color selection list
|
||||
pub fn color_select_options() -> Element<'static, Message> {
|
||||
cosmic::iced::widget::responsive(|size| {
|
||||
let items_per_row =
|
||||
flex_row_items(size.width, COLOR_WIDTH as f32, ROW_SPACING as f32, 8) as usize;
|
||||
flex_select_row(|vec, _size| {
|
||||
let elements = wallpaper::DEFAULT_COLORS.iter().cloned().map(color_button);
|
||||
|
||||
let mut color_column = Vec::with_capacity(wallpaper::DEFAULT_COLORS.len() / items_per_row);
|
||||
let mut colors = wallpaper::DEFAULT_COLORS.iter();
|
||||
vec.extend(elements);
|
||||
|
||||
while let Some(color) = colors.next() {
|
||||
let mut color_row = Vec::with_capacity(items_per_row);
|
||||
|
||||
color_row.push(color_button(color.clone()));
|
||||
|
||||
for color in colors.by_ref().take(items_per_row - 1) {
|
||||
color_row.push(color_button(color.clone()));
|
||||
}
|
||||
|
||||
color_column.push(row(color_row).spacing(ROW_SPACING).into());
|
||||
}
|
||||
|
||||
column(color_column)
|
||||
.spacing(COLUMN_SPACING)
|
||||
.padding(0)
|
||||
.apply(cosmic::iced::widget::container)
|
||||
.align_x(iced_core::alignment::Horizontal::Center)
|
||||
.width(size.width)
|
||||
.into()
|
||||
COLOR_WIDTH
|
||||
})
|
||||
.into()
|
||||
}
|
||||
|
||||
fn flex_row_items(available: f32, item_width: f32, spacing: f32, max_items: u32) -> u32 {
|
||||
let mut items = 2;
|
||||
|
||||
while items <= max_items && available >= (item_width + spacing) * items as f32 - spacing {
|
||||
items += 1;
|
||||
}
|
||||
|
||||
items - 1
|
||||
}
|
||||
|
||||
/// Background selection list
|
||||
pub fn wallpaper_select_options(page: &super::Page) -> Element<Message> {
|
||||
cosmic::iced::widget::responsive(|size| {
|
||||
let items_per_row =
|
||||
flex_row_items(size.width, WALLPAPER_WIDTH, ROW_SPACING as f32, 4) as usize;
|
||||
flex_select_row(move |vec, _size| {
|
||||
let elements = page
|
||||
.selection
|
||||
.selection_handles
|
||||
.iter()
|
||||
.map(|(id, handle)| wallpaper_button(handle, id));
|
||||
|
||||
let mut image_column =
|
||||
Vec::with_capacity(page.selection.selection_handles.len() / items_per_row);
|
||||
vec.extend(elements);
|
||||
|
||||
let mut image_handles = page.selection.selection_handles.iter();
|
||||
|
||||
while let Some((id, handle)) = image_handles.next() {
|
||||
let mut image_row = Vec::with_capacity(items_per_row);
|
||||
|
||||
image_row.push(wallpaper_button(handle, id));
|
||||
|
||||
for (id, handle) in image_handles.by_ref().take(items_per_row - 1) {
|
||||
image_row.push(wallpaper_button(handle, id));
|
||||
}
|
||||
|
||||
image_column.push(row(image_row).spacing(ROW_SPACING).into());
|
||||
}
|
||||
|
||||
column(image_column)
|
||||
.spacing(COLUMN_SPACING)
|
||||
.padding(0)
|
||||
.apply(cosmic::iced::widget::container)
|
||||
.align_x(iced_core::alignment::Horizontal::Center)
|
||||
.width(size.width)
|
||||
.into()
|
||||
WALLPAPER_WIDTH
|
||||
})
|
||||
.into()
|
||||
}
|
||||
|
||||
fn flex_select_row<'a>(
|
||||
elements: impl Fn(&mut Vec<Element<'a, Message>>, iced_core::Size) -> u16 + 'a,
|
||||
) -> Element<'a, Message> {
|
||||
cosmic::widget::flex_row(elements)
|
||||
.column_spacing(COLUMN_SPACING)
|
||||
.row_spacing(ROW_SPACING)
|
||||
.width(Length::Fill)
|
||||
.align_x(alignment::Horizontal::Center)
|
||||
.into()
|
||||
}
|
||||
|
||||
fn wallpaper_button(handle: &ImageHandle, id: DefaultKey) -> Element<Message> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue