Compare commits
2 commits
0186f5de15
...
f9b27c8d4d
| Author | SHA1 | Date | |
|---|---|---|---|
| f9b27c8d4d | |||
| a44a022144 |
7 changed files with 54 additions and 29 deletions
38
Cargo.lock
generated
38
Cargo.lock
generated
|
|
@ -278,7 +278,7 @@ version = "1.1.5"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
|
||||
dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -289,7 +289,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
|
|||
dependencies = [
|
||||
"anstyle",
|
||||
"once_cell_polyfill",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1434,7 +1434,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cosmic-panel-config"
|
||||
version = "0.1.0"
|
||||
version = "1.3.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cosmic-config",
|
||||
|
|
@ -1460,7 +1460,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cosmic-randr"
|
||||
version = "0.1.0"
|
||||
version = "1.3.0"
|
||||
dependencies = [
|
||||
"cosmic-protocols",
|
||||
"indexmap 2.14.0",
|
||||
|
|
@ -1473,7 +1473,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cosmic-randr-shell"
|
||||
version = "0.1.0"
|
||||
version = "1.3.0"
|
||||
dependencies = [
|
||||
"kdl",
|
||||
"slotmap",
|
||||
|
|
@ -1530,7 +1530,7 @@ dependencies = [
|
|||
"itertools",
|
||||
"itoa",
|
||||
"jiff",
|
||||
"libcosmic",
|
||||
"libcosmic-yoda",
|
||||
"locale1",
|
||||
"locales-rs",
|
||||
"mime 0.3.17",
|
||||
|
|
@ -1701,7 +1701,7 @@ version = "1.0.7"
|
|||
dependencies = [
|
||||
"derive_setters",
|
||||
"downcast-rs 2.0.2",
|
||||
"libcosmic",
|
||||
"libcosmic-yoda",
|
||||
"regex",
|
||||
"slab",
|
||||
"slotmap",
|
||||
|
|
@ -2122,7 +2122,7 @@ dependencies = [
|
|||
"libc",
|
||||
"option-ext",
|
||||
"redox_users",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2265,7 +2265,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -4363,7 +4363,7 @@ version = "1.4.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7a1886916523694cd6ea3d175f03a1e5010699a2a4cc13696d83d7bea1d80638"
|
||||
dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -4426,7 +4426,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
|
||||
|
||||
[[package]]
|
||||
name = "libcosmic"
|
||||
name = "libcosmic-yoda"
|
||||
version = "0.1.0-yoda.2"
|
||||
dependencies = [
|
||||
"apply",
|
||||
|
|
@ -5001,7 +5001,7 @@ version = "0.50.3"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
|
||||
dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -6361,7 +6361,7 @@ dependencies = [
|
|||
"errno",
|
||||
"libc",
|
||||
"linux-raw-sys 0.12.1",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -6830,7 +6830,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -7064,10 +7064,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"getrandom 0.4.3",
|
||||
"getrandom 0.3.4",
|
||||
"once_cell",
|
||||
"rustix 1.1.4",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -7453,7 +7453,7 @@ checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"
|
|||
dependencies = [
|
||||
"memoffset",
|
||||
"tempfile",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -8123,7 +8123,7 @@ version = "0.1.11"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
||||
dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -8808,7 +8808,7 @@ checksum = "2fb433233f2df9344722454bc7e96465c9d03bff9d77c248f9e7523fe79585b5"
|
|||
|
||||
[[package]]
|
||||
name = "xdg-shell-wrapper-config"
|
||||
version = "0.1.0"
|
||||
version = "1.3.0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"wayland-protocols-wlr",
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ image = { version = "0.25.10", default-features = false, features = [
|
|||
"hdr",
|
||||
] }
|
||||
|
||||
[workspace.dependencies.libcosmic]
|
||||
[workspace.dependencies.cosmic]
|
||||
package = "libcosmic-yoda"
|
||||
features = [
|
||||
"dbus-config",
|
||||
"desktop",
|
||||
|
|
@ -49,7 +50,7 @@ path = "../cosmic-panel/cosmic-panel-config"
|
|||
path = "../cosmic-randr/shell"
|
||||
|
||||
[workspace.dependencies.sctk]
|
||||
version = "1.3.0"
|
||||
version = "0.20.0"
|
||||
package = "smithay-client-toolkit"
|
||||
|
||||
[profile.dev]
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ image.workspace = true
|
|||
indexmap = "2.13.0"
|
||||
itertools = "0.14.0"
|
||||
itoa = "1.0.17"
|
||||
libcosmic.workspace = true
|
||||
cosmic.workspace = true
|
||||
iced_winit.workspace = true
|
||||
locale1 = { git = "https://github.com/pop-os/dbus-settings-bindings", 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"]
|
||||
|
||||
# Other features
|
||||
a11y = ["libcosmic/a11y"]
|
||||
a11y = ["cosmic/a11y"]
|
||||
ashpd = ["dep:ashpd"]
|
||||
cosmic-comp-config = ["dep:cosmic-comp-config"]
|
||||
dbus-config = ["libcosmic/dbus-config", "cosmic-config/dbus"]
|
||||
single-instance = ["libcosmic/single-instance"]
|
||||
dbus-config = ["cosmic/dbus-config", "cosmic-config/dbus"]
|
||||
single-instance = ["cosmic/single-instance"]
|
||||
test = []
|
||||
wayland = ["libcosmic/wayland", "dep:cosmic-panel-config", "dep:cosmic-randr", "iced_winit/cctk"]
|
||||
wgpu = ["libcosmic/wgpu"]
|
||||
xdg-portal = ["ashpd", "libcosmic/xdg-portal"]
|
||||
wayland = ["cosmic/wayland", "dep:cosmic-panel-config", "dep:cosmic-randr", "iced_winit/cctk"]
|
||||
wgpu = ["cosmic/wgpu"]
|
||||
xdg-portal = ["ashpd", "cosmic/xdg-portal"]
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ pub enum Message {
|
|||
ShowActiveWindowHint(bool),
|
||||
ShowMaximizeButton(bool),
|
||||
ShowMinimizeButton(bool),
|
||||
WindowControlsPositionStart(bool),
|
||||
SetEdgeSnapThreshold(u32),
|
||||
Surface(surface::Action),
|
||||
}
|
||||
|
|
@ -173,6 +174,19 @@ impl Page {
|
|||
.set_show_minimize(&config, value);
|
||||
}
|
||||
}
|
||||
Message::WindowControlsPositionStart(left) => {
|
||||
if let Ok(config) = cosmic::config::CosmicTk::config() {
|
||||
let position = if left {
|
||||
cosmic::widget::WindowControlsPosition::Start
|
||||
} else {
|
||||
cosmic::widget::WindowControlsPosition::End
|
||||
};
|
||||
let _res = cosmic::config::COSMIC_TK
|
||||
.write()
|
||||
.unwrap()
|
||||
.set_window_controls_position(&config, position);
|
||||
}
|
||||
}
|
||||
Message::ShowActiveWindowHint(value) => {
|
||||
self.show_active_hint = value;
|
||||
if let Err(err) = self.comp_config.set("active_hint", value) {
|
||||
|
|
@ -270,6 +284,7 @@ pub fn window_controls() -> Section<crate::pages::Message> {
|
|||
maximize = fl!("window-controls", "maximize");
|
||||
minimize = fl!("window-controls", "minimize");
|
||||
active_window_hint = fl!("window-controls", "active-window-hint");
|
||||
position_start = fl!("window-controls", "position-start");
|
||||
});
|
||||
|
||||
Section::default()
|
||||
|
|
@ -292,6 +307,13 @@ pub fn window_controls() -> Section<crate::pages::Message> {
|
|||
settings::item::builder(&descriptions[minimize])
|
||||
.toggler(cosmic::config::show_minimize(), Message::ShowMinimizeButton),
|
||||
)
|
||||
.add(settings::item::builder(&descriptions[position_start]).toggler(
|
||||
matches!(
|
||||
cosmic::config::window_controls_position(),
|
||||
cosmic::widget::WindowControlsPosition::Start
|
||||
),
|
||||
Message::WindowControlsPositionStart,
|
||||
))
|
||||
.apply(Element::from)
|
||||
.map(crate::pages::Message::WindowManagement)
|
||||
})
|
||||
|
|
|
|||
1
i18n/en/cosmic_settings.ftl
vendored
1
i18n/en/cosmic_settings.ftl
vendored
|
|
@ -505,6 +505,7 @@ window-controls = Window controls
|
|||
.maximize = Show maximize button
|
||||
.minimize = Show minimize button
|
||||
.active-window-hint = Show active window hint
|
||||
.position-start = Place buttons on the left (macOS style)
|
||||
|
||||
focus-navigation = Focus navigation
|
||||
.focus-follows-cursor = Focus follows cursor
|
||||
|
|
|
|||
1
i18n/fr/cosmic_settings.ftl
vendored
1
i18n/fr/cosmic_settings.ftl
vendored
|
|
@ -324,6 +324,7 @@ window-controls = Contrôles des fenêtres
|
|||
.maximize = Afficher le bouton maximiser
|
||||
.minimize = Afficher le bouton minimiser
|
||||
.active-window-hint = Afficher l'indice de la fenêtre active
|
||||
.position-start = Placer les boutons à gauche (style macOS)
|
||||
focus-navigation = Navigation par le focus
|
||||
.focus-follows-cursor = Le focus suit le curseur
|
||||
.focus-follows-cursor-delay = Délai de suivi du focus en ms
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ edition = "2024"
|
|||
derive_setters = "0.1.9"
|
||||
regex = "1.12.3"
|
||||
slotmap = "1.1.1"
|
||||
libcosmic = { workspace = true }
|
||||
cosmic = { workspace = true }
|
||||
downcast-rs = "2.0.2"
|
||||
url = "2.5.8"
|
||||
slab = "0.4.12"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue