slint/sixtyfps_compiler/widgets/native/sixtyfps_widgets.60
Olivier Goffart 315fd7a881 Start doing a ScrollArea element
Unfortunately something is wrong with the Qt style, it looks like the Qt style
does not respect the rect given for the sub components

Also Input is not handled yet.
2020-09-22 20:05:41 +02:00

54 lines
No EOL
1.8 KiB
Text

/* LICENSE BEGIN
This file is part of the SixtyFPS Project -- https://sixtyfps.io
Copyright (c) 2020 Olivier Goffart <olivier.goffart@sixtyfps.io>
Copyright (c) 2020 Simon Hausmann <simon.hausmann@sixtyfps.io>
SPDX-License-Identifier: GPL-3.0-only
This file is also available under commercial licensing terms.
Please contact info@sixtyfps.io for more information.
LICENSE END */
// FIXME: the font_size should be removed but is required right now to compile the printer_demo
export Button := NativeButton { property<length> font_size; }
export CheckBox := NativeCheckBox { }
export SpinBox := NativeSpinBox { property<length> font_size; }
export Slider := NativeSlider { max:100; }
export GroupBox := NativeGroupBox {
GridLayout {
padding_left: root.native_padding_left;
padding_right: root.native_padding_right;
padding_top: root.native_padding_top;
padding_bottom: root.native_padding_bottom;
$children
}
}
export LineEdit := NativeLineEdit {
property <string> text;
property <bool> focused: true;
property <string> accepted_text: input.text; // FIXME: remove when we can do two-way bindings
signal accepted(string);
GridLayout {
padding_left: root.native_padding_left;
padding_right: root.native_padding_right;
padding_top: root.native_padding_top;
padding_bottom: root.native_padding_bottom;
input := TextInput {
text: root.text;
accepted => {
root.accepted(self.text);
}
}
}
}
export ScrollArea := NativeScrollArea {
viewport_x: f.viewport_x;
viewport_y: f.viewport_y;
f:= Flickable {
width: parent.width;
height: parent.height;
viewport_width: parent.viewport_width;
viewport_height: parent.viewport_height;
$children
}
}