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),
|
||||
SetWorkspaceMode(WorkspaceMode),
|
||||
SetWorkspaceLayout(WorkspaceLayout),
|
||||
SetWorkspaceWraparound(bool),
|
||||
SetShowName(bool),
|
||||
SetShowNumber(bool),
|
||||
Surface(surface::Action),
|
||||
|
|
@ -87,6 +88,7 @@ impl page::Page<crate::pages::Message> for Page {
|
|||
sections.insert(action_on_typing()),
|
||||
sections.insert(multi_behavior()),
|
||||
sections.insert(workspace_orientation()),
|
||||
sections.insert(workspace_navigation()),
|
||||
])
|
||||
}
|
||||
|
||||
|
|
@ -125,6 +127,10 @@ impl Page {
|
|||
into_active_selection(&self.comp_workspace_config.action_on_typing);
|
||||
self.save_comp_config();
|
||||
}
|
||||
Message::SetWorkspaceWraparound(value) => {
|
||||
self.comp_workspace_config.workspace_wraparound = value;
|
||||
self.save_comp_config();
|
||||
}
|
||||
Message::SetShowName(value) => {
|
||||
self.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)
|
||||
})
|
||||
}
|
||||
|
||||
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
|
||||
.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
|
||||
|
||||
-requires-restart = Requires restart
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue