fix(input): remember "draw with the finger", on by default on Android (Issue #50)
The setting was never saved and always started off, so one finger only moved the page after every start. On a phone without a pen nothing could be written until it was switched on again, and an update restarts the app. It is now saved with the other UI settings and starts on on Android, where phones usually have no pen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
298932cb32
commit
0d9e9aa2ea
3 files changed
+28
-7
No files matched your search
@@ -234,6 +234,9 @@ pub struct UiSettings {
|
||||
pub storage_dir: Option<PathBuf>,
|
||||
/// Compute handwritten math after `=` (Issue #46)
|
||||
pub math_assist: bool,
|
||||
/// One finger draws instead of moving the page. On by default on Android, where phones
|
||||
/// usually have no pen (Issue #50)
|
||||
pub touch_draw: bool,
|
||||
}
|
||||
|
||||
impl Default for UiSettings {
|
||||
@@ -256,6 +259,7 @@ impl Default for UiSettings {
|
||||
eraser_radius_mm: 3.0,
|
||||
storage_dir: None,
|
||||
math_assist: false,
|
||||
touch_draw: cfg!(target_os = "android"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -354,6 +358,7 @@ mod tests {
|
||||
eraser_radius_mm: 6.0,
|
||||
storage_dir: Some(PathBuf::from("/home/pia/Nextcloud/ink-notes")),
|
||||
math_assist: true,
|
||||
touch_draw: true,
|
||||
};
|
||||
settings.save_to(&path).unwrap();
|
||||
assert_eq!(UiSettings::load_from(&path), settings);
|
||||
|
||||
Reference in new issue
Block a user