diff --git a/Cargo.lock b/Cargo.lock index e9205b2..cb40e12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -104,7 +104,6 @@ dependencies = [ [[package]] name = "accounts-zbus" version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" dependencies = [ "zbus", ] @@ -355,12 +354,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" -[[package]] -name = "as-raw-xcb-connection" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" - [[package]] name = "as-slice" version = "0.2.1" @@ -831,7 +824,6 @@ dependencies = [ [[package]] name = "bluez-zbus" version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" dependencies = [ "futures-channel", "futures-util", @@ -1135,7 +1127,6 @@ dependencies = [ [[package]] name = "clipboard_macos" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" dependencies = [ "objc", "objc-foundation", @@ -1145,22 +1136,12 @@ dependencies = [ [[package]] name = "clipboard_wayland" version = "0.2.2" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" dependencies = [ "dnd", "mime 0.1.0", "smithay-clipboard", ] -[[package]] -name = "clipboard_x11" -version = "0.4.2" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" -dependencies = [ - "thiserror 1.0.69", - "x11rb", -] - [[package]] name = "cocoa" version = "0.25.0" @@ -1199,7 +1180,7 @@ checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" dependencies = [ "serde", "termcolor", - "unicode-width 0.1.14", + "unicode-width 0.2.2", ] [[package]] @@ -1369,7 +1350,7 @@ version = "0.1.0" source = "git+https://github.com/pop-os/cosmic-protocols//?rev=d0e95be#d0e95be25e423cfe523b11111a3666ed7aaf0dc4" dependencies = [ "bitflags 2.11.1", - "cosmic-protocols", + "cosmic-protocols 0.1.0", "libc", "smithay-client-toolkit", "wayland-client", @@ -1391,7 +1372,6 @@ dependencies = [ [[package]] name = "cosmic-config" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1412,7 +1392,6 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "quote", "syn 2.0.117", @@ -1421,7 +1400,6 @@ dependencies = [ [[package]] name = "cosmic-dbus-a11y" version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" dependencies = [ "zbus", ] @@ -1429,7 +1407,6 @@ dependencies = [ [[package]] name = "cosmic-dbus-networkmanager" version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" dependencies = [ "bitflags 2.11.1", "derive_builder", @@ -1514,12 +1491,25 @@ dependencies = [ "wayland-server", ] +[[package]] +name = "cosmic-protocols" +version = "0.2.0" +dependencies = [ + "bitflags 2.11.1", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-wlr", + "wayland-scanner", + "wayland-server", +] + [[package]] name = "cosmic-randr" version = "0.1.0" source = "git+https://github.com/pop-os/cosmic-randr#6e8e795970fa06d434af22775e415b517f7552d3" dependencies = [ - "cosmic-protocols", + "cosmic-protocols 0.1.0", "indexmap 2.14.0", "thiserror 2.0.18", "tokio", @@ -1556,7 +1546,7 @@ dependencies = [ "cosmic-idle-config", "cosmic-mime-apps", "cosmic-panel-config", - "cosmic-protocols", + "cosmic-protocols 0.1.0", "cosmic-randr", "cosmic-randr-shell", "cosmic-settings-a11y-manager-subscription", @@ -1588,7 +1578,7 @@ dependencies = [ "itertools 0.14.0", "itoa", "jiff", - "libcosmic", + "libcosmic-yoda", "locale1", "locales-rs", "mime 0.3.17", @@ -1627,7 +1617,7 @@ dependencies = [ name = "cosmic-settings-a11y-manager-subscription" version = "1.0.7" dependencies = [ - "cosmic-protocols", + "cosmic-protocols 0.2.0", "iced_futures", "num-derive", "num-traits", @@ -1686,8 +1676,7 @@ dependencies = [ [[package]] name = "cosmic-settings-daemon" -version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" +version = "0.1.1-yoda.1" dependencies = [ "zbus", ] @@ -1737,7 +1726,7 @@ version = "1.0.7" dependencies = [ "derive_setters", "downcast-rs 2.0.2", - "libcosmic", + "libcosmic-yoda", "regex", "slab", "slotmap", @@ -1762,7 +1751,7 @@ dependencies = [ "cosmic-pipewire", "futures", "intmap", - "libcosmic", + "libcosmic-yoda", "numtoa", "rustix 1.1.4", "tokio", @@ -1803,8 +1792,7 @@ dependencies = [ [[package]] name = "cosmic-text" -version = "0.18.2" -source = "git+https://github.com/pop-os/cosmic-text.git#4d74f795cc771fdcc7ea0f9cacba63fcf036fad6" +version = "0.19.0" dependencies = [ "bitflags 2.11.1", "fontdb", @@ -1822,12 +1810,12 @@ dependencies = [ "unicode-linebreak", "unicode-script", "unicode-segmentation", + "unicode-width 0.2.2", ] [[package]] name = "cosmic-theme" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "almost", "configparser", @@ -1940,12 +1928,6 @@ dependencies = [ "uncased", ] -[[package]] -name = "ctor-lite" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e162d0c2e2068eb736b71e5597eff0b9944e6b973cd9f37b6a288ab9bf20e300" - [[package]] name = "cursor-icon" version = "1.2.0" @@ -2202,7 +2184,6 @@ dependencies = [ [[package]] name = "dnd" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" dependencies = [ "bitflags 2.11.1", "mime 0.1.0", @@ -2237,45 +2218,6 @@ name = "dpi" version = "0.1.2" source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" -[[package]] -name = "drm" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0f8a69e60d75ae7dab4ef26a59ca99f2a89d4c142089b537775ae0c198bdcde" -dependencies = [ - "bitflags 2.11.1", - "bytemuck", - "drm-ffi", - "drm-fourcc", - "rustix 0.38.44", -] - -[[package]] -name = "drm-ffi" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41334f8405792483e32ad05fbb9c5680ff4e84491883d2947a4757dc54cb2ac6" -dependencies = [ - "drm-sys", - "rustix 0.38.44", -] - -[[package]] -name = "drm-fourcc" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" - -[[package]] -name = "drm-sys" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d09ff881f92f118b11105ba5e34ff8f4adf27b30dae8f12e28c193af1c83176" -dependencies = [ - "libc", - "linux-raw-sys 0.6.5", -] - [[package]] name = "dyn-clone" version = "1.0.20" @@ -2820,16 +2762,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "gethostname" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" -dependencies = [ - "rustix 1.1.4", - "windows-link 0.2.1", -] - [[package]] name = "getrandom" version = "0.2.17" @@ -3151,7 +3083,6 @@ checksum = "f558a64ac9af88b5ba400d99b579451af0d39c6d360980045b91aac966d705e2" [[package]] name = "hostname1-zbus" version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" dependencies = [ "zbus", ] @@ -3250,7 +3181,6 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "dnd", "iced_accessibility", @@ -3271,7 +3201,6 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "accesskit", "accesskit_winit", @@ -3280,7 +3209,6 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "bitflags 2.11.1", "bytes", @@ -3305,7 +3233,6 @@ dependencies = [ [[package]] name = "iced_debug" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "iced_core", "iced_futures", @@ -3315,7 +3242,6 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "futures", "iced_core", @@ -3329,7 +3255,6 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "bitflags 2.11.1", "bytemuck", @@ -3350,7 +3275,6 @@ dependencies = [ [[package]] name = "iced_program" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "iced_graphics", "iced_runtime", @@ -3359,7 +3283,6 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -3371,7 +3294,6 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "bytes", "cosmic-client-toolkit", @@ -3387,7 +3309,6 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "bytemuck", "cosmic-text", @@ -3404,9 +3325,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ - "as-raw-xcb-connection", "bitflags 2.11.1", "bytemuck", "cosmic-client-toolkit", @@ -3423,19 +3342,16 @@ dependencies = [ "rustc-hash 2.1.2", "rustix 0.38.44", "thiserror 2.0.18", - "tiny-xlib", "wayland-backend", "wayland-client", "wayland-protocols", "wayland-sys", "wgpu", - "x11rb", ] [[package]] name = "iced_widget" version = "0.14.2" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "cosmic-client-toolkit", "dnd", @@ -3455,7 +3371,6 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "cosmic-client-toolkit", "cursor-icon", @@ -4565,9 +4480,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" [[package]] -name = "libcosmic" -version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" +name = "libcosmic-yoda" +version = "0.1.0-yoda.2" dependencies = [ "apply", "ashpd 0.12.3", @@ -4743,12 +4657,6 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" -[[package]] -name = "linux-raw-sys" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a385b1be4e5c3e362ad2ffa73c392e53f031eaa5b7d648e64cd87f27f6063d7" - [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -4770,7 +4678,6 @@ checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" [[package]] name = "locale1" version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" dependencies = [ "zbus", ] @@ -4981,7 +4888,6 @@ dependencies = [ [[package]] name = "mime" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" dependencies = [ "smithay-clipboard", ] @@ -5113,7 +5019,6 @@ dependencies = [ [[package]] name = "nm-secret-agent-manager" version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" dependencies = [ "zbus", ] @@ -7008,12 +6913,10 @@ name = "softbuffer" version = "0.4.1" source = "git+https://github.com/pop-os/softbuffer?tag=cosmic-4.0#a3f77e251e7422803f693df6e3fc313c010c4dcb" dependencies = [ - "as-raw-xcb-connection", "bytemuck", "cfg_aliases 0.2.1", "cocoa", "core-graphics", - "drm", "fastrand", "foreign-types", "js-sys", @@ -7023,14 +6926,12 @@ dependencies = [ "raw-window-handle", "redox_syscall 0.5.18", "rustix 0.38.44", - "tiny-xlib", "wasm-bindgen", "wayland-backend", "wayland-client", "wayland-sys", "web-sys", "windows-sys 0.52.0", - "x11rb", ] [[package]] @@ -7351,7 +7252,6 @@ dependencies = [ [[package]] name = "timedate-zbus" version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" dependencies = [ "zbus", ] @@ -7382,19 +7282,6 @@ dependencies = [ "strict-num", ] -[[package]] -name = "tiny-xlib" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0324504befd01cab6e0c994f34b2ffa257849ee019d3fb3b64fb2c858887d89e" -dependencies = [ - "as-raw-xcb-connection", - "ctor-lite", - "libloading", - "pkg-config", - "tracing", -] - [[package]] name = "tinystr" version = "0.8.3" @@ -7754,7 +7641,6 @@ checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "upower_dbus" version = "0.3.2" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" dependencies = [ "serde", "serde_repr", @@ -8372,12 +8258,10 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window_clipboard" version = "0.4.1" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" dependencies = [ "clipboard-win", "clipboard_macos", "clipboard_wayland", - "clipboard_x11", "dnd", "mime 0.1.0", "raw-window-handle", @@ -8901,7 +8785,6 @@ dependencies = [ "winit-wayland", "winit-web", "winit-win32", - "winit-x11", ] [[package]] @@ -8952,7 +8835,6 @@ dependencies = [ "smol_str", "tracing", "winit-core", - "x11-dl", "xkbcommon-dl", ] @@ -9070,29 +8952,6 @@ dependencies = [ "winit-core", ] -[[package]] -name = "winit-x11" -version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" -dependencies = [ - "bitflags 2.11.1", - "bytemuck", - "calloop", - "cursor-icon", - "dpi", - "libc", - "percent-encoding", - "raw-window-handle", - "rustix 1.1.4", - "smol_str", - "tracing", - "winit-common", - "winit-core", - "x11-dl", - "x11rb", - "xkbcommon-dl", -] - [[package]] name = "winnow" version = "0.6.24" @@ -9223,39 +9082,6 @@ dependencies = [ "either", ] -[[package]] -name = "x11-dl" -version = "2.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" -dependencies = [ - "libc", - "once_cell", - "pkg-config", -] - -[[package]] -name = "x11rb" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414" -dependencies = [ - "as-raw-xcb-connection", - "gethostname", - "libc", - "libloading", - "once_cell", - "rustix 1.1.4", - "x11rb-protocol", - "xcursor", -] - -[[package]] -name = "x11rb-protocol" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" - [[package]] name = "xcursor" version = "0.3.10" diff --git a/Cargo.toml b/Cargo.toml index c42187c..b05903c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,21 +9,23 @@ rust-version = "1.90" [workspace.dependencies] cosmic-randr = { git = "https://github.com/pop-os/cosmic-randr" } tokio = { version = "1.49.0", features = ["macros"] } -iced_winit = { git = "https://github.com/pop-os/libcosmic", default-features = false } +# Yoda fork: direct path dep on iced_winit in libcosmic-yoda's submodule. +iced_winit = { path = "/home/lionel/Projets/COSMIC/libcosmic/iced/winit", default-features = false } -[workspace.dependencies.libcosmic] +# Yoda fork — libcosmic-yoda by path, replaces upstream git dep. +[workspace.dependencies.libcosmic-yoda] features = [ "dbus-config", "desktop", "multi-window", - "winit", + "wayland", "tokio", "qr_code", ] -git = "https://github.com/pop-os/libcosmic" +path = "/home/lionel/Projets/COSMIC/libcosmic" [workspace.dependencies.cosmic-config] -git = "https://github.com/pop-os/libcosmic" +path = "/home/lionel/Projets/COSMIC/libcosmic/cosmic-config" [workspace.dependencies.cosmic-bg-config] git = "https://github.com/pop-os/cosmic-bg" @@ -69,24 +71,25 @@ cosmic-client-toolkit = { git = "https://github.com/pop-os/cosmic-protocols//", # [patch.'https://github.com/pop-os/cosmic-settings-daemon'] # cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon//", branch = "input_nobuild" } -# For development and testing purposes -# [patch.'https://github.com/pop-os/libcosmic'] -# libcosmic = { path = "../libcosmic" } -# cosmic-config = { path = "../libcosmic/cosmic-config" } -# cosmic-theme = { path = "../libcosmic/cosmic-theme" } -# iced_futures = { path = "../libcosmic/iced/futures" } -# iced_winit = { path = "../libcosmic/iced/winit" } +# Yoda fork: redirect every transitive dep that asks for pop-os/libcosmic +# (cosmic-bg-config, cosmic-comp-config, cosmic-idle-config, cosmic-panel-config, +# cosmic-settings-config, cosmic-settings-daemon-config) to our local paths so +# the whole graph resolves against a single cosmic-config / cosmic-theme / iced_*. +[patch.'https://github.com/pop-os/libcosmic'] +cosmic-config = { path = "/home/lionel/Projets/COSMIC/libcosmic/cosmic-config" } +cosmic-theme = { path = "/home/lionel/Projets/COSMIC/libcosmic/cosmic-theme" } +iced_futures = { path = "/home/lionel/Projets/COSMIC/libcosmic/iced/futures" } +iced_winit = { path = "/home/lionel/Projets/COSMIC/libcosmic/iced/winit" } -# libcosmic = { git = "https://github.com/pop-os/libcosmic//" } -# cosmic-config = { git = "https://github.com/pop-os/libcosmic//" } -# cosmic-theme = { git = "https://github.com/pop-os/libcosmic//" } -# iced_futures = { git = "https://github.com/pop-os/libcosmic//" } -# iced_winit = { git = "https://github.com/pop-os/libcosmic//" } +[patch.'https://github.com/pop-os/cosmic-text.git'] +cosmic-text = { path = "../cosmic-text" } -# [patch.'https://github.com/pop-os/dbus-settings-bindings'] -# cosmic-dbus-networkmanager = { path = "../dbus-settings-bindings/networkmanager" } -# upower_dbus = { path = "../dbus-settings-bindings/upower" } -# nm-secret-agent-manager = { git = "https://github.com/pop-os/dbus-settings-bindings//", branch = "nm-secret-agent" } +# Yoda wayland cut v5: redirect window_clipboard to the local fork +# (x11 gated behind opt-in feature). +[patch.'https://forge.aditua.com/leyoda/window_clipboard.git'] +window_clipboard = { path = "/home/lionel/Projets/COSMIC/window_clipboard" } +dnd = { path = "/home/lionel/Projets/COSMIC/window_clipboard/dnd" } +mime = { path = "/home/lionel/Projets/COSMIC/window_clipboard/mime" } [patch.crates-io] atspi = { git = "https://github.com/wash2/atspi" } diff --git a/cosmic-settings/Cargo.toml b/cosmic-settings/Cargo.toml index 03c7a70..6512e9c 100644 --- a/cosmic-settings/Cargo.toml +++ b/cosmic-settings/Cargo.toml @@ -9,7 +9,7 @@ publish = false xdgen = "0.1" [dependencies] -accounts-zbus = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true } +accounts-zbus = { path = "../../dbus-settings-bindings/accounts-zbus", optional = true } anyhow = "1.0" ashpd = { version = "0.12", default-features = false, features = [ "tokio", @@ -21,8 +21,8 @@ color-eyre = "0.6.5" cosmic-bg-config.workspace = true cosmic-comp-config = { workspace = true, optional = true } cosmic-config.workspace = true -cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true } -nm-secret-agent-manager = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true } +cosmic-dbus-networkmanager = { path = "../../dbus-settings-bindings/networkmanager", optional = true } +nm-secret-agent-manager = { path = "../../dbus-settings-bindings/nm-secret-agent-manager", optional = true } cosmic-idle-config.workspace = true cosmic-panel-config = { workspace = true, optional = true } cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", optional = true } @@ -47,7 +47,7 @@ eyre = "0.6.12" freedesktop-desktop-entry = "0.8.1" futures = "0.3.32" hostname-validator = "1.1.1" -hostname1-zbus = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true } +hostname1-zbus = { path = "../../dbus-settings-bindings/hostname1", optional = true } i18n-embed-fl = "0.10.0" image = { version = "0.25", default-features = false, features = [ "jpeg", @@ -59,9 +59,9 @@ image = { version = "0.25", default-features = false, features = [ indexmap = "2.13.0" itertools = "0.14.0" itoa = "1.0.17" -libcosmic.workspace = true +libcosmic-yoda.workspace = true iced_winit.workspace = true -locale1 = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true } +locale1 = { path = "../../dbus-settings-bindings/locale1", optional = true } sysinfo = { version = "=0.38.0", optional = true } mime-apps = { package = "cosmic-mime-apps", git = "https://github.com/pop-os/cosmic-mime-apps", optional = true } notify = "8.2.0" @@ -75,13 +75,13 @@ slab = "0.4.12" slotmap = "1.1.1" static_init = "1.0.4" sunrise = "3.0.0" -timedate-zbus = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true } +timedate-zbus = { path = "../../dbus-settings-bindings/timedate", optional = true } tokio = { workspace = true, features = ["fs", "io-util", "process", "sync"] } tracing = "0.1.44" tracing-subscriber = { version = "0.3.22", features = ["env-filter"] } udev = { version = "0.9.3", optional = true } -upower_dbus = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true } -bluez-zbus = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true } +upower_dbus = { path = "../../dbus-settings-bindings/upower", optional = true } +bluez-zbus = { path = "../../dbus-settings-bindings/bluez", optional = true } url = "2.5.8" xkb-data = "0.2.2" xkeysym = { version = "0.2.1", optional = true } @@ -187,12 +187,12 @@ page-window-management = ["cosmic-comp-config", "dep:cosmic-settings-config"] page-workspaces = ["cosmic-comp-config"] # Other features -a11y = ["libcosmic/a11y"] +a11y = ["libcosmic-yoda/a11y"] ashpd = ["dep:ashpd"] cosmic-comp-config = ["dep:cosmic-comp-config"] -dbus-config = ["libcosmic/dbus-config", "cosmic-config/dbus"] -single-instance = ["libcosmic/single-instance"] +dbus-config = ["libcosmic-yoda/dbus-config", "cosmic-config/dbus"] +single-instance = ["libcosmic-yoda/single-instance"] test = [] -wayland = ["libcosmic/wayland", "dep:cosmic-panel-config", "dep:cosmic-randr", "iced_winit/cctk"] -wgpu = ["libcosmic/wgpu"] -xdg-portal = ["ashpd", "libcosmic/xdg-portal"] +wayland = ["libcosmic-yoda/wayland", "dep:cosmic-panel-config", "dep:cosmic-randr", "iced_winit/cctk"] +wgpu = ["libcosmic-yoda/wgpu"] +xdg-portal = ["ashpd", "libcosmic-yoda/xdg-portal"] diff --git a/cosmic-settings/src/pages/applications/default_apps.rs b/cosmic-settings/src/pages/applications/default_apps.rs index 89b28c0..ee759e3 100644 --- a/cosmic-settings/src/pages/applications/default_apps.rs +++ b/cosmic-settings/src/pages/applications/default_apps.rs @@ -11,7 +11,7 @@ use std::{ use cosmic::{ Apply, Element, Task, - iced::Alignment, + iced::{Alignment, Length}, surface, widget::{self, dropdown, icon, settings}, }; @@ -281,269 +281,83 @@ impl Page { } } +fn app_item(meta: &AppMeta, label: String, category: Category) -> widget::FlexRow<'_, Message> { + // Avoid creating popup_dropdown for empty app lists. + // Empty categories are rendered as non-interactive text to prevent Wayland crashes. + settings::flex_item( + label, + if meta.apps.is_empty() { + widget::text(fl!("default-apps", "not-installed")).apply(Element::from) + } else { + dropdown::popup_dropdown( + &meta.apps, + meta.selected, + move |id| Message::SetDefault(category, id), + cosmic::iced::window::Id::RESERVED, + Message::Surface, + |a| crate::app::Message::PageMessage(crate::pages::Message::DefaultApps(a)), + ) + .icons(Cow::Borrowed(&meta.icons)) + .apply(Element::from) + }, + ) + .align_items(Alignment::Center) + .width(Length::Shrink) +} + fn apps() -> Section { Section::default().view::(move |_binder, page, section| { let Some(mime_apps) = page.mime_apps.as_ref() else { return widget::space().into(); }; - // Avoid creating popup_dropdown for empty app lists. - // Empty categories are rendered as non-interactive text to prevent Wayland crashes. - settings::section() + settings::section::with_capacity(9) .title(§ion.title) - .add({ - let meta = &mime_apps.apps[DROPDOWN_WEB_BROWSER]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "web-browser"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "web-browser"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::WebBrowser, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - .min_item_width(300.0) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_FILE_MANAGER]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "file-manager"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "file-manager"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::FileManager, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_MAIL]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "mail-client"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "mail-client"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::Mail, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_MUSIC]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "music"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "music"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::Audio, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_VIDEO]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "video"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "video"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::Video, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_PHOTO]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "photos"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "photos"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::Image, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_CALENDAR]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "calendar"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "calendar"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::Calendar, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_TERMINAL]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "terminal"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "terminal"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::Terminal, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_TEXT_EDITOR]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "text-editor"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "text-editor"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::TextEditor, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) + .add(app_item( + &mime_apps.apps[DROPDOWN_WEB_BROWSER], + fl!("default-apps", "web-browser"), + Category::WebBrowser, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_FILE_MANAGER], + fl!("default-apps", "file-manager"), + Category::FileManager, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_MAIL], + fl!("default-apps", "mail-client"), + Category::Mail, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_MUSIC], + fl!("default-apps", "music"), + Category::Audio, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_VIDEO], + fl!("default-apps", "video"), + Category::Video, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_PHOTO], + fl!("default-apps", "photos"), + Category::Image, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_CALENDAR], + fl!("default-apps", "calendar"), + Category::Calendar, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_TERMINAL], + fl!("default-apps", "terminal"), + Category::Terminal, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_TEXT_EDITOR], + fl!("default-apps", "text-editor"), + Category::TextEditor, + )) .apply(Element::from) .map(crate::pages::Message::DefaultApps) }) diff --git a/cosmic-settings/src/pages/desktop/panel/inner.rs b/cosmic-settings/src/pages/desktop/panel/inner.rs index bcd7bb3..9974e54 100644 --- a/cosmic-settings/src/pages/desktop/panel/inner.rs +++ b/cosmic-settings/src/pages/desktop/panel/inner.rs @@ -22,9 +22,9 @@ use crate::pages::desktop::appearance::Roundness; pub struct PageInner { pub(crate) config_helper: Option, pub(crate) panel_config: Option, - pub size: Option, pub opacity: f32, pub opacity_changing: bool, + pub size: PanelSize, pub outputs: Vec, pub anchors: Vec, pub backgrounds: Vec, @@ -40,9 +40,9 @@ impl Default for PageInner { Self { config_helper: Option::default(), panel_config: Option::default(), - size: Option::default(), opacity: 0.0, opacity_changing: false, + size: PanelSize::M, outputs: vec![fl!("all-displays")], anchors: vec![ Anchor(PanelAnchor::Left).to_string(), @@ -209,9 +209,7 @@ pub(crate) fn style< text::body(fl!("small")).into(), slider( 0..=4, - match inner.size.as_ref().expect( - "PageInner.size is None even though PageInner.panel_config is Some", - ) { + match inner.size { PanelSize::XS => 0, PanelSize::S => 1, PanelSize::M => 2, @@ -506,7 +504,7 @@ impl PageInner { if let Err(err) = default.write_entry(config) { tracing::error!(?err, "Error resetting panel config."); } - self.size = Some(default.size.clone()); + self.size.clone_from(&default.size); self.system_default = Some(default.clone()); self.panel_config.clone_from(&self.system_default); } else { @@ -605,16 +603,10 @@ impl PageInner { _ = panel_config.set_border_radius(helper, new_radius).unwrap(); } Message::PanelSize(size) => { - self.size = Some(size); + self.size = size; } Message::PanelSizeCommit => { - _ = panel_config.set_size( - helper, - self.size - .as_ref() - .expect("PageInner.size is None even though it should be Some, since PageInner.panel_config is Some") - .clone() - ); + _ = panel_config.set_size(helper, self.size.clone()); // Reset any size overrides the user might have set _ = panel_config.set_size_center(helper, None); _ = panel_config.set_size_wings(helper, None); @@ -677,7 +669,7 @@ impl PageInner { } } Message::PanelConfig(c) => { - self.size = Some(c.size.clone()); + self.size = c.size.clone(); self.panel_config = Some(*c); return Task::none(); } diff --git a/cosmic-settings/src/pages/desktop/panel/mod.rs b/cosmic-settings/src/pages/desktop/panel/mod.rs index 7748618..4f98e64 100644 --- a/cosmic-settings/src/pages/desktop/panel/mod.rs +++ b/cosmic-settings/src/pages/desktop/panel/mod.rs @@ -79,7 +79,6 @@ impl Default for Page { // If the config is not present, it will be created with the default values and the name will not match (panel_config.name == "Panel").then_some(panel_config) }); - let size = panel_config.as_ref().map(|c| c.size.clone()); let system_default = cosmic::cosmic_config::Config::system( &format!("{}.Panel", cosmic_panel_config::NAME), CosmicPanelConfig::VERSION, @@ -99,7 +98,6 @@ impl Default for Page { inner: PageInner { config_helper, panel_config, - size, container_config, outputs_map: HashMap::new(), system_default, diff --git a/cosmic-settings/src/pages/desktop/window_management.rs b/cosmic-settings/src/pages/desktop/window_management.rs index b93e0f8..7b68acc 100644 --- a/cosmic-settings/src/pages/desktop/window_management.rs +++ b/cosmic-settings/src/pages/desktop/window_management.rs @@ -27,6 +27,7 @@ pub enum Message { ShowActiveWindowHint(bool), ShowMaximizeButton(bool), ShowMinimizeButton(bool), + WindowControlsPositionStart(bool), SetEdgeSnapThreshold(u32), Surface(surface::Action), } @@ -177,6 +178,19 @@ impl Page { .set_show_minimize(&config, value); } } + Message::WindowControlsPositionStart(left) => { + if let Ok(config) = cosmic::config::CosmicTk::config() { + let position = if left { + cosmic::widget::WindowControlsPosition::Start + } else { + cosmic::widget::WindowControlsPosition::End + }; + let _res = cosmic::config::COSMIC_TK + .write() + .unwrap() + .set_window_controls_position(&config, position); + } + } Message::ShowActiveWindowHint(value) => { self.show_active_hint = value; if let Err(err) = self.comp_config.set("active_hint", value) { @@ -274,6 +288,7 @@ pub fn window_controls() -> Section { maximize = fl!("window-controls", "maximize"); minimize = fl!("window-controls", "minimize"); active_window_hint = fl!("window-controls", "active-window-hint"); + position_start = fl!("window-controls", "position-start"); }); Section::default() @@ -296,6 +311,13 @@ pub fn window_controls() -> Section { settings::item::builder(&descriptions[minimize]) .toggler(cosmic::config::show_minimize(), Message::ShowMinimizeButton), ) + .add(settings::item::builder(&descriptions[position_start]).toggler( + matches!( + cosmic::config::window_controls_position(), + cosmic::widget::WindowControlsPosition::Start + ), + Message::WindowControlsPositionStart, + )) .apply(Element::from) .map(crate::pages::Message::WindowManagement) }) diff --git a/cosmic-settings/src/pages/input/keyboard/shortcuts/common.rs b/cosmic-settings/src/pages/input/keyboard/shortcuts/common.rs index 70e1952..669c3e7 100644 --- a/cosmic-settings/src/pages/input/keyboard/shortcuts/common.rs +++ b/cosmic-settings/src/pages/input/keyboard/shortcuts/common.rs @@ -8,7 +8,7 @@ use cosmic::iced::keyboard::{Key, Location, Modifiers}; use cosmic::iced::platform_specific::shell::wayland::commands::keyboard_shortcuts_inhibit; use cosmic::iced::platform_specific::shell::wayland::keymap; use cosmic::iced::{self, Alignment, Length}; -use cosmic::widget::{self, button, icon, settings, text}; +use cosmic::widget::{self, button, icon, list, settings, text}; use cosmic::{Apply, Element, Task, theme}; use cosmic_config::{ConfigGet, ConfigSet}; use cosmic_settings_config::shortcuts::{self, Action, Binding, Shortcuts}; @@ -865,13 +865,11 @@ fn context_drawer<'a>( } /// Display a shortcut as a list item -fn shortcut_item(custom: bool, id: usize, data: &ShortcutModel) -> Element<'_, ShortcutMessage> { - #[derive(Copy, Clone, Debug)] - enum LocalMessage { - Remove, - Show, - } - +fn shortcut_item( + custom: bool, + id: usize, + data: &ShortcutModel, +) -> list::ListButton<'_, ShortcutMessage> { let bindings = data .bindings .iter() @@ -880,7 +878,7 @@ fn shortcut_item(custom: bool, id: usize, data: &ShortcutModel) -> Element<'_, S .map(|(_, shortcut)| text::body(shortcut.binding.to_string()).into()) .collect::>(); - let shortcuts: Element = if bindings.is_empty() { + let shortcuts: Element = if bindings.is_empty() { text::body(fl!("disabled")).into() } else { widget::column::with_children(bindings) @@ -900,7 +898,7 @@ fn shortcut_item(custom: bool, id: usize, data: &ShortcutModel) -> Element<'_, S .push(icon::from_name("go-next-symbolic").size(16)) .push_maybe(custom.then(|| { widget::button::icon(icon::from_name("edit-delete-symbolic")) - .on_press(LocalMessage::Remove) + .on_press(ShortcutMessage::DeleteShortcut(id)) })) .align_y(Alignment::Center) .spacing(8); @@ -909,14 +907,7 @@ fn shortcut_item(custom: bool, id: usize, data: &ShortcutModel) -> Element<'_, S .flex_control(control) .align_items(Alignment::Center) .spacing(16) - .apply(widget::container) - .class(theme::Container::List) - .apply(widget::button::custom) - .class(theme::Button::Transparent) - .on_press(LocalMessage::Show) - .apply(Element::from) - .map(move |message| match message { - LocalMessage::Show => ShortcutMessage::ShowShortcut(id, data.description.clone()), - LocalMessage::Remove => ShortcutMessage::DeleteShortcut(id), - }) + .width(Length::Shrink) + .apply(list::button) + .on_press(ShortcutMessage::ShowShortcut(id, data.description.clone())) } diff --git a/cosmic-settings/src/pages/input/keyboard/shortcuts/mod.rs b/cosmic-settings/src/pages/input/keyboard/shortcuts/mod.rs index 5a5b1bb..ab60609 100644 --- a/cosmic-settings/src/pages/input/keyboard/shortcuts/mod.rs +++ b/cosmic-settings/src/pages/input/keyboard/shortcuts/mod.rs @@ -15,8 +15,8 @@ pub mod tiling; use cosmic::app::ContextDrawer; use cosmic::iced::Length; -use cosmic::widget::{self, icon, settings, text}; -use cosmic::{Apply, Element, Task, theme}; +use cosmic::widget::{self, list::ListButton, settings, text}; +use cosmic::{Apply, Element, Task}; use cosmic_config::ConfigGet; use cosmic_settings_config::Binding; use cosmic_settings_config::shortcuts::action::{ @@ -222,11 +222,13 @@ impl Page { self.search.localized = SecondaryMap::new(); self.search.input = String::new(); self.search_model.on_clear(); - self.modified.custom = 0; + self.modified.accessibility = 0; self.modified.manage_windows = 0; self.modified.move_windows = 0; self.modified.nav = 0; self.modified.system = 0; + self.modified.window_tiling = 0; + self.modified.custom = 0; } fn reload_search(&mut self) { @@ -497,32 +499,18 @@ fn shortcuts() -> Section { } /// Display a category as a list item -fn category_item(category: Category, name: &str, modified: u16) -> Element<'_, Message> { - let icon = icon::from_name("go-next-symbolic").size(16); - - let control = if modified == 0 { - Element::from(icon) - } else { - widget::row::with_capacity(2) - .push(text::body(fl!("modified", count = modified))) - .push(icon) - .into() - }; - - settings::item::builder(name) - .control(control) - .spacing(16) - .apply(widget::container) - .class(theme::Container::List) - .apply(widget::button::custom) - .class(theme::Button::Transparent) - .width(Length::Fill) - .on_press(Message::Category(category)) - .into() +fn category_item(category: Category, name: &str, modified: u16) -> ListButton<'_, Message> { + crate::widget::go_next_with_item( + name, + (modified > 0).then(|| text::body(fl!("modified", count = modified)).apply(Element::from)), + Message::Category(category), + ) } fn action_category(action: &Action) -> Option { - Some(if manage_windows::actions().contains(action) { + Some(if accessibility::actions().contains(action) { + Category::Accessibility + } else if manage_windows::actions().contains(action) { Category::ManageWindow } else if move_window::actions().contains(action) { Category::MoveWindow @@ -530,6 +518,8 @@ fn action_category(action: &Action) -> Option { Category::Nav } else if system::actions().contains(action) { Category::System + } else if tiling::actions().contains(action) { + Category::WindowTiling } else { return None; }) diff --git a/cosmic-settings/src/pages/time/date.rs b/cosmic-settings/src/pages/time/date.rs index 16cc382..2ff4e67 100644 --- a/cosmic-settings/src/pages/time/date.rs +++ b/cosmic-settings/src/pages/time/date.rs @@ -8,7 +8,7 @@ use cosmic::{ cosmic_config::{self, ConfigGet, ConfigSet}, iced::core::text::Wrapping, surface, - widget::{self, dropdown, list, settings}, + widget::{self, dropdown, settings}, }; use cosmic_settings_page::{self as page, Section, section}; use icu::{ diff --git a/cosmic-settings/src/pages/time/region.rs b/cosmic-settings/src/pages/time/region.rs index 36128f7..8a9be3f 100644 --- a/cosmic-settings/src/pages/time/region.rs +++ b/cosmic-settings/src/pages/time/region.rs @@ -7,7 +7,7 @@ use std::sync::Arc; use crate::widget::selection_context_item; use cosmic::app::{ContextDrawer, context_drawer}; use cosmic::iced::{Alignment, Length}; -use cosmic::widget::{self, button, list}; +use cosmic::widget::{self, button}; use cosmic::{Apply, Element}; use cosmic_config::{ConfigGet, ConfigSet}; use cosmic_settings_page::Section; diff --git a/cosmic-settings/src/widget/mod.rs b/cosmic-settings/src/widget/mod.rs index a5b8322..5646dc6 100644 --- a/cosmic-settings/src/widget/mod.rs +++ b/cosmic-settings/src/widget/mod.rs @@ -206,8 +206,10 @@ pub fn go_next_with_item<'a, Msg: 'static>( msg_opt: impl Into>, ) -> list::ListButton<'a, Msg> { settings::item_row(vec![ - text::body(description).wrapping(Wrapping::Word).into(), - horizontal().into(), + text::body(description) + .width(Length::Fill) + .wrapping(Wrapping::Word) + .into(), row::with_capacity(2) .push(item) .push(icon::from_name("go-next-symbolic").size(16).icon()) diff --git a/i18n/en/cosmic_settings.ftl b/i18n/en/cosmic_settings.ftl index 535477b..f5a614e 100644 --- a/i18n/en/cosmic_settings.ftl +++ b/i18n/en/cosmic_settings.ftl @@ -484,6 +484,7 @@ window-controls = Window controls .maximize = Show maximize button .minimize = Show minimize button .active-window-hint = Show active window hint + .position-start = Place buttons on the left (macOS style) focus-navigation = Focus navigation .focus-follows-cursor = Focus follows cursor diff --git a/i18n/fr/cosmic_settings.ftl b/i18n/fr/cosmic_settings.ftl index 419dc72..098a741 100644 --- a/i18n/fr/cosmic_settings.ftl +++ b/i18n/fr/cosmic_settings.ftl @@ -322,6 +322,7 @@ window-controls = Contrôles des fenêtres .maximize = Afficher le bouton maximiser .minimize = Afficher le bouton minimiser .active-window-hint = Afficher l'indice de la fenêtre active + .position-start = Placer les boutons à gauche (style macOS) focus-navigation = Navigation par le focus .focus-follows-cursor = Le focus suit le curseur .focus-follows-cursor-delay = Délai de suivi du focus en ms diff --git a/page/Cargo.toml b/page/Cargo.toml index 7547599..d45d828 100644 --- a/page/Cargo.toml +++ b/page/Cargo.toml @@ -7,7 +7,7 @@ edition = "2024" derive_setters = "0.1.9" regex = "1.12.3" slotmap = "1.1.1" -libcosmic = { workspace = true } +libcosmic-yoda = { workspace = true } downcast-rs = "2.0.2" url = "2.5.8" slab = "0.4.12" diff --git a/pages/wallpapers/src/lib.rs b/pages/wallpapers/src/lib.rs index 498b424..921117c 100644 --- a/pages/wallpapers/src/lib.rs +++ b/pages/wallpapers/src/lib.rs @@ -104,6 +104,7 @@ pub async fn load_each_from_path( ) -> Pin>> { let candidate_paths: Vec<_> = WalkDir::new(path) .max_depth(3) + .follow_links(true) .into_iter() .filter_map(Result::ok) .filter(|entry| entry.file_type().is_file()) diff --git a/subscriptions/a11y-manager/Cargo.toml b/subscriptions/a11y-manager/Cargo.toml index bfdf7c2..8bb0c2b 100644 --- a/subscriptions/a11y-manager/Cargo.toml +++ b/subscriptions/a11y-manager/Cargo.toml @@ -7,8 +7,8 @@ rust-version.workspace = true publish = true [dependencies] -cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols" } -iced_futures = { git = "https://github.com/pop-os/libcosmic" } +cosmic-protocols = { path = "../../../cosmic-protocols" } +iced_futures = { path = "../../../libcosmic/iced/futures" } num-derive = "0.4.2" num-traits = "0.2.19" sctk.workspace = true diff --git a/subscriptions/accessibility/Cargo.toml b/subscriptions/accessibility/Cargo.toml index 2a3b5e6..138f539 100644 --- a/subscriptions/accessibility/Cargo.toml +++ b/subscriptions/accessibility/Cargo.toml @@ -7,9 +7,9 @@ rust-version.workspace = true publish = true [dependencies] -cosmic-dbus-a11y = { git = "https://github.com/pop-os/dbus-settings-bindings" } +cosmic-dbus-a11y = { path = "../../../dbus-settings-bindings/a11y" } futures = "0.3.32" -iced_futures = { git = "https://github.com/pop-os/libcosmic" } +iced_futures = { path = "../../../libcosmic/iced/futures" } tokio = { version = "1.49.0", features = ["sync", "time"] } tracing = "0.1.44" zbus = "5.13" diff --git a/subscriptions/airplane-mode/Cargo.toml b/subscriptions/airplane-mode/Cargo.toml index 403f6fe..4fda29b 100644 --- a/subscriptions/airplane-mode/Cargo.toml +++ b/subscriptions/airplane-mode/Cargo.toml @@ -8,7 +8,7 @@ publish = true [dependencies] futures = "0.3.32" -iced_futures = { git = "https://github.com/pop-os/libcosmic" } +iced_futures = { path = "../../../libcosmic/iced/futures" } log = "0.4.29" rustix = "1.1.3" tokio = "1.49.0" diff --git a/subscriptions/bluetooth/Cargo.toml b/subscriptions/bluetooth/Cargo.toml index 0fb5a0d..b6e9967 100644 --- a/subscriptions/bluetooth/Cargo.toml +++ b/subscriptions/bluetooth/Cargo.toml @@ -7,7 +7,7 @@ rust-version.workspace = true publish = true [dependencies] -bluez-zbus = { git = "https://github.com/pop-os/dbus-settings-bindings" } +bluez-zbus = { path = "../../../dbus-settings-bindings/bluez" } futures = "0.3.32" iced_futures = { git = "https://github.com/pop-os/libcosmic" } tokio = "1.49.0" diff --git a/subscriptions/network-manager/Cargo.toml b/subscriptions/network-manager/Cargo.toml index e40a2a8..d72f126 100644 --- a/subscriptions/network-manager/Cargo.toml +++ b/subscriptions/network-manager/Cargo.toml @@ -7,11 +7,11 @@ rust-version.workspace = true publish = true [dependencies] -cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings" } +cosmic-dbus-networkmanager = { path = "../../../dbus-settings-bindings/networkmanager" } secret-service = { version = "5.1.0", features = ["rt-tokio-crypto-rust"] } -nm-secret-agent-manager = { git = "https://github.com/pop-os/dbus-settings-bindings" } +nm-secret-agent-manager = { path = "../../../dbus-settings-bindings/nm-secret-agent-manager" } futures = "0.3.32" -iced_futures = { git = "https://github.com/pop-os/libcosmic" } +iced_futures = { path = "../../../libcosmic/iced/futures" } itertools = "0.14.0" secure-string = "0.3.0" thiserror = "2.0.18" diff --git a/subscriptions/network-manager/src/devices.rs b/subscriptions/network-manager/src/devices.rs index 235b0b5..e4e976f 100644 --- a/subscriptions/network-manager/src/devices.rs +++ b/subscriptions/network-manager/src/devices.rs @@ -185,7 +185,7 @@ pub fn subscription( conn, }, |Wrapper { - id, + id: _, has_popup, conn, }| { diff --git a/subscriptions/network-manager/src/lib.rs b/subscriptions/network-manager/src/lib.rs index 631eda9..55892b1 100644 --- a/subscriptions/network-manager/src/lib.rs +++ b/subscriptions/network-manager/src/lib.rs @@ -141,7 +141,7 @@ pub fn subscription( self.id.hash(state); } } - Subscription::run_with(Wrapper { id, conn }, |Wrapper { id, conn }| { + Subscription::run_with(Wrapper { id, conn }, |Wrapper { id: _, conn }| { let conn = conn.clone(); stream::channel( 50, diff --git a/subscriptions/pulse/Cargo.toml b/subscriptions/pulse/Cargo.toml index cc4760b..48c2adc 100644 --- a/subscriptions/pulse/Cargo.toml +++ b/subscriptions/pulse/Cargo.toml @@ -7,6 +7,6 @@ rust-version.workspace = true [dependencies] libpulse-binding = { version = "2.30.1" } rustix = { version = "1.1.3", features = ["pipe"] } -iced_futures = { git = "https://github.com/pop-os/libcosmic" } +iced_futures = { path = "../../../libcosmic/iced/futures" } futures = "0.3.32" log = "0.4.27" diff --git a/subscriptions/pulse/src/lib.rs b/subscriptions/pulse/src/lib.rs index 4220765..ca407f7 100644 --- a/subscriptions/pulse/src/lib.rs +++ b/subscriptions/pulse/src/lib.rs @@ -288,7 +288,7 @@ impl PulseChannels { /// Set the speaker balance of the active sink. pub fn set_balance(&mut self, balance: f32) { if let Err(err) = self.tx.send(Request::Balance(self.index, balance)) { - log::error!("Failed to send new balance to channel"); + log::error!("Failed to send new balance to channel: {err}"); } else { self.pipe_tx .write_all(&[1]) @@ -299,7 +299,7 @@ impl PulseChannels { /// Set the volume of the active sink. pub fn set_volume(&mut self, volume: f32) { if let Err(err) = self.tx.send(Request::Volume(self.index, volume)) { - log::error!("Failed to send new volume to channel"); + log::error!("Failed to send new volume to channel: {err}"); } else { self.pipe_tx .write_all(&[1]) diff --git a/subscriptions/settings-daemon/Cargo.toml b/subscriptions/settings-daemon/Cargo.toml index aa67fbe..59160d0 100644 --- a/subscriptions/settings-daemon/Cargo.toml +++ b/subscriptions/settings-daemon/Cargo.toml @@ -7,7 +7,7 @@ publish = true [dependencies] futures = "0.3.32" -iced_futures = { git = "https://github.com/pop-os/libcosmic" } +iced_futures = { path = "../../../libcosmic/iced/futures" } log = "0.4.29" tokio = "1.49.0" tokio-stream = "0.1.18" diff --git a/subscriptions/sound/Cargo.toml b/subscriptions/sound/Cargo.toml index adf5891..0ea0154 100644 --- a/subscriptions/sound/Cargo.toml +++ b/subscriptions/sound/Cargo.toml @@ -10,7 +10,7 @@ publish = true cosmic-pipewire = { path = "../../crates/cosmic-pipewire" } futures = "0.3.32" intmap = "3.1.3" -libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false } +libcosmic-yoda = { path = "/home/lionel/Projets/COSMIC/libcosmic", default-features = false } numtoa = "1.0.0-alpha1" rustix = "1.1.3" tokio = { version = "1.49.0", features = ["process", "rt", "time"] } diff --git a/subscriptions/upower/Cargo.toml b/subscriptions/upower/Cargo.toml index 4121a10..568daee 100644 --- a/subscriptions/upower/Cargo.toml +++ b/subscriptions/upower/Cargo.toml @@ -8,9 +8,9 @@ publish = true [dependencies] futures = "0.3.32" -iced_futures = { git = "https://github.com/pop-os/libcosmic" } +iced_futures = { path = "../../../libcosmic/iced/futures" } log = "0.4.29" tokio = "1.49.0" tokio-stream = "0.1.18" -upower_dbus = { git = "https://github.com/pop-os/dbus-settings-bindings" } +upower_dbus = { path = "../../../dbus-settings-bindings/upower" } zbus = "5.13.2"