From 125d844e3b94ecd7f11dbb769c529b662f039a91 Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Fri, 5 Sep 2025 14:19:08 -0400 Subject: [PATCH] NInputAction simplification --- Modules/SettingsPanel/Tabs/HooksTab.qml | 2 +- Widgets/NInputAction.qml | 57 +++++++++++-------------- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/Modules/SettingsPanel/Tabs/HooksTab.qml b/Modules/SettingsPanel/Tabs/HooksTab.qml index 195844c..9f08a15 100644 --- a/Modules/SettingsPanel/Tabs/HooksTab.qml +++ b/Modules/SettingsPanel/Tabs/HooksTab.qml @@ -81,7 +81,7 @@ ScrollView { // Info section ColumnLayout { - spacing: Style.marginS * scaling + spacing: Style.marginM * scaling Layout.fillWidth: true NLabel { diff --git a/Widgets/NInputAction.qml b/Widgets/NInputAction.qml index d439551..785b5b0 100644 --- a/Widgets/NInputAction.qml +++ b/Widgets/NInputAction.qml @@ -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() } } }