mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-23 09:19:32 +00:00
[LineEdit] add font-italic support
This commit is contained in:
parent
a9b790366a
commit
30429d9058
8 changed files with 18 additions and 0 deletions
|
|
@ -43,6 +43,11 @@ The size of the font of the input text
|
|||
The font family of the input text
|
||||
</SlintProperty>
|
||||
|
||||
### font-italic
|
||||
<SlintProperty propName="font-italic" typeName="bool" defaultValue="false">
|
||||
The italic state of the font of the input text
|
||||
</SlintProperty>
|
||||
|
||||
### has-focus
|
||||
<SlintProperty propName="has-focus" typeName="bool" propertyVisibility="out">
|
||||
Set to true when the line edit currently has the focus
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ export component LineEditBase inherits Rectangle {
|
|||
in property <string> placeholder-text;
|
||||
in property <length> font-size <=> text-input.font-size;
|
||||
in property <string> font-family <=> text-input.font-family;
|
||||
in property <bool> font-italic <=> text-input.font-italic;
|
||||
in-out property <string> text <=> text-input.text;
|
||||
in-out property <brush> placeholder-color;
|
||||
in property <bool> enabled <=> text-input.enabled;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ export component LineEdit {
|
|||
in property <InputType> input-type;
|
||||
in property <TextHorizontalAlignment> horizontal-alignment <=> base.horizontal-alignment;
|
||||
in property <bool> read-only <=> base.read-only;
|
||||
in property <bool> font-italic <=> base.font-italic;
|
||||
in property <string> font-family <=> base.font-family;
|
||||
in property <length> font-size <=> base.font-size;
|
||||
in property <string> placeholder-text <=> base.placeholder-text;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ export component LineEdit {
|
|||
in property <TextHorizontalAlignment> horizontal-alignment <=> base.horizontal-alignment;
|
||||
in property <bool> read-only <=> base.read-only;
|
||||
in property <length> font-size <=> base.font-size;
|
||||
in property <bool> font-italic <=> base.font-italic;
|
||||
in property <string> font-family <=> base.font-family;
|
||||
in property <string> placeholder-text <=> base.placeholder-text;
|
||||
out property <bool> has-focus <=> base.has-focus;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ export component LineEdit {
|
|||
in property <bool> read-only <=> base.read-only;
|
||||
in property <length> font-size <=> base.font-size;
|
||||
in property <string> font-family <=> base.font-family;
|
||||
in property <bool> font-italic <=> base.font-italic;
|
||||
in property <string> placeholder-text <=> base.placeholder-text;
|
||||
out property <bool> has-focus <=> base.has-focus;
|
||||
in-out property <string> text <=> base.text;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { LineEditBase, LineEditClearIcon, LineEditPasswordIcon } from "../common
|
|||
export component LineEdit {
|
||||
in property <length> font-size <=> base.font-size;
|
||||
in property <string> font-family <=> base.font-family;
|
||||
in property <bool> font-italic <=> base.font-italic;
|
||||
in property <string> placeholder-text <=> base.placeholder-text;
|
||||
in property <bool> enabled <=> base.enabled;
|
||||
in property <InputType> input-type;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ export component LineEdit {
|
|||
in property <length> font-size <=> inner.font-size;
|
||||
in property <string> font-family <=> inner.font-family;
|
||||
in property <string> placeholder-text <=> inner.placeholder-text;
|
||||
in property <bool> font-italic <=> inner.font-italic;
|
||||
in property <InputType> input-type;
|
||||
in property horizontal-alignment <=> inner.horizontal-alignment;
|
||||
in property read-only <=> inner.read-only;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export component TestCase inherits Window {
|
|||
in-out property <string> text <=> edit1.text;
|
||||
in-out property <bool> read-only <=> edit1.read-only;
|
||||
in-out property <bool> enabled <=> edit1.enabled;
|
||||
in-out property <bool> font-italic <=> edit1.font-italic;
|
||||
in-out property <string> font-family <=> edit1.font-family;
|
||||
public function select-all() {
|
||||
edit1.select-all();
|
||||
|
|
@ -65,6 +66,12 @@ assert_eq!(instance.get_text(), "Hello👋");
|
|||
instance.set_font_family("sans-sherif".into());
|
||||
assert_eq!(instance.get_font_family(), "sans-sherif");
|
||||
|
||||
// Font Italic
|
||||
assert_eq!(instance.get_font_italic(), false);
|
||||
instance.set_font_italic(true);
|
||||
assert_eq!(instance.get_font_italic(), true);
|
||||
|
||||
|
||||
```
|
||||
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue