From f7c45acc262512877c46cadd454b846cbdf647b4 Mon Sep 17 00:00:00 2001 From: purian23 Date: Wed, 3 Sep 2025 20:56:41 -0400 Subject: [PATCH] Update notepad text input --- Modals/FileBrowser/FileBrowserModal.qml | 8 +++++--- Widgets/DankTextField.qml | 18 +++++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Modals/FileBrowser/FileBrowserModal.qml b/Modals/FileBrowser/FileBrowserModal.qml index 36a5a406..65a4f94c 100644 --- a/Modals/FileBrowser/FileBrowserModal.qml +++ b/Modals/FileBrowser/FileBrowserModal.qml @@ -346,7 +346,7 @@ DankModal { DankActionButton { circular: false - iconName: "help" + iconName: "info" iconSize: Theme.iconSize - 4 iconColor: Theme.surfaceText onClicked: fileBrowserModal.showKeyboardHints = !fileBrowserModal.showKeyboardHints @@ -567,11 +567,13 @@ DankModal { id: fileNameInput width: parent.width - saveButton.width - Theme.spacingM - height: 36 + height: 40 text: defaultFileName placeholderText: "Enter filename..." ignoreLeftRightKeys: false focus: saveMode + topPadding: Theme.spacingS + bottomPadding: Theme.spacingS Component.onCompleted: { if (saveMode) Qt.callLater(() => { @@ -591,7 +593,7 @@ DankModal { id: saveButton width: 80 - height: 36 + height: 40 color: fileNameInput.text.trim() !== "" ? Theme.primary : Theme.surfaceVariant radius: Theme.cornerRadius diff --git a/Widgets/DankTextField.qml b/Widgets/DankTextField.qml index 7ef33f92..72165217 100644 --- a/Widgets/DankTextField.qml +++ b/Widgets/DankTextField.qml @@ -95,17 +95,25 @@ StyledRect { onActiveFocusChanged: root.focusStateChanged(activeFocus) Keys.forwardTo: root.ignoreLeftRightKeys ? root.keyForwardTargets : [] Keys.onLeftPressed: event => { - if (root.ignoreLeftRightKeys) - event.accepted = true + if (root.ignoreLeftRightKeys) { + event.accepted = true + } else { + // Allow normal TextInput cursor movement + event.accepted = false + } } Keys.onRightPressed: event => { - if (root.ignoreLeftRightKeys) - event.accepted = true + if (root.ignoreLeftRightKeys) { + event.accepted = true + } else { + // Allow normal TextInput cursor movement + event.accepted = false + } } MouseArea { anchors.fill: parent - hoverEnabled: true + hoverEnabled: true cursorShape: Qt.IBeamCursor acceptedButtons: Qt.NoButton }