mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
Add support for a font-metrics property to Text/TextInput. (#6452)
The struct held provides access to the design metrics of the font scaled to the font pixel size used by the element. ChangeLog: Slint Language: Added font-metrics property to `Text` and `TextInput`. Closes #6047
This commit is contained in:
parent
b41b389e55
commit
0b028bfb6f
36 changed files with 742 additions and 55 deletions
|
@ -11,7 +11,8 @@ use std::rc::Rc;
|
|||
|
||||
use crate::expression_tree::{BuiltinFunction, Expression};
|
||||
use crate::langtype::{
|
||||
BuiltinElement, BuiltinPropertyInfo, DefaultSizeBinding, ElementType, NativeClass, Type,
|
||||
BuiltinElement, BuiltinPropertyDefault, BuiltinPropertyInfo, DefaultSizeBinding, ElementType,
|
||||
NativeClass, Type,
|
||||
};
|
||||
use crate::object_tree::{self, *};
|
||||
use crate::parser::{identifier_text, syntax_nodes, SyntaxKind, SyntaxNode};
|
||||
|
@ -93,7 +94,7 @@ pub(crate) fn load_builtins(register: &mut TypeRegister) {
|
|||
|
||||
if let Some(e) = p.BindingExpression() {
|
||||
let ty = info.ty.clone();
|
||||
info.default_value = Some(compiled(e, register, ty));
|
||||
info.default_value = BuiltinPropertyDefault::Expr(compiled(e, register, ty));
|
||||
}
|
||||
|
||||
(prop_name, info)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue