Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"format_on_save": "on",
"lsp": {
"rust-analyzer": {
"initialization_options": {
"check": {
"command": "clippy",
},
"rustfmt": {
"extraArgs": ["+nightly"],
},
},
},
},
}
35 changes: 20 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ x11 = ["iced/x11", "iced_winit/x11"]
apply = "0.3.0"
ashpd = { version = "0.12.3", default-features = false, optional = true }
async-fs = { version = "2.2", optional = true }
async-std = { version = "1.13", optional = true }
async-std = { workspace = true, optional = true }
auto_enums = "0.8.8"
cctk = { git = "https://github.com/pop-os/cosmic-protocols", package = "cosmic-client-toolkit", rev = "160b086", optional = true }
jiff = "0.2"
Expand All @@ -150,31 +150,32 @@ image-extras = { version = "0.1.0", default-features = false, features = [
"xpm",
"xbm",
], optional = true }
libc = { version = "0.2.183", optional = true }
libc = { version = "0.2.186", optional = true }
log = "0.4"
mime = { version = "0.3.17", optional = true }
palette = "0.7.6"
palette.workspace = true
rfd = { version = "0.16.0", default-features = false, features = [
"xdg-portal",
], optional = true }
rustix = { version = "1.1", features = ["pipe", "process"], optional = true }
serde = { version = "1.0.228", features = ["derive"] }
serde = { workspace = true, features = ["derive"] }
slotmap = "1.1.1"
smol = { version = "2.0.2", optional = true }
thiserror = "2.0.18"
thiserror.workspace = true
taffy = { version = "0.9.2", features = ["grid"] }
tokio = { version = "1.50.0", optional = true }
tracing = "0.1.44"
unicode-segmentation = "1.12"
tokio = { workspace = true, optional = true }
tracing.workspace = true
unicode-segmentation = "1.13"
url = "2.5.8"
zbus = { version = "5.14.0", default-features = false, optional = true }
zbus = { workspace = true, optional = true }
float-cmp = "0.10.0"
ron = { workspace = true, optional = true }

# Enable DBus feature on Linux targets
[target.'cfg(target_os = "linux")'.dependencies]
cosmic-config = { path = "cosmic-config", features = ["dbus"] }
cosmic-settings-daemon = { git = "https://github.com/pop-os/dbus-settings-bindings" }
zbus = { version = "5.14.0", default-features = false }
zbus.workspace = true

[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
freedesktop-icons = { package = "cosmic-freedesktop-icons", git = "https://github.com/pop-os/freedesktop-icons" }
Expand Down Expand Up @@ -237,10 +238,6 @@ git = "https://github.com/pop-os/cosmic-panel"
# path = "../cosmic-panel/cosmic-panel-config"
optional = true

[dependencies.ron]
version = "0.12"
optional = true

[workspace]
members = [
"cosmic-config",
Expand All @@ -251,7 +248,15 @@ members = [
exclude = ["iced"]

[workspace.dependencies]
dirs = "6.0.0"
async-std = "1.13"
dirs = "6.0"
palette = "0.7"
ron = "0.12"
serde = "1.0"
thiserror = "2.0"
tracing = "0.1"
tokio = "1.52"
zbus = {version = "5.15", default-features = false}

[dev-dependencies]
tempfile = "3.27.0"
12 changes: 6 additions & 6 deletions cosmic-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ subscription = ["iced_futures"]

[dependencies]
cosmic-settings-daemon = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true }
zbus = { version = "5.14.0", default-features = false, optional = true }
zbus = { workspace = true, default-features = false, optional = true }
atomicwrites = { git = "https://github.com/jackpot51/rust-atomicwrites" }
calloop = { version = "0.14.4", optional = true }
notify = "8.2.0"
ron = "0.12.0"
serde = "1.0.228"
ron.workspace = true
serde.workspace = true
cosmic-config-derive = { path = "../cosmic-config-derive/", optional = true }
iced = { path = "../iced/", default-features = false, optional = true }
iced_futures = { path = "../iced/futures/", default-features = false, optional = true }
futures-util = { version = "0.3", optional = true }
dirs.workspace = true
tokio = { version = "1.50", optional = true, features = ["time"] }
async-std = { version = "1.13", optional = true }
tracing = "0.1"
tokio = { workspace = true, optional = true, features = ["time"] }
async-std = { workspace = true, optional = true }
tracing.workspace = true

[target.'cfg(unix)'.dependencies]
xdg = "3.0"
Expand Down
11 changes: 5 additions & 6 deletions cosmic-config/src/dbus.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use std::{any::TypeId, ops::Deref};
use std::any::TypeId;
use std::ops::Deref;

use crate::{CosmicConfigEntry, Update};
use cosmic_settings_daemon::{Changed, ConfigProxy, CosmicSettingsDaemonProxy};
use futures_util::SinkExt;
use iced_futures::{
Subscription,
futures::{self, StreamExt, future::pending},
stream,
};
use iced_futures::futures::future::pending;
use iced_futures::futures::{self, StreamExt};
use iced_futures::{Subscription, stream};

pub async fn settings_daemon_proxy() -> zbus::Result<CosmicSettingsDaemonProxy<'static>> {
let conn = zbus::Connection::session().await?;
Expand Down
19 changes: 8 additions & 11 deletions cosmic-config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
//! Integrations for cosmic-config — the cosmic configuration system.

use notify::{
RecommendedWatcher, Watcher,
event::{EventKind, ModifyKind, RenameMode},
};
use serde::{Serialize, de::DeserializeOwned};
use std::{
env, fmt, fs,
io::Write,
path::{Path, PathBuf},
sync::Mutex,
};
use notify::event::{EventKind, ModifyKind, RenameMode};
use notify::{RecommendedWatcher, Watcher};
use serde::Serialize;
use serde::de::DeserializeOwned;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::sync::Mutex;
use std::{env, fmt, fs};

/// Get the config directory, with Flatpak sandbox support.
/// In Flatpak, HOST_XDG_CONFIG_HOME points to the real user config directory,
Expand Down
9 changes: 6 additions & 3 deletions cosmic-config/src/subscription.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use iced_futures::futures::channel::mpsc;
use iced_futures::futures::{SinkExt, Stream};
use iced_futures::{futures::channel::mpsc, stream};
use iced_futures::stream;
use notify::RecommendedWatcher;
use std::{borrow::Cow, hash::Hash};
use std::borrow::Cow;
use std::hash::Hash;

use crate::{Config, CosmicConfigEntry};

Expand Down Expand Up @@ -77,7 +79,8 @@ async fn start_listening<T: 'static + Send + Sync + PartialEq + Clone + CosmicCo
state: ConfigState<T>,
output: &mut mpsc::Sender<crate::Update<T>>,
) -> ConfigState<T> {
use iced_futures::futures::{StreamExt, future::pending};
use iced_futures::futures::StreamExt;
use iced_futures::futures::future::pending;

match state {
ConfigState::Init(config_id, version, is_state) => {
Expand Down
8 changes: 4 additions & 4 deletions cosmic-theme/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ export = ["serde_json"]
no-default = []

[dependencies]
palette = { version = "0.7.6", features = ["serializing"] }
palette = { workspace = true, features = ["serializing"] }
almost = "0.2"
serde = { version = "1.0.228", features = ["derive"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { version = "1.0.149", optional = true, features = [
"preserve_order",
] }
ron = "0.12.0"
ron.workspace = true
csscolorparser = { version = "0.8.3", features = ["serde"] }
cosmic-config = { path = "../cosmic-config/", default-features = false, features = [
"subscription",
"macro",
] }
configparser = "3.1.0"
dirs.workspace = true
thiserror = "2.0.18"
thiserror.workspace = true

[dev-dependencies]
insta = "1.47.2"
Expand Down
48 changes: 48 additions & 0 deletions cosmic-theme/src/model/corner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,51 @@ impl Default for CornerRadii {
}
}
}

/// Roundness options for the Cosmic theme
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
pub enum Roundness {
/// Round style
#[default]
Round,
/// Slightly round style
SlightlyRound,
/// Square style
Square,
}

impl From<Roundness> for CornerRadii {
fn from(value: Roundness) -> Self {
match value {
Roundness::Round => CornerRadii::default(),
Roundness::SlightlyRound => CornerRadii {
radius_0: [0.0; 4],
radius_xs: [2.0; 4],
radius_s: [8.0; 4],
radius_m: [8.0; 4],
radius_l: [8.0; 4],
radius_xl: [8.0; 4],
},
Roundness::Square => CornerRadii {
radius_0: [0.0; 4],
radius_xs: [2.0; 4],
radius_s: [2.0; 4],
radius_m: [2.0; 4],
radius_l: [2.0; 4],
radius_xl: [2.0; 4],
},
}
}
}

impl From<CornerRadii> for Roundness {
fn from(value: CornerRadii) -> Self {
if (value.radius_m[0] - 16.0).abs() < 0.01 {
Self::Round
} else if (value.radius_m[0] - 8.0).abs() < 0.01 {
Self::SlightlyRound
} else {
Self::Square
}
}
}
69 changes: 0 additions & 69 deletions cosmic-theme/src/model/density.rs

This file was deleted.

2 changes: 0 additions & 2 deletions cosmic-theme/src/model/mod.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
pub use corner::*;
pub use cosmic_palette::*;
pub use density::*;
pub use derivation::*;
pub use mode::*;
pub use spacing::*;
pub use theme::*;

mod corner;
mod cosmic_palette;
mod density;
mod derivation;
mod mode;
mod spacing;
Expand Down
Loading
Loading