Skip to content

Commit 07c2f25

Browse files
committed
Qt: fix show/hide password icon
Use the same code as for the fluent style
1 parent 9b736e2 commit 07c2f25

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

internal/compiler/widgets/qt/lineedit.slint

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,16 @@ export component LineEdit {
9191
}
9292
}
9393

94-
if root.input-type == InputType.password: LineEditPasswordIcon {
94+
if root.input-type == InputType.password && !root.text.is-empty && root.has-focus: LineEditPasswordIcon {
9595
width: self.source.width * 1px;
9696
show-password-image: @image-url("_visibility.svg");
9797
hide-password-image: @image-url("_visibility_off.svg");
9898
colorize: inner.text-color;
99-
height: inner.min-height;
100-
image-fit: preserve;
99+
show-password: inner.input-type != InputType.password;
101100
show-password-changed(show) => {
102101
inner.input-type = show ? InputType.text : root.input-type;
103102
inner.focus();
104103
}
105104
}
106-
107-
108105
}
109106
}

0 commit comments

Comments
 (0)