chore(client): checkpoint deployed features and unfinished server management
User requested a checkpoint and stopped all agents. Deployed artifacts remain the last verified releases; unfinished settings/categories/forums are preserved as WIP. See TODO/roadmap for verification and remaining release/updater work.
This commit is contained in:
parent
15f03bf8df
commit
f04691c3cd
90 changed files with 9599 additions and 371 deletions
74
patches/i-slint-backend-winit/keyboard_shortcuts.rs
vendored
Normal file
74
patches/i-slint-backend-winit/keyboard_shortcuts.rs
vendored
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
// Copyright © VNOX Contributors
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
/// Translate standard Ctrl shortcuts without replacing normal layout text.
|
||||
/// Latin layouts retain their logical letters (including AZERTY/Dvorak).
|
||||
pub(crate) fn shortcut_letter(
|
||||
logical: &str,
|
||||
physical: Option<char>,
|
||||
control: bool,
|
||||
alt_or_altgr: bool,
|
||||
meta: bool,
|
||||
) -> Option<char> {
|
||||
if !control || alt_or_altgr || meta {
|
||||
return None;
|
||||
}
|
||||
let mut chars = logical.chars();
|
||||
let letter = chars.next()?;
|
||||
if chars.next().is_some() || !letter.is_alphabetic() {
|
||||
return None;
|
||||
}
|
||||
let letter = if letter.is_ascii() {
|
||||
letter.to_ascii_lowercase()
|
||||
} else {
|
||||
physical?
|
||||
};
|
||||
"acvxyzfspr".contains(letter).then_some(letter)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::shortcut_letter;
|
||||
|
||||
#[test]
|
||||
fn russian_control_shortcuts_use_physical_letters() {
|
||||
for (logical, physical) in [("м", 'v'), ("с", 'c'), ("ч", 'x'), ("ф", 'a'), ("я", 'z')]
|
||||
{
|
||||
assert_eq!(
|
||||
shortcut_letter(logical, Some(physical), true, false, false),
|
||||
Some(physical)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ordinary_cyrillic_and_altgr_are_untouched() {
|
||||
assert_eq!(shortcut_letter("м", Some('v'), false, false, false), None);
|
||||
assert_eq!(shortcut_letter("м", Some('v'), true, true, false), None);
|
||||
assert_eq!(shortcut_letter("м", Some('v'), true, false, true), None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn latin_layouts_use_logical_shortcuts_and_ignore_physical_positions() {
|
||||
assert_eq!(
|
||||
shortcut_letter("a", Some('q'), true, false, false),
|
||||
Some('a')
|
||||
);
|
||||
assert_eq!(shortcut_letter("q", Some('a'), true, false, false), None);
|
||||
assert_eq!(
|
||||
shortcut_letter("V", Some('v'), true, false, false),
|
||||
Some('v')
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dead_composed_and_non_letter_keys_are_untouched() {
|
||||
for logical in ["", "´", "éa", "\u{0011}", ";"] {
|
||||
assert_eq!(
|
||||
shortcut_letter(logical, Some('v'), true, false, false),
|
||||
None
|
||||
);
|
||||
}
|
||||
assert_eq!(shortcut_letter("м", None, true, false, false), None);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue