accessibility/magnifier: Add new settings
This commit is contained in:
parent
48e14d4add
commit
665e4e13b8
3 changed files with 36 additions and 1 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -1510,7 +1510,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-comp-config"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/cosmic-comp#b0d0bfb034150bed134d3c4f29d49a6a22f4454c"
|
||||
source = "git+https://github.com/pop-os/cosmic-comp#c072538a6e8ac8fbde7863c60eea05f78b6ee3de"
|
||||
dependencies = [
|
||||
"cosmic-config",
|
||||
"input",
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ pub enum Message {
|
|||
Event(wayland::AccessibilityEvent),
|
||||
ProtocolUnavailable,
|
||||
SetMagnifier(bool),
|
||||
SetMouseShortcuts(bool),
|
||||
SetOverlay(bool),
|
||||
SetIncrement(usize),
|
||||
SetSignin(bool),
|
||||
SetMovement(ZoomMovement),
|
||||
|
|
@ -197,6 +199,8 @@ pub fn magnifier(
|
|||
crate::slab!(descriptions {
|
||||
magnifier = fl!("magnifier");
|
||||
controls = fl!("magnifier", "controls", zoom_in = zoom_in, zoom_out = zoom_out);
|
||||
scroll_controls = fl!("magnifier", "scroll_controls");
|
||||
show_overlay = fl!("magnifier", "show_overlay");
|
||||
increment = fl!("magnifier", "increment");
|
||||
signin = fl!("magnifier", "signin");
|
||||
});
|
||||
|
|
@ -216,6 +220,15 @@ pub fn magnifier(
|
|||
widget::toggler(page.magnifier_state).on_toggle(Message::SetMagnifier),
|
||||
),
|
||||
)
|
||||
.add(settings::item(
|
||||
&descriptions[scroll_controls],
|
||||
widget::toggler(page.zoom_config.enable_mouse_zoom_shortcuts)
|
||||
.on_toggle(Message::SetMouseShortcuts),
|
||||
))
|
||||
.add(settings::item(
|
||||
&descriptions[show_overlay],
|
||||
widget::toggler(page.zoom_config.show_overlay).on_toggle(Message::SetOverlay),
|
||||
))
|
||||
.add(settings::item(
|
||||
&descriptions[increment],
|
||||
widget::dropdown::popup_dropdown(
|
||||
|
|
@ -337,6 +350,26 @@ impl Page {
|
|||
let _ = sender.send(AccessibilityRequest::Magnifier(value));
|
||||
}
|
||||
}
|
||||
Message::SetMouseShortcuts(value) => {
|
||||
self.zoom_config.enable_mouse_zoom_shortcuts = value;
|
||||
|
||||
if let Err(err) = self
|
||||
.accessibility_config
|
||||
.set("accessibility_zoom", self.zoom_config)
|
||||
{
|
||||
error!(?err, "Failed to set config 'accessibility_zoom'");
|
||||
}
|
||||
}
|
||||
Message::SetOverlay(value) => {
|
||||
self.zoom_config.show_overlay = value;
|
||||
|
||||
if let Err(err) = self
|
||||
.accessibility_config
|
||||
.set("accessibility_zoom", self.zoom_config)
|
||||
{
|
||||
error!(?err, "Failed to set config 'accessibility_zoom'");
|
||||
}
|
||||
}
|
||||
Message::SetIncrement(idx) => {
|
||||
self.increment_idx = Some(idx);
|
||||
let value = self.increment_values[idx]
|
||||
|
|
|
|||
|
|
@ -154,6 +154,8 @@ magnifier = Magnifier
|
|||
{$zoom_out} to zoom out,
|
||||
}
|
||||
Super + scroll with your mouse
|
||||
.scroll_controls = Enable "Super + Scroll" (via mouse or touchpad) shortcuts
|
||||
.show_overlay = Show the Magnifier Overlay
|
||||
.increment = Zoom increment
|
||||
.signin = Start magnifier on sign in
|
||||
.applet = Toggle magnifier on/off in applet on the panel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue