RibbonComponents: RibbonComboBox and RibonTextEdit property added.
1.RibbonComboBox:due to default width property can't modify component's width, added component_width and component_height property to fix it. 2.RibbonTextEdit:add more alias property in order to improve experience.
This commit is contained in:
parent
3247617562
commit
635cf04179
|
@ -6,6 +6,8 @@ ComboBox {
|
||||||
id: control
|
id: control
|
||||||
property bool dark_mode: RibbonTheme.dark_mode
|
property bool dark_mode: RibbonTheme.dark_mode
|
||||||
property int icon_source
|
property int icon_source
|
||||||
|
property int component_width: 150
|
||||||
|
property int component_height:20
|
||||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||||
implicitContentWidth + leftPadding + rightPadding)
|
implicitContentWidth + leftPadding + rightPadding)
|
||||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||||
|
@ -69,8 +71,8 @@ ComboBox {
|
||||||
|
|
||||||
contentItem: RibbonLineEdit {
|
contentItem: RibbonLineEdit {
|
||||||
id: edit
|
id: edit
|
||||||
leftPadding: (!control.mirrored ? 12 : control.editable && activeFocus ? 3 : 1) + icon.visible ? icon.contentWidth + padding*2 : 0
|
leftPadding: (!control.mirrored ? 12 : control.editable && activeFocus ? 3 : 1) + (icon.visible ? icon.contentWidth + padding*2 : 0)
|
||||||
rightPadding: (control.mirrored ? 12 : control.editable && activeFocus ? 3 : 1) + clear_btn.visible ? clear_btn.width + padding*2 : 0
|
rightPadding: (control.mirrored ? 12 : control.editable && activeFocus ? 3 : 1) + (clear_btn.visible ? clear_btn.width + padding*2 : 0)
|
||||||
topPadding: 6 - control.padding
|
topPadding: 6 - control.padding
|
||||||
bottomPadding: 6 - control.padding
|
bottomPadding: 6 - control.padding
|
||||||
|
|
||||||
|
@ -100,8 +102,8 @@ ComboBox {
|
||||||
background: Rectangle{
|
background: Rectangle{
|
||||||
visible: control.enabled && control.editable && !control.flat
|
visible: control.enabled && control.editable && !control.flat
|
||||||
radius: 4
|
radius: 4
|
||||||
implicitHeight: 20
|
implicitHeight: control.component_height
|
||||||
implicitWidth: 140
|
implicitWidth: control.component_width-10
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
|
@ -113,8 +115,8 @@ ComboBox {
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
implicitWidth: 150
|
implicitWidth: control.component_width
|
||||||
implicitHeight: 20
|
implicitHeight: control.component_height
|
||||||
radius: 4
|
radius: 4
|
||||||
color: {
|
color: {
|
||||||
color: {
|
color: {
|
||||||
|
|
|
@ -9,6 +9,8 @@ Item{
|
||||||
property alias icon_source: textedit.icon_source
|
property alias icon_source: textedit.icon_source
|
||||||
property alias show_clear_btn: textedit.show_clear_btn
|
property alias show_clear_btn: textedit.show_clear_btn
|
||||||
property alias textedit: textedit
|
property alias textedit: textedit
|
||||||
|
property alias placeholderText: textedit.placeholderText
|
||||||
|
property alias readOnly: textedit.readOnly
|
||||||
property int max_height: 80
|
property int max_height: 80
|
||||||
property bool dark_mode: RibbonTheme.dark_mode
|
property bool dark_mode: RibbonTheme.dark_mode
|
||||||
signal commit()
|
signal commit()
|
||||||
|
|
Loading…
Reference in New Issue