window-management: restaurer le toggle boutons a gauche (style macOS)
Reprend le contenu de52ce463(22 avril), present sur local/yoda-main mais jamais reporte sur local/yoda-main-1.3.0. La branche 1.3.0 a ete coupee sans ce commit, si bien que le paquet construit le 31 juillet ne contenait plus l'option : `strings /usr/bin/cosmic-settings` ne trouvait aucune occurrence de position-start. Retablit dans Bureau > Gestion des fenetres > Controles des fenetres le bouton « Placer les boutons a gauche (style macOS) », le variant de message WindowControlsPositionStart qui ecrit Start ou End dans le CosmicTk (com.system76.CosmicTk), et la cle fluent window-controls.position-start en en et fr. Le Cargo.toml de52ce463n'est volontairement pas repris : son override [patch] vers libcosmic est obsolete depuisa44a022, qui resout la dependance via libcosmic-yoda sous le nom externe `cosmic`. L'API cote libcosmic est intacte (WindowControlsPosition exporte par widget, config::window_controls_position()), cargo check passe. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a44a022144
commit
f9b27c8d4d
3 changed files with 24 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue