NInputAction simplification

This commit is contained in:
LemmyCook 2025-09-05 14:19:08 -04:00
parent f04ac180f0
commit 125d844e3b
2 changed files with 27 additions and 32 deletions

View file

@ -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 {

View file

@ -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()
}
} }
} }
} }