Compare commits
50 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f7bdd84ae4 | |||
| 4a00191ac9 | |||
| d4d421511a | |||
| f3db54342c | |||
| 6722f1e581 | |||
| 5f50d74477 | |||
| 7a191cf086 | |||
| 38acba82b4 | |||
| ef8f69134f | |||
| 597aba3e9f | |||
| e3dcdf1fce | |||
| 10422b8f4a | |||
| 87510782ae | |||
| ea17ada931 | |||
|
|
8fa6a01d04 | ||
|
|
113e0ae1f9 | ||
|
|
2f022280f2 | ||
|
|
e2b172e0bc | ||
|
|
b279d82240 | ||
|
|
147306d581 | ||
|
|
466e25d9f8 | ||
|
|
6f863f1905 | ||
|
|
5782cb927e | ||
|
|
631c81b170 | ||
|
|
cab9d5aff2 | ||
|
|
2aa9133f9d | ||
|
|
4fab6c777d | ||
|
|
b105e9a108 | ||
|
|
528513725d | ||
|
|
0e0960f3c7 | ||
|
|
9c2a86a8f4 | ||
|
|
9abc4d483b | ||
|
|
34326b3925 | ||
|
|
15a8a535dd | ||
|
|
564ef834ce | ||
|
|
99c038a66a | ||
|
|
cae05f3ffb | ||
|
|
8768bce2e2 | ||
|
|
49846d9f28 | ||
|
|
51be7dc42d | ||
|
|
5825afb0da | ||
|
|
f3fc763b5f | ||
|
|
21977ef617 | ||
|
|
58b7532849 | ||
|
|
17291536a1 | ||
|
|
dad5f1e273 | ||
|
|
8b4c8adec8 | ||
|
|
4d39cf3d7b | ||
|
|
dc84488cd8 | ||
|
|
6dba6a2561 |
225 changed files with 3112 additions and 1506 deletions
4
.github/workflows/pages.yml
vendored
4
.github/workflows/pages.yml
vendored
|
|
@ -17,13 +17,13 @@ jobs:
|
|||
- name: Install Rust nightly
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: nightly-2025-07-31
|
||||
toolchain: nightly-2026-04-27
|
||||
- name: System dependencies
|
||||
run: sudo apt-get update; sudo apt-get install -y libxkbcommon-dev libwayland-dev
|
||||
- name: Build documentation
|
||||
run: |
|
||||
RUSTDOCFLAGS="--cfg docsrs" \
|
||||
cargo +nightly-2025-07-31 doc --no-deps \
|
||||
cargo +nightly-2026-04-27 doc --no-deps \
|
||||
-p cosmic-client-toolkit \
|
||||
-p cosmic-protocols \
|
||||
-p libcosmic \
|
||||
|
|
|
|||
15
.zed/settings.json
Normal file
15
.zed/settings.json
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"format_on_save": "on",
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
"initialization_options": {
|
||||
"check": {
|
||||
"command": "clippy",
|
||||
},
|
||||
"rustfmt": {
|
||||
"extraArgs": ["+nightly"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
126
Cargo.toml
126
Cargo.toml
|
|
@ -1,20 +1,23 @@
|
|||
[package]
|
||||
name = "libcosmic"
|
||||
version = "1.0.0"
|
||||
# Yoda fork: hard-renamed. Every consumer (leyoda/cosmic-files fork + each
|
||||
# leyoda/cosmic-* app) depends directly on `libcosmic-yoda` by path, bypassing
|
||||
# pop-os/libcosmic entirely. No [patch] shenanigans needed — transitive deps
|
||||
# that used to ask for `libcosmic` are replaced by deps on our forks that ask
|
||||
# for `libcosmic-yoda`.
|
||||
name = "libcosmic-yoda"
|
||||
version = "0.1.0-yoda.2"
|
||||
edition = "2024"
|
||||
rust-version = "1.90"
|
||||
rust-version = "1.93"
|
||||
|
||||
[lib]
|
||||
name = "cosmic"
|
||||
|
||||
[features]
|
||||
default = [
|
||||
"winit",
|
||||
"tokio",
|
||||
"a11y",
|
||||
"dbus-config",
|
||||
"x11",
|
||||
"iced-wayland",
|
||||
"wayland",
|
||||
"multi-window",
|
||||
]
|
||||
advanced-shaping = ["iced/advanced-shaping"]
|
||||
|
|
@ -35,7 +38,6 @@ animated-image = [
|
|||
autosize = []
|
||||
applet = [
|
||||
"autosize",
|
||||
"winit",
|
||||
"wayland",
|
||||
"tokio",
|
||||
"cosmic-panel-config",
|
||||
|
|
@ -81,32 +83,34 @@ tokio = [
|
|||
"cosmic-config/tokio",
|
||||
]
|
||||
# Tokio async runtime
|
||||
# Wayland window support
|
||||
iced-wayland = [
|
||||
# Wayland window support (yoda fork is Wayland-only; always active in default).
|
||||
# We still need iced/winit because pop-os/iced hosts the runtime dispatcher
|
||||
# (`iced_winit as shell`) there — the name is a misnomer, it's the same crate
|
||||
# that provides both the winit path AND the sctk/cctk wayland path.
|
||||
wayland = [
|
||||
"ashpd?/wayland",
|
||||
"autosize",
|
||||
"iced/winit",
|
||||
"iced/wayland",
|
||||
"iced_winit/wayland",
|
||||
"surface-message",
|
||||
]
|
||||
wayland = [
|
||||
"iced-wayland",
|
||||
"iced_runtime/cctk",
|
||||
"iced_winit/cctk",
|
||||
"iced_wgpu/cctk",
|
||||
"iced/cctk",
|
||||
"dep:iced_winit",
|
||||
"dep:cctk",
|
||||
"surface-message",
|
||||
]
|
||||
surface-message = []
|
||||
# multi-window support
|
||||
multi-window = []
|
||||
# Render with wgpu
|
||||
wgpu = ["iced/wgpu", "iced_wgpu"]
|
||||
# X11 window support via winit
|
||||
winit = ["iced/winit", "iced_winit"]
|
||||
winit_debug = ["winit", "debug"]
|
||||
winit_tokio = ["winit", "tokio"]
|
||||
winit_wgpu = ["winit", "wgpu"]
|
||||
# Compat stubs — kept empty so upstream deps (cosmic-files, cosmic-text, …)
|
||||
# that still ask for `winit` / `x11` features resolve cleanly against the
|
||||
# yoda fork. Activating them has no effect: no code is gated on these.
|
||||
winit = []
|
||||
x11 = []
|
||||
# Enables XDG portal integrations
|
||||
xdg-portal = ["ashpd"]
|
||||
qr_code = ["iced/qr_code"]
|
||||
|
|
@ -119,18 +123,17 @@ async-std = [
|
|||
"zbus?/async-io",
|
||||
"iced/async-std",
|
||||
]
|
||||
x11 = ["iced/x11", "iced_winit/x11"]
|
||||
|
||||
[dependencies]
|
||||
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 }
|
||||
cctk = { path = "../cosmic-protocols/client-toolkit", package = "cosmic-client-toolkit", optional = true }
|
||||
jiff = "0.2"
|
||||
cosmic-config = { path = "cosmic-config" }
|
||||
cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon", optional = true }
|
||||
cosmic-settings-config = { path = "../cosmic-settings-daemon/config", optional = true }
|
||||
# Internationalization
|
||||
i18n-embed = { version = "0.16.0", features = [
|
||||
"fluent-system",
|
||||
|
|
@ -150,34 +153,35 @@ 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" }
|
||||
cosmic-settings-daemon = { path = "../dbus-settings-bindings/cosmic-settings-daemon" }
|
||||
zbus = { version = "5.14.0", default-features = false }
|
||||
|
||||
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
|
||||
freedesktop-icons = { package = "cosmic-freedesktop-icons", git = "https://github.com/pop-os/freedesktop-icons" }
|
||||
freedesktop-icons = { package = "cosmic-freedesktop-icons", path = "../cosmic-freedesktop-icons" }
|
||||
freedesktop-desktop-entry = { version = "0.8.1", optional = true }
|
||||
shlex = { version = "1.3.0", optional = true }
|
||||
|
||||
|
|
@ -223,35 +227,77 @@ optional = true
|
|||
|
||||
[dependencies.iced_tiny_skia]
|
||||
path = "./iced/tiny_skia"
|
||||
# Yoda: drop the x11 default → softbuffer no longer pulls tiny-xlib/x11-dl/etc.
|
||||
default-features = false
|
||||
features = ["wayland"]
|
||||
|
||||
[dependencies.iced_winit]
|
||||
path = "./iced/winit"
|
||||
optional = true
|
||||
# Yoda: drop the x11 default → winit won't pull winit-x11/tiny-xlib/x11-dl.
|
||||
# Keep wayland + wayland-dlopen (default behaviour minus x11).
|
||||
default-features = false
|
||||
features = ["wayland", "wayland-dlopen"]
|
||||
|
||||
[dependencies.iced_wgpu]
|
||||
path = "./iced/wgpu"
|
||||
optional = true
|
||||
|
||||
[dependencies.cosmic-panel-config]
|
||||
git = "https://github.com/pop-os/cosmic-panel"
|
||||
# path = "../cosmic-panel/cosmic-panel-config"
|
||||
path = "../cosmic-panel/cosmic-panel-config"
|
||||
optional = true
|
||||
|
||||
[dependencies.ron]
|
||||
version = "0.12"
|
||||
optional = true
|
||||
[patch.'https://github.com/pop-os/freedesktop-icons']
|
||||
cosmic-freedesktop-icons = { path = "../cosmic-freedesktop-icons" }
|
||||
|
||||
[patch.'https://github.com/pop-os/softbuffer']
|
||||
softbuffer = { path = "../softbuffer" }
|
||||
|
||||
[patch.'https://github.com/pop-os/smithay-clipboard']
|
||||
smithay-clipboard = { path = "../smithay-clipboard" }
|
||||
|
||||
[patch.'https://github.com/pop-os/winit.git']
|
||||
dpi = { path = "../winit/dpi" }
|
||||
winit = { path = "../winit/winit" }
|
||||
winit-android = { path = "../winit/winit-android" }
|
||||
winit-appkit = { path = "../winit/winit-appkit" }
|
||||
winit-common = { path = "../winit/winit-common" }
|
||||
winit-core = { path = "../winit/winit-core" }
|
||||
winit-orbital = { path = "../winit/winit-orbital" }
|
||||
winit-uikit = { path = "../winit/winit-uikit" }
|
||||
winit-wayland = { path = "../winit/winit-wayland" }
|
||||
winit-web = { path = "../winit/winit-web" }
|
||||
winit-win32 = { path = "../winit/winit-win32" }
|
||||
winit-x11 = { path = "../winit/winit-x11" }
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"cosmic-config",
|
||||
"cosmic-config-derive",
|
||||
"cosmic-theme",
|
||||
"examples/*",
|
||||
]
|
||||
exclude = ["iced"]
|
||||
# examples/* excluded — many depend on the removed winit/x11 features.
|
||||
# They will be revisited and adapted in a later phase.
|
||||
exclude = ["iced", "examples"]
|
||||
|
||||
[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}
|
||||
|
||||
# Speed up snapshot diffing in cosmic-theme tests. Cargo silently ignores
|
||||
# [profile.*] blocks in non-root manifests, so this lives at the
|
||||
# workspace root.
|
||||
[profile.dev.package.insta]
|
||||
opt-level = 3
|
||||
[profile.dev.package.similar]
|
||||
opt-level = 3
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3.27.0"
|
||||
|
|
|
|||
18
README.md
18
README.md
|
|
@ -20,6 +20,24 @@ While libcosmic is written entirely in Rust, some of its dependencies may requir
|
|||
sudo apt install cargo cmake just libexpat1-dev libfontconfig-dev libfreetype-dev libxkbcommon-dev pkgconf
|
||||
```
|
||||
|
||||
## Made-for-COSMIC Flatpak IDs
|
||||
|
||||
To identify a project as a COSMIC Application, add `<id>com.system76.CosmicApplication</id>` to the provides section of the project's metainfo.
|
||||
|
||||
```xml
|
||||
<provides>
|
||||
<id>com.system76.CosmicApplication</id>
|
||||
</provides>
|
||||
```
|
||||
|
||||
For COSMIC Applets, use `com.system76.CosmicApplet`.
|
||||
|
||||
```xml
|
||||
<provides>
|
||||
<id>com.system76.CosmicApplet</id>
|
||||
</provides>
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
Some examples are included in the [examples](./examples) directory to to kickstart your
|
||||
|
|
|
|||
|
|
@ -10,21 +10,21 @@ macro = ["cosmic-config-derive"]
|
|||
subscription = ["iced_futures"]
|
||||
|
||||
[dependencies]
|
||||
cosmic-settings-daemon = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true }
|
||||
cosmic-settings-daemon = { path = "../../dbus-settings-bindings/cosmic-settings-daemon", optional = true }
|
||||
zbus = { version = "5.14.0", 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"
|
||||
|
|
|
|||
|
|
@ -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?;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
@ -54,6 +51,22 @@ fn get_state_dir() -> Option<PathBuf> {
|
|||
dirs::state_dir()
|
||||
}
|
||||
|
||||
/// Get the data directory, with Flatpak sandbox support.
|
||||
fn get_data_dir() -> Option<PathBuf> {
|
||||
// Check if we're running in Flatpak
|
||||
if env::var_os("FLATPAK_ID").is_some() {
|
||||
// Try HOST_XDG_DATA_HOME first
|
||||
if let Some(host_data) = env::var_os("HOST_XDG_DATA_HOME") {
|
||||
return Some(PathBuf::from(host_data));
|
||||
}
|
||||
// Fallback: try to construct from HOME
|
||||
if let Some(home) = env::var_os("HOME") {
|
||||
return Some(PathBuf::from(home).join(".local").join("share"));
|
||||
}
|
||||
}
|
||||
dirs::data_dir()
|
||||
}
|
||||
|
||||
#[cfg(feature = "subscription")]
|
||||
mod subscription;
|
||||
#[cfg(feature = "subscription")]
|
||||
|
|
@ -266,6 +279,24 @@ impl Config {
|
|||
})
|
||||
}
|
||||
|
||||
/// Get data for the given application name and config version.
|
||||
pub fn new_data(name: &str, version: u64) -> Result<Self, Error> {
|
||||
// Look for [name]/v[version]
|
||||
let path = sanitize_name(name)?.join(format!("v{}", version));
|
||||
|
||||
// Get libcosmic user data directory
|
||||
let mut user_path = get_data_dir().ok_or(Error::NoConfigDirectory)?;
|
||||
user_path.push("cosmic");
|
||||
user_path.push(path);
|
||||
// Create new data directory if not found.
|
||||
fs::create_dir_all(&user_path)?;
|
||||
|
||||
Ok(Self {
|
||||
system_path: None,
|
||||
user_path: Some(user_path),
|
||||
})
|
||||
}
|
||||
|
||||
// Start a transaction (to set multiple configs at the same time)
|
||||
#[inline]
|
||||
pub fn transaction(&self) -> ConfigTransaction<'_> {
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
|
||||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@ 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",
|
||||
|
|
@ -29,11 +29,8 @@ cosmic-config = { path = "../cosmic-config/", default-features = false, features
|
|||
] }
|
||||
configparser = "3.1.0"
|
||||
dirs.workspace = true
|
||||
thiserror = "2.0.18"
|
||||
thiserror.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
insta = "1.47.2"
|
||||
|
||||
[profile.dev.package]
|
||||
insta.opt-level = 3
|
||||
similar.opt-level = 3
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,69 +0,0 @@
|
|||
use crate::Spacing;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Density options for the Cosmic theme
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
|
||||
pub enum Density {
|
||||
/// Lower padding/spacing of elements
|
||||
Compact,
|
||||
/// Higher padding/spacing of elements
|
||||
Spacious,
|
||||
/// Standard padding/spacing of elements
|
||||
#[default]
|
||||
Standard,
|
||||
}
|
||||
|
||||
impl From<Density> for Spacing {
|
||||
fn from(value: Density) -> Self {
|
||||
match value {
|
||||
Density::Compact => Spacing {
|
||||
space_none: 0,
|
||||
space_xxxs: 4,
|
||||
space_xxs: 4,
|
||||
space_xs: 8,
|
||||
space_s: 8,
|
||||
space_m: 16,
|
||||
space_l: 24,
|
||||
space_xl: 32,
|
||||
space_xxl: 48,
|
||||
space_xxxl: 64,
|
||||
},
|
||||
Density::Spacious => Spacing {
|
||||
space_none: 4,
|
||||
space_xxxs: 8,
|
||||
space_xxs: 12,
|
||||
space_xs: 16,
|
||||
space_s: 24,
|
||||
space_m: 32,
|
||||
space_l: 48,
|
||||
space_xl: 64,
|
||||
space_xxl: 128,
|
||||
space_xxxl: 160,
|
||||
},
|
||||
Density::Standard => Spacing {
|
||||
space_none: 0,
|
||||
space_xxxs: 4,
|
||||
space_xxs: 8,
|
||||
space_xs: 12,
|
||||
space_s: 16,
|
||||
space_m: 24,
|
||||
space_l: 32,
|
||||
space_xl: 48,
|
||||
space_xxl: 64,
|
||||
space_xxxl: 128,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Spacing> for Density {
|
||||
fn from(value: Spacing) -> Self {
|
||||
if value.space_m.saturating_sub(16) == 0 {
|
||||
Self::Compact
|
||||
} else if value.space_m.saturating_sub(24) == 0 {
|
||||
Self::Standard
|
||||
} else {
|
||||
Self::Spacious
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
pub use corner::*;
|
||||
pub use cosmic_palette::*;
|
||||
pub use density::*;
|
||||
pub use derivation::*;
|
||||
pub use mode::*;
|
||||
pub use spacing::*;
|
||||
|
|
@ -8,7 +7,6 @@ pub use theme::*;
|
|||
|
||||
mod corner;
|
||||
mod cosmic_palette;
|
||||
mod density;
|
||||
mod derivation;
|
||||
mod mode;
|
||||
mod spacing;
|
||||
|
|
|
|||
|
|
@ -41,3 +41,59 @@ impl Default for Spacing {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Density options for the Cosmic theme
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
|
||||
pub enum Density {
|
||||
/// Lower padding/spacing of elements
|
||||
Compact,
|
||||
/// Standard padding/spacing of elements
|
||||
#[default]
|
||||
Standard,
|
||||
/// Higher padding/spacing of elements
|
||||
Spacious,
|
||||
}
|
||||
|
||||
impl From<Density> for Spacing {
|
||||
fn from(value: Density) -> Self {
|
||||
match value {
|
||||
Density::Compact => Spacing {
|
||||
space_none: 0,
|
||||
space_xxxs: 4,
|
||||
space_xxs: 4,
|
||||
space_xs: 8,
|
||||
space_s: 8,
|
||||
space_m: 16,
|
||||
space_l: 24,
|
||||
space_xl: 32,
|
||||
space_xxl: 48,
|
||||
space_xxxl: 64,
|
||||
},
|
||||
Density::Standard => Spacing::default(),
|
||||
Density::Spacious => Spacing {
|
||||
space_none: 4,
|
||||
space_xxxs: 8,
|
||||
space_xxs: 12,
|
||||
space_xs: 16,
|
||||
space_s: 24,
|
||||
space_m: 32,
|
||||
space_l: 48,
|
||||
space_xl: 64,
|
||||
space_xxl: 128,
|
||||
space_xxxl: 160,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Spacing> for Density {
|
||||
fn from(value: Spacing) -> Self {
|
||||
if value.space_m.saturating_sub(16) == 0 {
|
||||
Self::Compact
|
||||
} else if value.space_m.saturating_sub(24) == 0 {
|
||||
Self::Standard
|
||||
} else {
|
||||
Self::Spacious
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
use crate::composite::over;
|
||||
use crate::steps::{color_index, get_small_widget_color, get_surface_color, get_text, steps};
|
||||
use crate::{
|
||||
Component, Container, CornerRadii, CosmicPalette, CosmicPaletteInner, DARK_PALETTE,
|
||||
LIGHT_PALETTE, NAME, Spacing, ThemeMode,
|
||||
composite::over,
|
||||
steps::{color_index, get_small_widget_color, get_surface_color, get_text, steps},
|
||||
};
|
||||
use cosmic_config::{Config, CosmicConfigEntry};
|
||||
use palette::{
|
||||
IntoColor, Oklcha, Srgb, Srgba, WithAlpha, color_difference::Wcag21RelativeContrast, rgb::Rgb,
|
||||
};
|
||||
use palette::color_difference::Wcag21RelativeContrast;
|
||||
use palette::rgb::Rgb;
|
||||
use palette::{IntoColor, Oklcha, Srgb, Srgba, WithAlpha};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::num::NonZeroUsize;
|
||||
|
||||
|
|
@ -75,6 +75,8 @@ pub struct Theme {
|
|||
pub icon_button: Component,
|
||||
/// link button element colors
|
||||
pub link_button: Component,
|
||||
/// list button element colors
|
||||
pub list_button: Component,
|
||||
/// text button element colors
|
||||
pub text_button: Component,
|
||||
/// button component styling
|
||||
|
|
@ -953,6 +955,12 @@ impl ThemeBuilder {
|
|||
}
|
||||
|
||||
#[allow(clippy::too_many_lines)]
|
||||
// The component_hovered/pressed_overlay vars are seeded once near the
|
||||
// top of this fn and then reassigned inside each container block
|
||||
// (primary, secondary, …) before being read again. The initial seed
|
||||
// is therefore overwritten before any read, which is what the
|
||||
// unused_assignments lint flags below.
|
||||
#[allow(unused_assignments)]
|
||||
/// build the theme
|
||||
pub fn build(self) -> Theme {
|
||||
let Self {
|
||||
|
|
@ -1285,6 +1293,15 @@ impl ThemeBuilder {
|
|||
component.on_disabled = over(component.on.with_alpha(0.5), component.base);
|
||||
component
|
||||
},
|
||||
list_button: Component::component(
|
||||
Srgba::new(0.0, 0.0, 0.0, 0.0),
|
||||
accent,
|
||||
on_bg_component,
|
||||
Srgba::new(0.0, 0.0, 0.0, 0.0),
|
||||
button_pressed_overlay,
|
||||
is_high_contrast,
|
||||
control_steps_array[8],
|
||||
),
|
||||
success: Component::colored_component(
|
||||
success,
|
||||
control_steps_array[0],
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
use crate::{Component, Theme, composite::over, steps::steps};
|
||||
use configparser::ini::Ini;
|
||||
use palette::{Darken, IntoColor, Lighten, Srgba, WithAlpha, rgb::Rgba};
|
||||
use std::{
|
||||
fs::{self, File},
|
||||
io::{self, Write},
|
||||
num::NonZeroUsize,
|
||||
path::Path,
|
||||
process::Command,
|
||||
};
|
||||
|
||||
use super::{OutputError, to_rgba};
|
||||
|
|
@ -217,6 +219,50 @@ impl Theme {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Apply the preferred GTK client-side decoration button layout.
|
||||
///
|
||||
/// This writes the GTK 3/4 `settings.ini` value used by GTK header bars and
|
||||
/// also best-effort updates GNOME's `button-layout` GSettings key for apps
|
||||
/// that still consult it.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an `OutputError` if the GTK settings files cannot be written.
|
||||
#[cold]
|
||||
pub fn apply_gtk_decoration_layout(buttons_at_start: bool) -> Result<(), OutputError> {
|
||||
let Some(config_dir) = dirs::config_dir() else {
|
||||
return Err(OutputError::MissingConfigDir);
|
||||
};
|
||||
|
||||
let layout = if buttons_at_start {
|
||||
"close,minimize,maximize:"
|
||||
} else {
|
||||
":minimize,maximize,close"
|
||||
};
|
||||
|
||||
for gtk_version in ["gtk-3.0", "gtk-4.0"] {
|
||||
let gtk_dir = config_dir.join(gtk_version);
|
||||
fs::create_dir_all(>k_dir).map_err(OutputError::Io)?;
|
||||
Self::write_gtk_settings_key(
|
||||
>k_dir.join("settings.ini"),
|
||||
"gtk-decoration-layout",
|
||||
layout,
|
||||
)?;
|
||||
}
|
||||
|
||||
// best-effort: gsettings is absent on non-GNOME systems
|
||||
let _ = Command::new("gsettings")
|
||||
.args([
|
||||
"set",
|
||||
"org.gnome.desktop.wm.preferences",
|
||||
"button-layout",
|
||||
layout,
|
||||
])
|
||||
.status();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Reset the applied gtk css
|
||||
///
|
||||
/// # Errors
|
||||
|
|
@ -256,6 +302,20 @@ impl Theme {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cold]
|
||||
fn write_gtk_settings_key(path: &Path, key: &str, value: &str) -> Result<(), OutputError> {
|
||||
let mut ini = Ini::new_cs();
|
||||
|
||||
if path.exists() {
|
||||
let file_content = fs::read_to_string(path).map_err(OutputError::Io)?;
|
||||
ini.read(file_content).map_err(OutputError::Ini)?;
|
||||
}
|
||||
|
||||
ini.setstr("Settings", key, Some(value));
|
||||
ini.pretty_write(path, &super::qt_settings_ini_style())
|
||||
.map_err(OutputError::Io)
|
||||
}
|
||||
|
||||
fn is_cosmic_css(path: &Path, cosmic_css: &Path) -> io::Result<Option<bool>> {
|
||||
if !path.exists() {
|
||||
return Ok(None);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
use configparser::ini::WriteOptions;
|
||||
use palette::{Srgba, rgb::Rgba};
|
||||
use palette::Srgba;
|
||||
use palette::rgb::Rgba;
|
||||
use thiserror::Error;
|
||||
|
||||
use crate::Theme;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
use crate::Theme;
|
||||
use configparser::ini::Ini;
|
||||
use palette::{Mix, Srgba, WithAlpha, blend::Compose, rgb::Rgba};
|
||||
use std::{
|
||||
fs::{self, File},
|
||||
io::Write,
|
||||
path::PathBuf,
|
||||
vec,
|
||||
};
|
||||
use palette::blend::Compose;
|
||||
use palette::rgb::Rgba;
|
||||
use palette::{Mix, Srgba, WithAlpha};
|
||||
use std::fs::{self, File};
|
||||
use std::io::Write;
|
||||
use std::path::PathBuf;
|
||||
use std::vec;
|
||||
|
||||
use super::{OutputError, qt_settings_ini_style};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
use crate::Theme;
|
||||
use configparser::ini::Ini;
|
||||
use cosmic_config::CosmicConfigEntry;
|
||||
use palette::{Mix, Srgba, blend::Compose};
|
||||
use std::{
|
||||
fs::{self, File},
|
||||
io::{self, Write},
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
use palette::blend::Compose;
|
||||
use palette::{Mix, Srgba};
|
||||
use std::fs::{self, File};
|
||||
use std::io::{self, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use super::{OutputError, qt_settings_ini_style};
|
||||
|
||||
|
|
|
|||
|
|
@ -266,6 +266,14 @@ impl From<Theme> for VsTheme {
|
|||
}
|
||||
|
||||
impl Theme {
|
||||
/// Write this theme to VS Code's `settings.json` as a
|
||||
/// `workbench.colorCustomizations` entry, and enable
|
||||
/// `window.autoDetectColorScheme` so VS Code follows the system theme.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an `OutputError` if the user config dir is missing, the
|
||||
/// settings file cannot be read/written, or its JSON is invalid.
|
||||
#[cold]
|
||||
pub fn apply_vs_code(self) -> Result<(), OutputError> {
|
||||
let vs_theme = VsTheme::from(self);
|
||||
|
|
@ -291,6 +299,13 @@ impl Theme {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Remove the `workbench.colorCustomizations` entry previously written
|
||||
/// by [`Theme::apply_vs_code`] from VS Code's `settings.json`.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an `OutputError` if the user config dir is missing, the
|
||||
/// settings file cannot be read/written, or its JSON is invalid.
|
||||
#[cold]
|
||||
pub fn reset_vs_code() -> Result<(), OutputError> {
|
||||
let mut config_dir = dirs::config_dir().ok_or(OutputError::MissingConfigDir)?;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
use std::num::NonZeroUsize;
|
||||
|
||||
use almost::equal;
|
||||
use palette::{ClampAssign, FromColor, Lch, Oklcha, Srgb, Srgba, convert::FromColorUnclamped};
|
||||
use palette::convert::FromColorUnclamped;
|
||||
use palette::{ClampAssign, FromColor, Lch, Oklcha, Srgb, Srgba};
|
||||
|
||||
/// Get an array of 100 colors with a specific hue and chroma
|
||||
/// over the full range of lightness.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ edition = "2021"
|
|||
[dependencies]
|
||||
open = "5.3.3"
|
||||
|
||||
[dependencies.libcosmic]
|
||||
[dependencies.libcosmic-yoda]
|
||||
path = "../../"
|
||||
features = [
|
||||
"debug",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ use cosmic::app::{Core, Settings, Task};
|
|||
use cosmic::executor;
|
||||
use cosmic::iced::{alignment, Length, Size};
|
||||
use cosmic::prelude::*;
|
||||
use cosmic::widget::{self, about::About, nav_bar};
|
||||
use cosmic::widget::about::About;
|
||||
use cosmic::widget::{self, nav_bar};
|
||||
|
||||
/// Runs application with these settings
|
||||
#[rustfmt::skip]
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ tracing = "0.1"
|
|||
env_logger = "0.10.2"
|
||||
log = "0.4.29"
|
||||
|
||||
[dependencies.libcosmic]
|
||||
[dependencies.libcosmic-yoda]
|
||||
path = "../../"
|
||||
default-features = false
|
||||
features = ["applet-token"]
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ use cosmic::iced::core::window;
|
|||
use cosmic::iced::window::Id;
|
||||
use cosmic::iced::{Length, Rectangle};
|
||||
use cosmic::surface::action::{app_popup, destroy_popup};
|
||||
use cosmic::widget::{dropdown::popup_dropdown, list_column, settings, toggler};
|
||||
use cosmic::widget::dropdown::popup_dropdown;
|
||||
use cosmic::widget::{list_column, settings, toggler};
|
||||
use cosmic::Element;
|
||||
|
||||
const ID: &str = "com.system76.CosmicAppletExample";
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@ edition = "2021"
|
|||
|
||||
[features]
|
||||
default = ["wayland"]
|
||||
wayland = ["libcosmic/wayland"]
|
||||
wayland = ["libcosmic-yoda/wayland"]
|
||||
|
||||
[dependencies]
|
||||
env_logger = "0.11"
|
||||
|
||||
[dependencies.libcosmic]
|
||||
[dependencies.libcosmic-yoda]
|
||||
path = "../../"
|
||||
features = [
|
||||
"debug",
|
||||
|
|
|
|||
|
|
@ -5,9 +5,10 @@
|
|||
|
||||
use cosmic::app::Settings;
|
||||
use cosmic::iced::{Alignment, Length, Size};
|
||||
use cosmic::prelude::*;
|
||||
use cosmic::widget::menu::{self, KeyBind};
|
||||
use cosmic::widget::nav_bar;
|
||||
use cosmic::{executor, iced, prelude::*, widget, Core};
|
||||
use cosmic::{executor, iced, widget, Core};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
|
|
@ -239,7 +240,9 @@ impl cosmic::Application for App {
|
|||
widget::progress_bar::linear::Linear::new()
|
||||
.girth(10.0)
|
||||
.progress(self.progress)
|
||||
.width(Length::Fill),
|
||||
.width(Length::Fill)
|
||||
.markers([0.25, 0.5, 0.75])
|
||||
.segment_spacing(2),
|
||||
)
|
||||
.push(
|
||||
widget::progress_bar::circular::Circular::new()
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@ edition = "2024"
|
|||
[dependencies]
|
||||
jiff = "0.2"
|
||||
|
||||
[dependencies.libcosmic]
|
||||
[dependencies.libcosmic-yoda]
|
||||
path = "../../"
|
||||
features = ["debug", "winit", "tokio", "xdg-portal", "wgpu"]
|
||||
|
|
|
|||
|
|
@ -88,4 +88,7 @@ pub fn main() {
|
|||
|
||||
println!("Testing state");
|
||||
test_config(Config::new_state("com.system76.Example", 1).unwrap());
|
||||
|
||||
println!("Testing data");
|
||||
test_config(Config::new_data("com.system76.Example", 1).unwrap());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tracing = "0.1.44"
|
|||
tracing-subscriber = "0.3.22"
|
||||
tracing-log = "0.2.0"
|
||||
|
||||
[dependencies.libcosmic]
|
||||
[dependencies.libcosmic-yoda]
|
||||
path = "../../"
|
||||
features = [
|
||||
"debug",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ publish = false
|
|||
[dependencies]
|
||||
apply = "0.3.0"
|
||||
fraction = "0.15.3"
|
||||
libcosmic = { path = "../..", features = [
|
||||
libcosmic-yoda = { path = "../..", features = [
|
||||
"debug",
|
||||
"winit",
|
||||
"tokio",
|
||||
|
|
|
|||
|
|
@ -23,15 +23,11 @@ use cosmic::{
|
|||
Element,
|
||||
};
|
||||
use cosmic_time::{Instant, Timeline};
|
||||
use std::{
|
||||
cell::RefCell,
|
||||
rc::Rc,
|
||||
sync::{
|
||||
atomic::{AtomicU32, Ordering},
|
||||
Arc,
|
||||
},
|
||||
vec,
|
||||
};
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::vec;
|
||||
|
||||
// XXX The use of button is removed because it assigns the same ID to multiple buttons, causing a crash when a11y is enabled...
|
||||
// static BTN: Lazy<id::Id> = Lazy::new(|| id::Id::new("BTN"));
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
use super::{Page, Window};
|
||||
use cosmic::{
|
||||
iced::widget::{column, text},
|
||||
widget::{list_column, settings, toggler},
|
||||
Element,
|
||||
};
|
||||
use cosmic::iced::widget::{column, text};
|
||||
use cosmic::widget::{list_column, settings, toggler};
|
||||
use cosmic::Element;
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum Message {
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
use std::{cell::RefCell, rc::Rc};
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
use apply::Apply;
|
||||
use cosmic::{
|
||||
cosmic_theme,
|
||||
iced::widget::{checkbox, column, progress_bar, radio, slider, text},
|
||||
iced::{Alignment, Length},
|
||||
iced_core::id,
|
||||
theme::ThemeType,
|
||||
widget::{
|
||||
button, color_picker::ColorPickerUpdate, dropdown, icon, layer_container as container,
|
||||
segmented_button, segmented_control, settings, spin_button, tab_bar, toggler,
|
||||
ColorPickerModel,
|
||||
},
|
||||
Element,
|
||||
use cosmic::iced::widget::{checkbox, column, progress_bar, radio, slider, text};
|
||||
use cosmic::iced::{Alignment, Length};
|
||||
use cosmic::iced_core::id;
|
||||
use cosmic::theme::ThemeType;
|
||||
use cosmic::widget::color_picker::ColorPickerUpdate;
|
||||
use cosmic::widget::{
|
||||
button, dropdown, icon, layer_container as container, segmented_button, segmented_control,
|
||||
settings, spin_button, tab_bar, toggler, ColorPickerModel,
|
||||
};
|
||||
use cosmic::{cosmic_theme, Element};
|
||||
use cosmic_time::{anim, chain, Timeline};
|
||||
use fraction::{Decimal, ToPrimitive};
|
||||
use once_cell::sync::Lazy;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
use cosmic::{
|
||||
iced::widget::{column, container, horizontal_space, image, row, svg, text},
|
||||
iced::Length,
|
||||
theme,
|
||||
widget::{list_column, settings, toggler},
|
||||
Element,
|
||||
};
|
||||
use cosmic::iced::widget::{column, container, horizontal_space, image, row, svg, text};
|
||||
use cosmic::iced::Length;
|
||||
use cosmic::widget::{list_column, settings, toggler};
|
||||
use cosmic::{theme, Element};
|
||||
|
||||
use super::{Page, SubPage, Window};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
use cosmic::{
|
||||
iced::widget::{horizontal_space, row, text},
|
||||
iced::Length,
|
||||
widget::{icon, list_column, settings},
|
||||
Element,
|
||||
};
|
||||
use cosmic::iced::widget::{horizontal_space, row, text};
|
||||
use cosmic::iced::Length;
|
||||
use cosmic::widget::{icon, list_column, settings};
|
||||
use cosmic::Element;
|
||||
|
||||
use super::{Message, Page, SubPage, Window};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ edition = "2021"
|
|||
tracing = "0.1.44"
|
||||
tracing-subscriber = "0.3.22"
|
||||
|
||||
[dependencies.libcosmic]
|
||||
[dependencies.libcosmic-yoda]
|
||||
path = "../../"
|
||||
features = ["debug", "winit", "wgpu", "tokio"]
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@ tracing = "0.1.44"
|
|||
tracing-subscriber = "0.3.22"
|
||||
tracing-log = "0.2.0"
|
||||
|
||||
[dependencies.libcosmic]
|
||||
[dependencies.libcosmic-yoda]
|
||||
path = "../../"
|
||||
features = ["debug", "winit", "tokio", "xdg-portal", "wgpu"]
|
||||
|
|
|
|||
|
|
@ -9,11 +9,9 @@ use std::{env, process};
|
|||
use cosmic::app::{Core, Settings, Task};
|
||||
use cosmic::iced::alignment::{Horizontal, Vertical};
|
||||
use cosmic::iced::keyboard::Key;
|
||||
use cosmic::iced::window;
|
||||
use cosmic::iced::{Length, Size};
|
||||
use cosmic::iced::{window, Length, Size};
|
||||
use cosmic::widget::menu::action::MenuAction;
|
||||
use cosmic::widget::menu::key_bind::KeyBind;
|
||||
use cosmic::widget::menu::key_bind::Modifier;
|
||||
use cosmic::widget::menu::key_bind::{KeyBind, Modifier};
|
||||
use cosmic::widget::menu::{self, ItemHeight, ItemWidth};
|
||||
use cosmic::widget::RcElementWrapper;
|
||||
use cosmic::{executor, Element};
|
||||
|
|
|
|||
|
|
@ -6,4 +6,4 @@ edition = "2021"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
libcosmic = { path = "../..", features = ["debug", "winit", "tokio", "single-instance", "wgpu", "wayland"] }
|
||||
libcosmic-yoda = { path = "../..", features = ["debug", "winit", "tokio", "single-instance", "wgpu", "wayland"] }
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use cosmic::{
|
||||
app::Core,
|
||||
iced::core::{id, Alignment, Length, Point},
|
||||
iced::widget::{column, container, scrollable, text},
|
||||
iced::{self, event, window, Subscription},
|
||||
prelude::*,
|
||||
widget::{button, header_bar},
|
||||
};
|
||||
use cosmic::app::Core;
|
||||
use cosmic::iced::core::{id, Alignment, Length, Point};
|
||||
use cosmic::iced::widget::{column, container, scrollable, text};
|
||||
use cosmic::iced::{self, event, window, Subscription};
|
||||
use cosmic::prelude::*;
|
||||
use cosmic::widget::{button, header_bar};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum Message {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@ tracing = "0.1.44"
|
|||
tracing-subscriber = "0.3.22"
|
||||
tracing-log = "0.2.0"
|
||||
|
||||
[dependencies.libcosmic]
|
||||
[dependencies.libcosmic-yoda]
|
||||
path = "../../"
|
||||
features = ["debug", "winit", "tokio", "xdg-portal", "wgpu"]
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ edition = "2021"
|
|||
|
||||
[features]
|
||||
default = ["xdg-portal"]
|
||||
rfd = ["libcosmic/rfd"]
|
||||
xdg-portal = ["libcosmic/xdg-portal"]
|
||||
rfd = ["libcosmic-yoda/rfd"]
|
||||
xdg-portal = ["libcosmic-yoda/xdg-portal"]
|
||||
|
||||
[dependencies]
|
||||
apply = "0.3.0"
|
||||
|
|
@ -15,6 +15,6 @@ tracing = "0.1.44"
|
|||
tracing-subscriber = "0.3.22"
|
||||
url = "2.5.8"
|
||||
|
||||
[dependencies.libcosmic]
|
||||
[dependencies.libcosmic-yoda]
|
||||
features = ["debug", "winit", "wgpu", "wayland", "tokio"]
|
||||
path = "../../"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ edition = "2021"
|
|||
[dependencies]
|
||||
fraction = "0.15.3"
|
||||
|
||||
[dependencies.libcosmic]
|
||||
[dependencies.libcosmic-yoda]
|
||||
features = ["debug", "wgpu", "winit", "desktop", "tokio"]
|
||||
path = "../.."
|
||||
default-features = false
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
use cosmic::iced::Length;
|
||||
use cosmic::app::{Core, Task};
|
||||
use cosmic::iced::alignment::{Horizontal, Vertical};
|
||||
use cosmic::iced::{self, Alignment, Length, Size};
|
||||
use cosmic::widget::{column, container, spin_button};
|
||||
use cosmic::Apply;
|
||||
use cosmic::{
|
||||
app::{Core, Task},
|
||||
iced::{
|
||||
self,
|
||||
alignment::{Horizontal, Vertical},
|
||||
Alignment, Size,
|
||||
},
|
||||
Application, Element,
|
||||
};
|
||||
use cosmic::{Application, Apply, Element};
|
||||
use fraction::Decimal;
|
||||
|
||||
pub struct SpinButtonExamplApp {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@ edition = "2024"
|
|||
|
||||
[dependencies]
|
||||
|
||||
[dependencies.libcosmic]
|
||||
[dependencies.libcosmic-yoda]
|
||||
path = "../../"
|
||||
features = ["debug", "winit", "wgpu", "tokio", "xdg-portal"]
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
|
||||
use cosmic::app::{Core, Settings, Task};
|
||||
use cosmic::iced::Subscription;
|
||||
use cosmic::{executor, prelude::*, widget};
|
||||
use cosmic::prelude::*;
|
||||
use cosmic::{executor, widget};
|
||||
|
||||
/// Runs application with these settings
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@ tracing-subscriber = "0.3.22"
|
|||
tracing-log = "0.2.0"
|
||||
chrono = "*"
|
||||
|
||||
[dependencies.libcosmic]
|
||||
[dependencies.libcosmic-yoda]
|
||||
features = ["debug", "wgpu", "winit", "desktop", "tokio"]
|
||||
path = "../.."
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@ use chrono::Datelike;
|
|||
use cosmic::app::{Core, Settings, Task};
|
||||
use cosmic::iced::Size;
|
||||
use cosmic::prelude::*;
|
||||
use cosmic::widget::table;
|
||||
use cosmic::widget::{self, nav_bar};
|
||||
use cosmic::widget::{self, nav_bar, table};
|
||||
use cosmic::{executor, iced};
|
||||
|
||||
#[derive(Debug, Default, PartialEq, Eq, Clone, Copy, Hash)]
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@ tracing = "0.1.44"
|
|||
tracing-subscriber = "0.3.22"
|
||||
tracing-log = "0.2.0"
|
||||
|
||||
[dependencies.libcosmic]
|
||||
[dependencies.libcosmic-yoda]
|
||||
path = "../../"
|
||||
features = ["debug", "winit", "wgpu", "tokio", "xdg-portal"]
|
||||
|
|
|
|||
34
i18n/el/libcosmic_yoda.ftl
Normal file
34
i18n/el/libcosmic_yoda.ftl
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
close = Κλείσιμο
|
||||
february = Φεβρουάριος { $year }
|
||||
documenters = Τεκμηριωτές
|
||||
november = Νοέμβριος { $year }
|
||||
may = Μάιος { $year }
|
||||
april = Απρίλιος { $year }
|
||||
translators = Μεταφραστές
|
||||
artists = Καλλιτέχνες
|
||||
license = Άδεια χρήσης
|
||||
december = Δεκέμβριος { $year }
|
||||
links = Σύνδεσμοι
|
||||
march = Μάρτιος { $year }
|
||||
june = Ιούνιος { $year }
|
||||
august = Αύγουστος { $year }
|
||||
developers = Προγραμματιστές
|
||||
july = Ιούλιος { $year }
|
||||
september = Σεπτέμβριος { $year }
|
||||
designers = Σχεδιαστές
|
||||
october = Οκτώβριος { $year }
|
||||
january = Ιανουάριος { $year }
|
||||
monday = Δευτέρα
|
||||
mon = Δευ
|
||||
tuesday = Τρίτη
|
||||
tue = Τρί
|
||||
wednesday = Τετάρτη
|
||||
wed = Τετ
|
||||
thursday = Πέμπτη
|
||||
thu = Πέμ
|
||||
friday = Παρασκευή
|
||||
fri = Παρ
|
||||
saturday = Σάββατο
|
||||
sat = Σάβ
|
||||
sunday = Κυριακή
|
||||
sun = Κυρ
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue