NInputAction simplification
This commit is contained in:
parent
f04ac180f0
commit
125d844e3b
2 changed files with 27 additions and 32 deletions
|
|
@ -81,7 +81,7 @@ ScrollView {
|
||||||
|
|
||||||
// Info section
|
// Info section
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: Style.marginS * scaling
|
spacing: Style.marginM * scaling
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
NLabel {
|
NLabel {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@ import QtQuick.Layouts
|
||||||
import qs.Commons
|
import qs.Commons
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
ColumnLayout {
|
// Input and button row
|
||||||
|
RowLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
// Public properties
|
// Public properties
|
||||||
|
|
@ -21,41 +22,35 @@ ColumnLayout {
|
||||||
|
|
||||||
// Internal properties
|
// Internal properties
|
||||||
property real scaling: 1.0
|
property real scaling: 1.0
|
||||||
|
spacing: Style.marginM * scaling
|
||||||
|
|
||||||
// Input and button row
|
NTextInput {
|
||||||
RowLayout {
|
id: textInput
|
||||||
spacing: Style.marginM * scaling
|
label: root.label
|
||||||
|
description: root.description
|
||||||
|
placeholderText: root.placeholderText
|
||||||
|
text: root.text
|
||||||
|
onEditingFinished: {
|
||||||
|
root.text = text
|
||||||
|
root.editingFinished()
|
||||||
|
}
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
NTextInput {
|
NButton {
|
||||||
id: textInput
|
Layout.fillWidth: false
|
||||||
label: root.label
|
Layout.alignment: Qt.AlignBottom
|
||||||
description: root.description
|
|
||||||
placeholderText: root.placeholderText
|
|
||||||
text: root.text
|
|
||||||
onEditingFinished: {
|
|
||||||
root.text = text
|
|
||||||
root.editingFinished()
|
|
||||||
}
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
text: root.actionButtonText
|
||||||
Layout.fillWidth: true
|
icon: root.actionButtonIcon
|
||||||
}
|
backgroundColor: Color.mSecondary
|
||||||
|
textColor: Color.mOnSecondary
|
||||||
|
hoverColor: Color.mTertiary
|
||||||
|
pressColor: Color.mPrimary
|
||||||
|
enabled: root.actionButtonEnabled
|
||||||
|
|
||||||
NButton {
|
onClicked: {
|
||||||
text: root.actionButtonText
|
root.actionClicked()
|
||||||
icon: root.actionButtonIcon
|
|
||||||
backgroundColor: Color.mSecondary
|
|
||||||
textColor: Color.mOnSecondary
|
|
||||||
hoverColor: Color.mTertiary
|
|
||||||
pressColor: Color.mPrimary
|
|
||||||
enabled: root.actionButtonEnabled
|
|
||||||
Layout.fillWidth: false
|
|
||||||
onClicked: {
|
|
||||||
root.actionClicked()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue