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
|
||||
ColumnLayout {
|
||||
spacing: Style.marginS * scaling
|
||||
spacing: Style.marginM * scaling
|
||||
Layout.fillWidth: true
|
||||
|
||||
NLabel {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ import QtQuick.Layouts
|
|||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
// Input and button row
|
||||
RowLayout {
|
||||
id: root
|
||||
|
||||
// Public properties
|
||||
|
|
@ -21,41 +22,35 @@ ColumnLayout {
|
|||
|
||||
// Internal properties
|
||||
property real scaling: 1.0
|
||||
spacing: Style.marginM * scaling
|
||||
|
||||
// Input and button row
|
||||
RowLayout {
|
||||
spacing: Style.marginM * scaling
|
||||
NTextInput {
|
||||
id: textInput
|
||||
label: root.label
|
||||
description: root.description
|
||||
placeholderText: root.placeholderText
|
||||
text: root.text
|
||||
onEditingFinished: {
|
||||
root.text = text
|
||||
root.editingFinished()
|
||||
}
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
id: textInput
|
||||
label: root.label
|
||||
description: root.description
|
||||
placeholderText: root.placeholderText
|
||||
text: root.text
|
||||
onEditingFinished: {
|
||||
root.text = text
|
||||
root.editingFinished()
|
||||
}
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
NButton {
|
||||
Layout.fillWidth: false
|
||||
Layout.alignment: Qt.AlignBottom
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
text: root.actionButtonText
|
||||
icon: root.actionButtonIcon
|
||||
backgroundColor: Color.mSecondary
|
||||
textColor: Color.mOnSecondary
|
||||
hoverColor: Color.mTertiary
|
||||
pressColor: Color.mPrimary
|
||||
enabled: root.actionButtonEnabled
|
||||
|
||||
NButton {
|
||||
text: root.actionButtonText
|
||||
icon: root.actionButtonIcon
|
||||
backgroundColor: Color.mSecondary
|
||||
textColor: Color.mOnSecondary
|
||||
hoverColor: Color.mTertiary
|
||||
pressColor: Color.mPrimary
|
||||
enabled: root.actionButtonEnabled
|
||||
Layout.fillWidth: false
|
||||
onClicked: {
|
||||
root.actionClicked()
|
||||
}
|
||||
onClicked: {
|
||||
root.actionClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue