From 1c52e63715c0a8a29ba6520a2bbc4dcab0fc0555 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 12 Oct 2023 09:18:04 -0600 Subject: [PATCH] Use themeable branch of libcosmic, adjust date/time spacing --- Cargo.lock | 130 ++++++++++++++++++++++++++++++++++---------------- Cargo.toml | 6 ++- src/locker.rs | 4 +- 3 files changed, 96 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0bcd08f..dee32a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -526,9 +526,9 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "calloop" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aadd183e815348c0649051b1c43418643208f8ed13c8a84da7215b4e1cf42714" +checksum = "7b50b5a44d59a98c55a9eeb518f39bf7499ba19fd98ee7d22618687f3f10adbf" dependencies = [ "bitflags 2.4.0", "log", @@ -733,10 +733,10 @@ dependencies = [ [[package]] name = "cosmic-bg-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-bg?branch=master_jammy#1e0d51cf6c95d913763cefc60714406236a8a0de" +source = "git+https://github.com/pop-os/cosmic-bg#6a6fe4e387e46c2e159df56a9768220a6269ccf4" dependencies = [ "colorgrad", - "cosmic-config", + "cosmic-config 0.1.0 (git+https://github.com/pop-os/libcosmic)", "derive_setters", "image", "ron", @@ -747,13 +747,27 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" +dependencies = [ + "atomicwrites", + "cosmic-config-derive 0.1.0 (git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching)", + "dirs 5.0.1", + "iced_futures 0.7.0 (git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching)", + "notify", + "ron", + "serde", +] + +[[package]] +name = "cosmic-config" +version = "0.1.0" +source = "git+https://github.com/pop-os/libcosmic#ca3870ed135fc8d748e95b924d18f3c9473642be" dependencies = [ "atomicwrites", "calloop", - "cosmic-config-derive", + "cosmic-config-derive 0.1.0 (git+https://github.com/pop-os/libcosmic)", "dirs 5.0.1", - "iced_futures", + "iced_futures 0.7.0 (git+https://github.com/pop-os/libcosmic)", "notify", "ron", "serde", @@ -762,7 +776,16 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cosmic-config-derive" +version = "0.1.0" +source = "git+https://github.com/pop-os/libcosmic#ca3870ed135fc8d748e95b924d18f3c9473642be" dependencies = [ "quote", "syn 1.0.109", @@ -774,6 +797,7 @@ version = "0.1.0" dependencies = [ "chrono", "cosmic-bg-config", + "cosmic-config 0.1.0 (git+https://github.com/pop-os/libcosmic)", "env_logger 0.10.0", "freedesktop_entry_parser", "greetd_ipc", @@ -809,10 +833,10 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" dependencies = [ "almost", - "cosmic-config", + "cosmic-config 0.1.0 (git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching)", "csscolorparser", "lazy_static", "palette", @@ -1763,11 +1787,11 @@ dependencies = [ [[package]] name = "iced" version = "0.10.0" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" dependencies = [ "iced_accessibility", - "iced_core", - "iced_futures", + "iced_core 0.10.0 (git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching)", + "iced_futures 0.7.0 (git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching)", "iced_renderer", "iced_sctk", "iced_widget", @@ -1778,7 +1802,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" dependencies = [ "accesskit", "accesskit_unix", @@ -1787,7 +1811,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.10.0" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" dependencies = [ "bitflags 1.3.2", "iced_accessibility", @@ -1799,29 +1823,53 @@ dependencies = [ "twox-hash", ] +[[package]] +name = "iced_core" +version = "0.10.0" +source = "git+https://github.com/pop-os/libcosmic#ca3870ed135fc8d748e95b924d18f3c9473642be" +dependencies = [ + "bitflags 1.3.2", + "instant", + "log", + "thiserror", + "twox-hash", +] + [[package]] name = "iced_futures" version = "0.7.0" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" dependencies = [ "futures", - "iced_core", + "iced_core 0.10.0 (git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching)", "log", "tokio", "wasm-bindgen-futures", "wasm-timer", ] +[[package]] +name = "iced_futures" +version = "0.7.0" +source = "git+https://github.com/pop-os/libcosmic#ca3870ed135fc8d748e95b924d18f3c9473642be" +dependencies = [ + "futures", + "iced_core 0.10.0 (git+https://github.com/pop-os/libcosmic)", + "log", + "wasm-bindgen-futures", + "wasm-timer", +] + [[package]] name = "iced_graphics" version = "0.9.0" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" dependencies = [ "bitflags 1.3.2", "bytemuck", "glam", "half", - "iced_core", + "iced_core 0.10.0 (git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching)", "image", "kamadak-exif", "log", @@ -1833,7 +1881,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -1846,11 +1894,11 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.1.1" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" dependencies = [ "iced_accessibility", - "iced_core", - "iced_futures", + "iced_core 0.10.0 (git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching)", + "iced_futures 0.7.0 (git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching)", "smithay-client-toolkit 0.17.0", "thiserror", ] @@ -1858,12 +1906,12 @@ dependencies = [ [[package]] name = "iced_sctk" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" dependencies = [ "enum-repr", "float-cmp", "futures", - "iced_futures", + "iced_futures 0.7.0 (git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching)", "iced_graphics", "iced_runtime", "iced_style", @@ -1882,9 +1930,9 @@ dependencies = [ [[package]] name = "iced_style" version = "0.9.0" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" dependencies = [ - "iced_core", + "iced_core 0.10.0 (git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching)", "once_cell", "palette", ] @@ -1892,7 +1940,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" dependencies = [ "bytemuck", "cosmic-text", @@ -1910,7 +1958,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.11.1" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -1932,7 +1980,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.1.3" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" dependencies = [ "iced_renderer", "iced_runtime", @@ -2165,19 +2213,19 @@ checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#f0005165f3ac9ec6ea63e5422d22d459e5ec240d" +source = "git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching#65036b4d3a73d635aa57d5a58b9da7b4a211632a" dependencies = [ "apply", "ashpd", - "cosmic-config", + "cosmic-config 0.1.0 (git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching)", "cosmic-theme", "css-color", "derive_setters", "fraction", "freedesktop-icons", "iced", - "iced_core", - "iced_futures", + "iced_core 0.10.0 (git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching)", + "iced_futures 0.7.0 (git+https://github.com/pop-os/libcosmic?branch=theme-dark-light-switching)", "iced_renderer", "iced_runtime", "iced_sctk", @@ -3155,9 +3203,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.6" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" +checksum = "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87" dependencies = [ "aho-corasick", "memchr", @@ -3167,9 +3215,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.9" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b" dependencies = [ "aho-corasick", "memchr", @@ -3178,9 +3226,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "56d84fdd47036b038fc80dd333d10b6aab10d5d31f4a366e20014def75328d33" [[package]] name = "renderdoc-sys" @@ -3683,7 +3731,7 @@ dependencies = [ [[package]] name = "taffy" version = "0.3.11" -source = "git+https://github.com/DioxusLabs/taffy#48e4800f14c6af5cd26275fb570d11b93e279654" +source = "git+https://github.com/DioxusLabs/taffy?rev=65bedf#65bedf128ec8cef40c1a21b6f141f2c771842cca" dependencies = [ "arrayvec", "grid", diff --git a/Cargo.toml b/Cargo.toml index 70a95dc..21845f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,10 @@ wayland-client = "0.31" [dependencies.cosmic-bg-config] git = "https://github.com/pop-os/cosmic-bg" -branch = "master_jammy" + +[dependencies.cosmic-config] +git = "https://github.com/pop-os/libcosmic" +features = ["calloop", "macro"] [dependencies.greetd_ipc] version = "0.9" @@ -23,6 +26,7 @@ features = ["sync-codec"] [dependencies.libcosmic] git = "https://github.com/pop-os/libcosmic" +branch = "theme-dark-light-switching" default-features = false features = ["tokio", "wayland"] diff --git a/src/locker.rs b/src/locker.rs index aa2310a..6584c1e 100644 --- a/src/locker.rs +++ b/src/locker.rs @@ -3,7 +3,6 @@ use cosmic::app::{message, Command, Core, Settings}; use cosmic::{ - cosmic_config::CosmicConfigEntry, executor, iced::{ self, alignment, @@ -21,6 +20,7 @@ use cosmic::{ iced_runtime::core::window::Id as SurfaceId, style, widget, Element, }; +use cosmic_config::CosmicConfigEntry; use std::{ collections::HashMap, ffi::{CStr, CString}, @@ -446,7 +446,7 @@ impl cosmic::Application for App { fn view_window(&self, surface_id: SurfaceId) -> Element { let left_element = { let date_time_column = { - let mut column = widget::column::with_capacity(2).padding(16.0).spacing(12.0); + let mut column = widget::column::with_capacity(2).padding(16.0); let dt = chrono::Local::now();