Keyboard based nav no longer reveals password layout

This commit is contained in:
CanadianBaconBoi 2026-05-08 21:42:42 +02:00
parent defe26acc3
commit 4c7bd2694f
2 changed files with 18 additions and 1 deletions

View File

@ -34,7 +34,6 @@ reqwest = { version = "0.13.3", features = ["json", "default-tls"] }
magick_rust = "2.0.0"
[build-dependencies]
#slint-build = "1.16.1"
slint-build = { git = "https://github.com/slint-ui/slint", branch = "master" }

View File

@ -140,6 +140,24 @@ export component LineEditBase implements LineEditInterface inherits Rectangle {
}
key-pressed(event) => {
if (!root.password-revealed && event.modifiers.control) { // Don't reveal the delimiter positions in the password if it's hidden
if (event.text == Key.LeftArrow) {
if (event.modifiers.shift) {
self.set-selection-offsets(0, self.cursor-position-byte-offset);
} else {
self.set-selection-offsets(0, 0);
}
return accept;
}
if (event.text == Key.RightArrow) {
if (event.modifiers.shift) {
self.set-selection-offsets(self.cursor-position-byte-offset, self.text.character-count);
} else {
self.set-selection-offsets(self.text.character-count, self.text.character-count);
}
return accept;
}
}
root.key-pressed(event)
}