Compare commits
5 commits
48eae39858
...
999e2ba4e5
| Author | SHA1 | Date | |
|---|---|---|---|
| 999e2ba4e5 | |||
|
|
78644a32e3 | ||
|
|
c04e49e218 | ||
|
|
26f0fb0609 | ||
|
|
317de19eb3 |
17 changed files with 167 additions and 374 deletions
29
Cargo.lock
generated
29
Cargo.lock
generated
|
|
@ -1199,7 +1199,7 @@ checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"termcolor",
|
"termcolor",
|
||||||
"unicode-width 0.1.14",
|
"unicode-width 0.2.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -1391,7 +1391,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-config"
|
name = "cosmic-config"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atomicwrites",
|
"atomicwrites",
|
||||||
"cosmic-config-derive",
|
"cosmic-config-derive",
|
||||||
|
|
@ -1412,7 +1411,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-config-derive"
|
name = "cosmic-config-derive"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.117",
|
"syn 2.0.117",
|
||||||
|
|
@ -1588,7 +1586,7 @@ dependencies = [
|
||||||
"itertools 0.14.0",
|
"itertools 0.14.0",
|
||||||
"itoa",
|
"itoa",
|
||||||
"jiff",
|
"jiff",
|
||||||
"libcosmic",
|
"libcosmic-yoda",
|
||||||
"locale1",
|
"locale1",
|
||||||
"locales-rs",
|
"locales-rs",
|
||||||
"mime 0.3.17",
|
"mime 0.3.17",
|
||||||
|
|
@ -1737,7 +1735,7 @@ version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"derive_setters",
|
"derive_setters",
|
||||||
"downcast-rs 2.0.2",
|
"downcast-rs 2.0.2",
|
||||||
"libcosmic",
|
"libcosmic-yoda",
|
||||||
"regex",
|
"regex",
|
||||||
"slab",
|
"slab",
|
||||||
"slotmap",
|
"slotmap",
|
||||||
|
|
@ -1762,7 +1760,7 @@ dependencies = [
|
||||||
"cosmic-pipewire",
|
"cosmic-pipewire",
|
||||||
"futures",
|
"futures",
|
||||||
"intmap",
|
"intmap",
|
||||||
"libcosmic",
|
"libcosmic-yoda",
|
||||||
"numtoa",
|
"numtoa",
|
||||||
"rustix 1.1.4",
|
"rustix 1.1.4",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
|
@ -1827,7 +1825,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-theme"
|
name = "cosmic-theme"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"almost",
|
"almost",
|
||||||
"configparser",
|
"configparser",
|
||||||
|
|
@ -3250,7 +3247,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced"
|
name = "iced"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dnd",
|
"dnd",
|
||||||
"iced_accessibility",
|
"iced_accessibility",
|
||||||
|
|
@ -3271,7 +3267,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_accessibility"
|
name = "iced_accessibility"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"accesskit",
|
"accesskit",
|
||||||
"accesskit_winit",
|
"accesskit_winit",
|
||||||
|
|
@ -3280,7 +3275,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_core"
|
name = "iced_core"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.11.1",
|
"bitflags 2.11.1",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
|
@ -3305,7 +3299,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_debug"
|
name = "iced_debug"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_core",
|
"iced_core",
|
||||||
"iced_futures",
|
"iced_futures",
|
||||||
|
|
@ -3315,7 +3308,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_futures"
|
name = "iced_futures"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"iced_core",
|
"iced_core",
|
||||||
|
|
@ -3329,7 +3321,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_graphics"
|
name = "iced_graphics"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.11.1",
|
"bitflags 2.11.1",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -3350,7 +3341,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_program"
|
name = "iced_program"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_graphics",
|
"iced_graphics",
|
||||||
"iced_runtime",
|
"iced_runtime",
|
||||||
|
|
@ -3359,7 +3349,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_renderer"
|
name = "iced_renderer"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_graphics",
|
"iced_graphics",
|
||||||
"iced_tiny_skia",
|
"iced_tiny_skia",
|
||||||
|
|
@ -3371,7 +3360,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_runtime"
|
name = "iced_runtime"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"cosmic-client-toolkit",
|
"cosmic-client-toolkit",
|
||||||
|
|
@ -3387,7 +3375,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_tiny_skia"
|
name = "iced_tiny_skia"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"cosmic-text",
|
"cosmic-text",
|
||||||
|
|
@ -3404,7 +3391,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_wgpu"
|
name = "iced_wgpu"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as-raw-xcb-connection",
|
"as-raw-xcb-connection",
|
||||||
"bitflags 2.11.1",
|
"bitflags 2.11.1",
|
||||||
|
|
@ -3435,7 +3421,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_widget"
|
name = "iced_widget"
|
||||||
version = "0.14.2"
|
version = "0.14.2"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cosmic-client-toolkit",
|
"cosmic-client-toolkit",
|
||||||
"dnd",
|
"dnd",
|
||||||
|
|
@ -3455,7 +3440,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_winit"
|
name = "iced_winit"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cosmic-client-toolkit",
|
"cosmic-client-toolkit",
|
||||||
"cursor-icon",
|
"cursor-icon",
|
||||||
|
|
@ -4565,9 +4549,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f"
|
checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libcosmic"
|
name = "libcosmic-yoda"
|
||||||
version = "1.0.0"
|
version = "0.1.0-yoda"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"apply",
|
"apply",
|
||||||
"ashpd 0.12.3",
|
"ashpd 0.12.3",
|
||||||
|
|
|
||||||
34
Cargo.toml
34
Cargo.toml
|
|
@ -9,21 +9,23 @@ rust-version = "1.90"
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
cosmic-randr = { git = "https://github.com/pop-os/cosmic-randr" }
|
cosmic-randr = { git = "https://github.com/pop-os/cosmic-randr" }
|
||||||
tokio = { version = "1.49.0", features = ["macros"] }
|
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/Devels/libcosmic/iced/winit", default-features = false }
|
||||||
|
|
||||||
[workspace.dependencies.libcosmic]
|
# Yoda fork — libcosmic-yoda by path, replaces upstream git dep.
|
||||||
|
[workspace.dependencies.libcosmic-yoda]
|
||||||
features = [
|
features = [
|
||||||
"dbus-config",
|
"dbus-config",
|
||||||
"desktop",
|
"desktop",
|
||||||
"multi-window",
|
"multi-window",
|
||||||
"winit",
|
"wayland",
|
||||||
"tokio",
|
"tokio",
|
||||||
"qr_code",
|
"qr_code",
|
||||||
]
|
]
|
||||||
git = "https://github.com/pop-os/libcosmic"
|
path = "/home/lionel/Devels/libcosmic"
|
||||||
|
|
||||||
[workspace.dependencies.cosmic-config]
|
[workspace.dependencies.cosmic-config]
|
||||||
git = "https://github.com/pop-os/libcosmic"
|
path = "/home/lionel/Devels/libcosmic/cosmic-config"
|
||||||
|
|
||||||
[workspace.dependencies.cosmic-bg-config]
|
[workspace.dependencies.cosmic-bg-config]
|
||||||
git = "https://github.com/pop-os/cosmic-bg"
|
git = "https://github.com/pop-os/cosmic-bg"
|
||||||
|
|
@ -69,19 +71,15 @@ cosmic-client-toolkit = { git = "https://github.com/pop-os/cosmic-protocols//",
|
||||||
# [patch.'https://github.com/pop-os/cosmic-settings-daemon']
|
# [patch.'https://github.com/pop-os/cosmic-settings-daemon']
|
||||||
# cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon//", branch = "input_nobuild" }
|
# cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon//", branch = "input_nobuild" }
|
||||||
|
|
||||||
# For development and testing purposes
|
# Yoda fork: redirect every transitive dep that asks for pop-os/libcosmic
|
||||||
# [patch.'https://github.com/pop-os/libcosmic']
|
# (cosmic-bg-config, cosmic-comp-config, cosmic-idle-config, cosmic-panel-config,
|
||||||
# libcosmic = { path = "../libcosmic" }
|
# cosmic-settings-config, cosmic-settings-daemon-config) to our local paths so
|
||||||
# cosmic-config = { path = "../libcosmic/cosmic-config" }
|
# the whole graph resolves against a single cosmic-config / cosmic-theme / iced_*.
|
||||||
# cosmic-theme = { path = "../libcosmic/cosmic-theme" }
|
[patch.'https://github.com/pop-os/libcosmic']
|
||||||
# iced_futures = { path = "../libcosmic/iced/futures" }
|
cosmic-config = { path = "/home/lionel/Devels/libcosmic/cosmic-config" }
|
||||||
# iced_winit = { path = "../libcosmic/iced/winit" }
|
cosmic-theme = { path = "/home/lionel/Devels/libcosmic/cosmic-theme" }
|
||||||
|
iced_futures = { path = "/home/lionel/Devels/libcosmic/iced/futures" }
|
||||||
# libcosmic = { git = "https://github.com/pop-os/libcosmic//" }
|
iced_winit = { path = "/home/lionel/Devels/libcosmic/iced/winit" }
|
||||||
# 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/dbus-settings-bindings']
|
# [patch.'https://github.com/pop-os/dbus-settings-bindings']
|
||||||
# cosmic-dbus-networkmanager = { path = "../dbus-settings-bindings/networkmanager" }
|
# cosmic-dbus-networkmanager = { path = "../dbus-settings-bindings/networkmanager" }
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ image = { version = "0.25", default-features = false, features = [
|
||||||
indexmap = "2.13.0"
|
indexmap = "2.13.0"
|
||||||
itertools = "0.14.0"
|
itertools = "0.14.0"
|
||||||
itoa = "1.0.17"
|
itoa = "1.0.17"
|
||||||
libcosmic.workspace = true
|
libcosmic-yoda.workspace = true
|
||||||
iced_winit.workspace = true
|
iced_winit.workspace = true
|
||||||
locale1 = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true }
|
locale1 = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true }
|
||||||
sysinfo = { version = "=0.38.0", optional = true }
|
sysinfo = { version = "=0.38.0", optional = true }
|
||||||
|
|
@ -187,12 +187,12 @@ page-window-management = ["cosmic-comp-config", "dep:cosmic-settings-config"]
|
||||||
page-workspaces = ["cosmic-comp-config"]
|
page-workspaces = ["cosmic-comp-config"]
|
||||||
|
|
||||||
# Other features
|
# Other features
|
||||||
a11y = ["libcosmic/a11y"]
|
a11y = ["libcosmic-yoda/a11y"]
|
||||||
ashpd = ["dep:ashpd"]
|
ashpd = ["dep:ashpd"]
|
||||||
cosmic-comp-config = ["dep:cosmic-comp-config"]
|
cosmic-comp-config = ["dep:cosmic-comp-config"]
|
||||||
dbus-config = ["libcosmic/dbus-config", "cosmic-config/dbus"]
|
dbus-config = ["libcosmic-yoda/dbus-config", "cosmic-config/dbus"]
|
||||||
single-instance = ["libcosmic/single-instance"]
|
single-instance = ["libcosmic-yoda/single-instance"]
|
||||||
test = []
|
test = []
|
||||||
wayland = ["libcosmic/wayland", "dep:cosmic-panel-config", "dep:cosmic-randr", "iced_winit/cctk"]
|
wayland = ["libcosmic-yoda/wayland", "dep:cosmic-panel-config", "dep:cosmic-randr", "iced_winit/cctk"]
|
||||||
wgpu = ["libcosmic/wgpu"]
|
wgpu = ["libcosmic-yoda/wgpu"]
|
||||||
xdg-portal = ["ashpd", "libcosmic/xdg-portal"]
|
xdg-portal = ["ashpd", "libcosmic-yoda/xdg-portal"]
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ use std::{
|
||||||
|
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
Apply, Element, Task,
|
Apply, Element, Task,
|
||||||
iced::Alignment,
|
iced::{Alignment, Length},
|
||||||
surface,
|
surface,
|
||||||
widget::{self, dropdown, icon, settings},
|
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<crate::pages::Message> {
|
fn apps() -> Section<crate::pages::Message> {
|
||||||
Section::default().view::<Page>(move |_binder, page, section| {
|
Section::default().view::<Page>(move |_binder, page, section| {
|
||||||
let Some(mime_apps) = page.mime_apps.as_ref() else {
|
let Some(mime_apps) = page.mime_apps.as_ref() else {
|
||||||
return widget::space().into();
|
return widget::space().into();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Avoid creating popup_dropdown for empty app lists.
|
settings::section::with_capacity(9)
|
||||||
// Empty categories are rendered as non-interactive text to prevent Wayland crashes.
|
|
||||||
settings::section()
|
|
||||||
.title(§ion.title)
|
.title(§ion.title)
|
||||||
.add({
|
.add(app_item(
|
||||||
let meta = &mime_apps.apps[DROPDOWN_WEB_BROWSER];
|
&mime_apps.apps[DROPDOWN_WEB_BROWSER],
|
||||||
if meta.apps.is_empty() {
|
|
||||||
settings::flex_item(
|
|
||||||
fl!("default-apps", "web-browser"),
|
fl!("default-apps", "web-browser"),
|
||||||
widget::text(fl!("default-apps", "not-installed")),
|
Category::WebBrowser,
|
||||||
)
|
))
|
||||||
.align_items(Alignment::Center)
|
.add(app_item(
|
||||||
} else {
|
&mime_apps.apps[DROPDOWN_FILE_MANAGER],
|
||||||
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"),
|
fl!("default-apps", "file-manager"),
|
||||||
widget::text(fl!("default-apps", "not-installed")),
|
Category::FileManager,
|
||||||
)
|
))
|
||||||
.align_items(Alignment::Center)
|
.add(app_item(
|
||||||
} else {
|
&mime_apps.apps[DROPDOWN_MAIL],
|
||||||
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"),
|
fl!("default-apps", "mail-client"),
|
||||||
widget::text(fl!("default-apps", "not-installed")),
|
Category::Mail,
|
||||||
)
|
))
|
||||||
.align_items(Alignment::Center)
|
.add(app_item(
|
||||||
} else {
|
&mime_apps.apps[DROPDOWN_MUSIC],
|
||||||
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"),
|
fl!("default-apps", "music"),
|
||||||
widget::text(fl!("default-apps", "not-installed")),
|
Category::Audio,
|
||||||
)
|
))
|
||||||
.align_items(Alignment::Center)
|
.add(app_item(
|
||||||
} else {
|
&mime_apps.apps[DROPDOWN_VIDEO],
|
||||||
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"),
|
fl!("default-apps", "video"),
|
||||||
widget::text(fl!("default-apps", "not-installed")),
|
Category::Video,
|
||||||
)
|
))
|
||||||
.align_items(Alignment::Center)
|
.add(app_item(
|
||||||
} else {
|
&mime_apps.apps[DROPDOWN_PHOTO],
|
||||||
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"),
|
fl!("default-apps", "photos"),
|
||||||
widget::text(fl!("default-apps", "not-installed")),
|
Category::Image,
|
||||||
)
|
))
|
||||||
.align_items(Alignment::Center)
|
.add(app_item(
|
||||||
} else {
|
&mime_apps.apps[DROPDOWN_CALENDAR],
|
||||||
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"),
|
fl!("default-apps", "calendar"),
|
||||||
widget::text(fl!("default-apps", "not-installed")),
|
Category::Calendar,
|
||||||
)
|
))
|
||||||
.align_items(Alignment::Center)
|
.add(app_item(
|
||||||
} else {
|
&mime_apps.apps[DROPDOWN_TERMINAL],
|
||||||
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"),
|
fl!("default-apps", "terminal"),
|
||||||
widget::text(fl!("default-apps", "not-installed")),
|
Category::Terminal,
|
||||||
)
|
))
|
||||||
.align_items(Alignment::Center)
|
.add(app_item(
|
||||||
} else {
|
&mime_apps.apps[DROPDOWN_TEXT_EDITOR],
|
||||||
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"),
|
fl!("default-apps", "text-editor"),
|
||||||
widget::text(fl!("default-apps", "not-installed")),
|
Category::TextEditor,
|
||||||
)
|
))
|
||||||
.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)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.apply(Element::from)
|
.apply(Element::from)
|
||||||
.map(crate::pages::Message::DefaultApps)
|
.map(crate::pages::Message::DefaultApps)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@ use crate::pages::desktop::appearance::Roundness;
|
||||||
pub struct PageInner {
|
pub struct PageInner {
|
||||||
pub(crate) config_helper: Option<cosmic_config::Config>,
|
pub(crate) config_helper: Option<cosmic_config::Config>,
|
||||||
pub(crate) panel_config: Option<CosmicPanelConfig>,
|
pub(crate) panel_config: Option<CosmicPanelConfig>,
|
||||||
pub size: Option<PanelSize>,
|
|
||||||
pub opacity: f32,
|
pub opacity: f32,
|
||||||
pub opacity_changing: bool,
|
pub opacity_changing: bool,
|
||||||
|
pub size: PanelSize,
|
||||||
pub outputs: Vec<String>,
|
pub outputs: Vec<String>,
|
||||||
pub anchors: Vec<String>,
|
pub anchors: Vec<String>,
|
||||||
pub backgrounds: Vec<String>,
|
pub backgrounds: Vec<String>,
|
||||||
|
|
@ -40,9 +40,9 @@ impl Default for PageInner {
|
||||||
Self {
|
Self {
|
||||||
config_helper: Option::default(),
|
config_helper: Option::default(),
|
||||||
panel_config: Option::default(),
|
panel_config: Option::default(),
|
||||||
size: Option::default(),
|
|
||||||
opacity: 0.0,
|
opacity: 0.0,
|
||||||
opacity_changing: false,
|
opacity_changing: false,
|
||||||
|
size: PanelSize::M,
|
||||||
outputs: vec![fl!("all-displays")],
|
outputs: vec![fl!("all-displays")],
|
||||||
anchors: vec![
|
anchors: vec![
|
||||||
Anchor(PanelAnchor::Left).to_string(),
|
Anchor(PanelAnchor::Left).to_string(),
|
||||||
|
|
@ -209,9 +209,7 @@ pub(crate) fn style<
|
||||||
text::body(fl!("small")).into(),
|
text::body(fl!("small")).into(),
|
||||||
slider(
|
slider(
|
||||||
0..=4,
|
0..=4,
|
||||||
match inner.size.as_ref().expect(
|
match inner.size {
|
||||||
"PageInner.size is None even though PageInner.panel_config is Some",
|
|
||||||
) {
|
|
||||||
PanelSize::XS => 0,
|
PanelSize::XS => 0,
|
||||||
PanelSize::S => 1,
|
PanelSize::S => 1,
|
||||||
PanelSize::M => 2,
|
PanelSize::M => 2,
|
||||||
|
|
@ -506,7 +504,7 @@ impl PageInner {
|
||||||
if let Err(err) = default.write_entry(config) {
|
if let Err(err) = default.write_entry(config) {
|
||||||
tracing::error!(?err, "Error resetting panel 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.system_default = Some(default.clone());
|
||||||
self.panel_config.clone_from(&self.system_default);
|
self.panel_config.clone_from(&self.system_default);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -605,16 +603,10 @@ impl PageInner {
|
||||||
_ = panel_config.set_border_radius(helper, new_radius).unwrap();
|
_ = panel_config.set_border_radius(helper, new_radius).unwrap();
|
||||||
}
|
}
|
||||||
Message::PanelSize(size) => {
|
Message::PanelSize(size) => {
|
||||||
self.size = Some(size);
|
self.size = size;
|
||||||
}
|
}
|
||||||
Message::PanelSizeCommit => {
|
Message::PanelSizeCommit => {
|
||||||
_ = panel_config.set_size(
|
_ = panel_config.set_size(helper, self.size.clone());
|
||||||
helper,
|
|
||||||
self.size
|
|
||||||
.as_ref()
|
|
||||||
.expect("PageInner.size is None even though it should be Some, since PageInner.panel_config is Some")
|
|
||||||
.clone()
|
|
||||||
);
|
|
||||||
// Reset any size overrides the user might have set
|
// Reset any size overrides the user might have set
|
||||||
_ = panel_config.set_size_center(helper, None);
|
_ = panel_config.set_size_center(helper, None);
|
||||||
_ = panel_config.set_size_wings(helper, None);
|
_ = panel_config.set_size_wings(helper, None);
|
||||||
|
|
@ -677,7 +669,7 @@ impl PageInner {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Message::PanelConfig(c) => {
|
Message::PanelConfig(c) => {
|
||||||
self.size = Some(c.size.clone());
|
self.size = c.size.clone();
|
||||||
self.panel_config = Some(*c);
|
self.panel_config = Some(*c);
|
||||||
return Task::none();
|
return Task::none();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
// 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)
|
(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(
|
let system_default = cosmic::cosmic_config::Config::system(
|
||||||
&format!("{}.Panel", cosmic_panel_config::NAME),
|
&format!("{}.Panel", cosmic_panel_config::NAME),
|
||||||
CosmicPanelConfig::VERSION,
|
CosmicPanelConfig::VERSION,
|
||||||
|
|
@ -99,7 +98,6 @@ impl Default for Page {
|
||||||
inner: PageInner {
|
inner: PageInner {
|
||||||
config_helper,
|
config_helper,
|
||||||
panel_config,
|
panel_config,
|
||||||
size,
|
|
||||||
container_config,
|
container_config,
|
||||||
outputs_map: HashMap::new(),
|
outputs_map: HashMap::new(),
|
||||||
system_default,
|
system_default,
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ pub enum Message {
|
||||||
ShowActiveWindowHint(bool),
|
ShowActiveWindowHint(bool),
|
||||||
ShowMaximizeButton(bool),
|
ShowMaximizeButton(bool),
|
||||||
ShowMinimizeButton(bool),
|
ShowMinimizeButton(bool),
|
||||||
|
WindowControlsPositionStart(bool),
|
||||||
SetEdgeSnapThreshold(u32),
|
SetEdgeSnapThreshold(u32),
|
||||||
Surface(surface::Action),
|
Surface(surface::Action),
|
||||||
}
|
}
|
||||||
|
|
@ -177,6 +178,19 @@ impl Page {
|
||||||
.set_show_minimize(&config, value);
|
.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) => {
|
Message::ShowActiveWindowHint(value) => {
|
||||||
self.show_active_hint = value;
|
self.show_active_hint = value;
|
||||||
if let Err(err) = self.comp_config.set("active_hint", value) {
|
if let Err(err) = self.comp_config.set("active_hint", value) {
|
||||||
|
|
@ -274,6 +288,7 @@ pub fn window_controls() -> Section<crate::pages::Message> {
|
||||||
maximize = fl!("window-controls", "maximize");
|
maximize = fl!("window-controls", "maximize");
|
||||||
minimize = fl!("window-controls", "minimize");
|
minimize = fl!("window-controls", "minimize");
|
||||||
active_window_hint = fl!("window-controls", "active-window-hint");
|
active_window_hint = fl!("window-controls", "active-window-hint");
|
||||||
|
position_start = fl!("window-controls", "position-start");
|
||||||
});
|
});
|
||||||
|
|
||||||
Section::default()
|
Section::default()
|
||||||
|
|
@ -296,6 +311,13 @@ pub fn window_controls() -> Section<crate::pages::Message> {
|
||||||
settings::item::builder(&descriptions[minimize])
|
settings::item::builder(&descriptions[minimize])
|
||||||
.toggler(cosmic::config::show_minimize(), Message::ShowMinimizeButton),
|
.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)
|
.apply(Element::from)
|
||||||
.map(crate::pages::Message::WindowManagement)
|
.map(crate::pages::Message::WindowManagement)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -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::commands::keyboard_shortcuts_inhibit;
|
||||||
use cosmic::iced::platform_specific::shell::wayland::keymap;
|
use cosmic::iced::platform_specific::shell::wayland::keymap;
|
||||||
use cosmic::iced::{self, Alignment, Length};
|
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::{Apply, Element, Task, theme};
|
||||||
use cosmic_config::{ConfigGet, ConfigSet};
|
use cosmic_config::{ConfigGet, ConfigSet};
|
||||||
use cosmic_settings_config::shortcuts::{self, Action, Binding, Shortcuts};
|
use cosmic_settings_config::shortcuts::{self, Action, Binding, Shortcuts};
|
||||||
|
|
@ -865,13 +865,11 @@ fn context_drawer<'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Display a shortcut as a list item
|
/// Display a shortcut as a list item
|
||||||
fn shortcut_item(custom: bool, id: usize, data: &ShortcutModel) -> Element<'_, ShortcutMessage> {
|
fn shortcut_item(
|
||||||
#[derive(Copy, Clone, Debug)]
|
custom: bool,
|
||||||
enum LocalMessage {
|
id: usize,
|
||||||
Remove,
|
data: &ShortcutModel,
|
||||||
Show,
|
) -> list::ListButton<'_, ShortcutMessage> {
|
||||||
}
|
|
||||||
|
|
||||||
let bindings = data
|
let bindings = data
|
||||||
.bindings
|
.bindings
|
||||||
.iter()
|
.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())
|
.map(|(_, shortcut)| text::body(shortcut.binding.to_string()).into())
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
let shortcuts: Element<LocalMessage> = if bindings.is_empty() {
|
let shortcuts: Element<ShortcutMessage> = if bindings.is_empty() {
|
||||||
text::body(fl!("disabled")).into()
|
text::body(fl!("disabled")).into()
|
||||||
} else {
|
} else {
|
||||||
widget::column::with_children(bindings)
|
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(icon::from_name("go-next-symbolic").size(16))
|
||||||
.push_maybe(custom.then(|| {
|
.push_maybe(custom.then(|| {
|
||||||
widget::button::icon(icon::from_name("edit-delete-symbolic"))
|
widget::button::icon(icon::from_name("edit-delete-symbolic"))
|
||||||
.on_press(LocalMessage::Remove)
|
.on_press(ShortcutMessage::DeleteShortcut(id))
|
||||||
}))
|
}))
|
||||||
.align_y(Alignment::Center)
|
.align_y(Alignment::Center)
|
||||||
.spacing(8);
|
.spacing(8);
|
||||||
|
|
@ -909,14 +907,7 @@ fn shortcut_item(custom: bool, id: usize, data: &ShortcutModel) -> Element<'_, S
|
||||||
.flex_control(control)
|
.flex_control(control)
|
||||||
.align_items(Alignment::Center)
|
.align_items(Alignment::Center)
|
||||||
.spacing(16)
|
.spacing(16)
|
||||||
.apply(widget::container)
|
.width(Length::Shrink)
|
||||||
.class(theme::Container::List)
|
.apply(list::button)
|
||||||
.apply(widget::button::custom)
|
.on_press(ShortcutMessage::ShowShortcut(id, data.description.clone()))
|
||||||
.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),
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ pub mod tiling;
|
||||||
|
|
||||||
use cosmic::app::ContextDrawer;
|
use cosmic::app::ContextDrawer;
|
||||||
use cosmic::iced::Length;
|
use cosmic::iced::Length;
|
||||||
use cosmic::widget::{self, icon, settings, text};
|
use cosmic::widget::{self, list::ListButton, settings, text};
|
||||||
use cosmic::{Apply, Element, Task, theme};
|
use cosmic::{Apply, Element, Task};
|
||||||
use cosmic_config::ConfigGet;
|
use cosmic_config::ConfigGet;
|
||||||
use cosmic_settings_config::Binding;
|
use cosmic_settings_config::Binding;
|
||||||
use cosmic_settings_config::shortcuts::action::{
|
use cosmic_settings_config::shortcuts::action::{
|
||||||
|
|
@ -222,11 +222,13 @@ impl Page {
|
||||||
self.search.localized = SecondaryMap::new();
|
self.search.localized = SecondaryMap::new();
|
||||||
self.search.input = String::new();
|
self.search.input = String::new();
|
||||||
self.search_model.on_clear();
|
self.search_model.on_clear();
|
||||||
self.modified.custom = 0;
|
self.modified.accessibility = 0;
|
||||||
self.modified.manage_windows = 0;
|
self.modified.manage_windows = 0;
|
||||||
self.modified.move_windows = 0;
|
self.modified.move_windows = 0;
|
||||||
self.modified.nav = 0;
|
self.modified.nav = 0;
|
||||||
self.modified.system = 0;
|
self.modified.system = 0;
|
||||||
|
self.modified.window_tiling = 0;
|
||||||
|
self.modified.custom = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn reload_search(&mut self) {
|
fn reload_search(&mut self) {
|
||||||
|
|
@ -497,32 +499,18 @@ fn shortcuts() -> Section<crate::pages::Message> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Display a category as a list item
|
/// Display a category as a list item
|
||||||
fn category_item(category: Category, name: &str, modified: u16) -> Element<'_, Message> {
|
fn category_item(category: Category, name: &str, modified: u16) -> ListButton<'_, Message> {
|
||||||
let icon = icon::from_name("go-next-symbolic").size(16);
|
crate::widget::go_next_with_item(
|
||||||
|
name,
|
||||||
let control = if modified == 0 {
|
(modified > 0).then(|| text::body(fl!("modified", count = modified)).apply(Element::from)),
|
||||||
Element::from(icon)
|
Message::Category(category),
|
||||||
} 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 action_category(action: &Action) -> Option<Category> {
|
fn action_category(action: &Action) -> Option<Category> {
|
||||||
Some(if manage_windows::actions().contains(action) {
|
Some(if accessibility::actions().contains(action) {
|
||||||
|
Category::Accessibility
|
||||||
|
} else if manage_windows::actions().contains(action) {
|
||||||
Category::ManageWindow
|
Category::ManageWindow
|
||||||
} else if move_window::actions().contains(action) {
|
} else if move_window::actions().contains(action) {
|
||||||
Category::MoveWindow
|
Category::MoveWindow
|
||||||
|
|
@ -530,6 +518,8 @@ fn action_category(action: &Action) -> Option<Category> {
|
||||||
Category::Nav
|
Category::Nav
|
||||||
} else if system::actions().contains(action) {
|
} else if system::actions().contains(action) {
|
||||||
Category::System
|
Category::System
|
||||||
|
} else if tiling::actions().contains(action) {
|
||||||
|
Category::WindowTiling
|
||||||
} else {
|
} else {
|
||||||
return None;
|
return None;
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ use cosmic::{
|
||||||
cosmic_config::{self, ConfigGet, ConfigSet},
|
cosmic_config::{self, ConfigGet, ConfigSet},
|
||||||
iced::core::text::Wrapping,
|
iced::core::text::Wrapping,
|
||||||
surface,
|
surface,
|
||||||
widget::{self, dropdown, list, settings},
|
widget::{self, dropdown, settings},
|
||||||
};
|
};
|
||||||
use cosmic_settings_page::{self as page, Section, section};
|
use cosmic_settings_page::{self as page, Section, section};
|
||||||
use icu::{
|
use icu::{
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ use std::sync::Arc;
|
||||||
use crate::widget::selection_context_item;
|
use crate::widget::selection_context_item;
|
||||||
use cosmic::app::{ContextDrawer, context_drawer};
|
use cosmic::app::{ContextDrawer, context_drawer};
|
||||||
use cosmic::iced::{Alignment, Length};
|
use cosmic::iced::{Alignment, Length};
|
||||||
use cosmic::widget::{self, button, list};
|
use cosmic::widget::{self, button};
|
||||||
use cosmic::{Apply, Element};
|
use cosmic::{Apply, Element};
|
||||||
use cosmic_config::{ConfigGet, ConfigSet};
|
use cosmic_config::{ConfigGet, ConfigSet};
|
||||||
use cosmic_settings_page::Section;
|
use cosmic_settings_page::Section;
|
||||||
|
|
|
||||||
|
|
@ -206,8 +206,10 @@ pub fn go_next_with_item<'a, Msg: 'static>(
|
||||||
msg_opt: impl Into<Option<Msg>>,
|
msg_opt: impl Into<Option<Msg>>,
|
||||||
) -> list::ListButton<'a, Msg> {
|
) -> list::ListButton<'a, Msg> {
|
||||||
settings::item_row(vec![
|
settings::item_row(vec![
|
||||||
text::body(description).wrapping(Wrapping::Word).into(),
|
text::body(description)
|
||||||
horizontal().into(),
|
.width(Length::Fill)
|
||||||
|
.wrapping(Wrapping::Word)
|
||||||
|
.into(),
|
||||||
row::with_capacity(2)
|
row::with_capacity(2)
|
||||||
.push(item)
|
.push(item)
|
||||||
.push(icon::from_name("go-next-symbolic").size(16).icon())
|
.push(icon::from_name("go-next-symbolic").size(16).icon())
|
||||||
|
|
|
||||||
1
i18n/en/cosmic_settings.ftl
vendored
1
i18n/en/cosmic_settings.ftl
vendored
|
|
@ -484,6 +484,7 @@ window-controls = Window controls
|
||||||
.maximize = Show maximize button
|
.maximize = Show maximize button
|
||||||
.minimize = Show minimize button
|
.minimize = Show minimize button
|
||||||
.active-window-hint = Show active window hint
|
.active-window-hint = Show active window hint
|
||||||
|
.position-start = Place buttons on the left (macOS style)
|
||||||
|
|
||||||
focus-navigation = Focus navigation
|
focus-navigation = Focus navigation
|
||||||
.focus-follows-cursor = Focus follows cursor
|
.focus-follows-cursor = Focus follows cursor
|
||||||
|
|
|
||||||
1
i18n/fr/cosmic_settings.ftl
vendored
1
i18n/fr/cosmic_settings.ftl
vendored
|
|
@ -322,6 +322,7 @@ window-controls = Contrôles des fenêtres
|
||||||
.maximize = Afficher le bouton maximiser
|
.maximize = Afficher le bouton maximiser
|
||||||
.minimize = Afficher le bouton minimiser
|
.minimize = Afficher le bouton minimiser
|
||||||
.active-window-hint = Afficher l'indice de la fenêtre active
|
.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-navigation = Navigation par le focus
|
||||||
.focus-follows-cursor = Le focus suit le curseur
|
.focus-follows-cursor = Le focus suit le curseur
|
||||||
.focus-follows-cursor-delay = Délai de suivi du focus en ms
|
.focus-follows-cursor-delay = Délai de suivi du focus en ms
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ edition = "2024"
|
||||||
derive_setters = "0.1.9"
|
derive_setters = "0.1.9"
|
||||||
regex = "1.12.3"
|
regex = "1.12.3"
|
||||||
slotmap = "1.1.1"
|
slotmap = "1.1.1"
|
||||||
libcosmic = { workspace = true }
|
libcosmic-yoda = { workspace = true }
|
||||||
downcast-rs = "2.0.2"
|
downcast-rs = "2.0.2"
|
||||||
url = "2.5.8"
|
url = "2.5.8"
|
||||||
slab = "0.4.12"
|
slab = "0.4.12"
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,7 @@ pub async fn load_each_from_path(
|
||||||
) -> Pin<Box<dyn Send + Stream<Item = (PathBuf, RgbaImage, RgbaImage)>>> {
|
) -> Pin<Box<dyn Send + Stream<Item = (PathBuf, RgbaImage, RgbaImage)>>> {
|
||||||
let candidate_paths: Vec<_> = WalkDir::new(path)
|
let candidate_paths: Vec<_> = WalkDir::new(path)
|
||||||
.max_depth(3)
|
.max_depth(3)
|
||||||
|
.follow_links(true)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(Result::ok)
|
.filter_map(Result::ok)
|
||||||
.filter(|entry| entry.file_type().is_file())
|
.filter(|entry| entry.file_type().is_file())
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ publish = true
|
||||||
cosmic-pipewire = { path = "../../crates/cosmic-pipewire" }
|
cosmic-pipewire = { path = "../../crates/cosmic-pipewire" }
|
||||||
futures = "0.3.32"
|
futures = "0.3.32"
|
||||||
intmap = "3.1.3"
|
intmap = "3.1.3"
|
||||||
libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false }
|
libcosmic-yoda = { path = "/home/lionel/Devels/libcosmic", default-features = false }
|
||||||
numtoa = "1.0.0-alpha1"
|
numtoa = "1.0.0-alpha1"
|
||||||
rustix = "1.1.3"
|
rustix = "1.1.3"
|
||||||
tokio = { version = "1.49.0", features = ["process", "rt", "time"] }
|
tokio = { version = "1.49.0", features = ["process", "rt", "time"] }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue