feat(workspaces): add workspace wrapping toggle
This commit is contained in:
parent
d0fa882596
commit
c06b184ecf
2 changed files with 30 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ pub enum Message {
|
||||||
SetActionOnTyping(usize),
|
SetActionOnTyping(usize),
|
||||||
SetWorkspaceMode(WorkspaceMode),
|
SetWorkspaceMode(WorkspaceMode),
|
||||||
SetWorkspaceLayout(WorkspaceLayout),
|
SetWorkspaceLayout(WorkspaceLayout),
|
||||||
|
SetWorkspaceWraparound(bool),
|
||||||
SetShowName(bool),
|
SetShowName(bool),
|
||||||
SetShowNumber(bool),
|
SetShowNumber(bool),
|
||||||
Surface(surface::Action),
|
Surface(surface::Action),
|
||||||
|
|
@ -87,6 +88,7 @@ impl page::Page<crate::pages::Message> for Page {
|
||||||
sections.insert(action_on_typing()),
|
sections.insert(action_on_typing()),
|
||||||
sections.insert(multi_behavior()),
|
sections.insert(multi_behavior()),
|
||||||
sections.insert(workspace_orientation()),
|
sections.insert(workspace_orientation()),
|
||||||
|
sections.insert(workspace_navigation()),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -125,6 +127,10 @@ impl Page {
|
||||||
into_active_selection(&self.comp_workspace_config.action_on_typing);
|
into_active_selection(&self.comp_workspace_config.action_on_typing);
|
||||||
self.save_comp_config();
|
self.save_comp_config();
|
||||||
}
|
}
|
||||||
|
Message::SetWorkspaceWraparound(value) => {
|
||||||
|
self.comp_workspace_config.workspace_wraparound = value;
|
||||||
|
self.save_comp_config();
|
||||||
|
}
|
||||||
Message::SetShowName(value) => {
|
Message::SetShowName(value) => {
|
||||||
self.show_workspace_name = value;
|
self.show_workspace_name = value;
|
||||||
if let Err(err) = self.config.set("show_workspace_name", value) {
|
if let Err(err) = self.config.set("show_workspace_name", value) {
|
||||||
|
|
@ -250,3 +256,24 @@ fn workspace_orientation() -> Section<crate::pages::Message> {
|
||||||
.map(crate::pages::Message::DesktopWorkspaces)
|
.map(crate::pages::Message::DesktopWorkspaces)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn workspace_navigation() -> Section<crate::pages::Message> {
|
||||||
|
crate::slab!(descriptions {
|
||||||
|
description = fl!("workspaces-navigation", "wraparound");
|
||||||
|
});
|
||||||
|
|
||||||
|
Section::default()
|
||||||
|
.title(fl!("workspaces-navigation"))
|
||||||
|
.descriptions(descriptions)
|
||||||
|
.view::<Page>(move |_binder, page, section| {
|
||||||
|
let descriptions = §ion.descriptions;
|
||||||
|
settings::section()
|
||||||
|
.title(§ion.title)
|
||||||
|
.add(settings::item::builder(&descriptions[description]).toggler(
|
||||||
|
page.comp_workspace_config.workspace_wraparound,
|
||||||
|
Message::SetWorkspaceWraparound,
|
||||||
|
))
|
||||||
|
.apply(Element::from)
|
||||||
|
.map(crate::pages::Message::DesktopWorkspaces)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
3
i18n/en/cosmic_settings.ftl
vendored
3
i18n/en/cosmic_settings.ftl
vendored
|
|
@ -521,6 +521,9 @@ workspaces-orientation = Workspaces orientation
|
||||||
hot-corner = Hot Corner
|
hot-corner = Hot Corner
|
||||||
.top-left-corner = Enable top-left hot corner for Workspaces
|
.top-left-corner = Enable top-left hot corner for Workspaces
|
||||||
|
|
||||||
|
workspaces-navigation = Navigation
|
||||||
|
.wraparound = Move between first and last workspace using keyboard shortcuts and gestures
|
||||||
|
|
||||||
## Displays
|
## Displays
|
||||||
|
|
||||||
-requires-restart = Requires restart
|
-requires-restart = Requires restart
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue