diff --git a/Cargo.toml b/Cargo.toml index 0bda752..115e9f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } diff --git a/ui/widgets/common/lineedit-base.slint b/ui/widgets/common/lineedit-base.slint index 39c19f6..01bbd98 100644 --- a/ui/widgets/common/lineedit-base.slint +++ b/ui/widgets/common/lineedit-base.slint @@ -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) }