Skip to content

Commit

Permalink
Fix rendering of LineEdit's placeholder text
Browse files Browse the repository at this point in the history
Use the same font attributes as for the inner `TextInput`.

Fixes #2829
  • Loading branch information
tronical committed Jun 6, 2023
1 parent 16a93ed commit 3961b44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -21,6 +21,7 @@ All notable changes to this project are documented in this file.
- Added `select-all()`, `cut()`, `copy()`, and `paste() to `TextInput`, `LineEdit`, and `TextEdit`.
- Added functions on color: `transparentize`, `mix`, and `with-alpha`.
- Added a `close()` function and a `close-on-click` boolean property to `PopupWindow`.
- Fixed `LineEdit`'s placeholder text not being rendered with the same font attributes as regular `LineEdit` text.

### Rust

Expand Down
4 changes: 4 additions & 0 deletions internal/compiler/widgets/common/common.slint
Expand Up @@ -38,6 +38,10 @@ export component LineEditInner inherits Rectangle {
height: 100%; width: 100%;
vertical-alignment: center;
text: (root.text == "" && input.preedit-text == "") ? root.placeholder-text : "";
font-size: input.font-size;
font-italic: input.font-italic;
font-weight: input.font-weight;
font-family: input.font-family;
}
input := TextInput {
property <length> computed_x;
Expand Down

0 comments on commit 3961b44

Please sign in to comment.