slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.93k stars 566 forks source link

QPainter rendered LineEdit does not respect horizontal alignment #2524

Closed tronical closed 1 year ago

tronical commented 1 year ago

Discussed in https://github.com/slint-ui/slint/discussions/2513

Originally posted by **peterjc123** April 9, 2023 I tried something below. The preview looks good but it just doesn't work when the program is actually built. ``` LineEdit { height: 50px; placeholder-text: "Some random text"; horizontal-alignment: center; } ``` Platform: ArchLinux, Gnome 43, GDM Slint version: 1.0.0 Toolchain: Rust 1.68.2
tronical commented 1 year ago

Smaller test-case that renders text left-aligned when entered:

export component App inherits Window {
    preferred-width: 300px;
    preferred-height: 200px;
    TextInput {
        height: 50px;
        horizontal-alignment: center;
    }
}