mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-13 00:42:49 -05:00
Focus text inputs by default
This commit is contained in:
@@ -149,6 +149,9 @@ PanelWindow {
|
||||
searchField.enabled = true;
|
||||
searchDebounceTimer.stop(); // Stop any pending search
|
||||
updateFilteredModel();
|
||||
Qt.callLater(function() {
|
||||
searchField.forceActiveFocus();
|
||||
});
|
||||
}
|
||||
|
||||
function hide() {
|
||||
|
||||
@@ -14,6 +14,7 @@ DankModal {
|
||||
property var clipboardEntries: []
|
||||
|
||||
property string searchText: ""
|
||||
property bool shouldFocusSearch: false
|
||||
|
||||
function updateFilteredModel() {
|
||||
filteredClipboardModel.clear();
|
||||
@@ -118,6 +119,7 @@ DankModal {
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
refreshClipboard();
|
||||
shouldFocusSearch = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,12 +196,24 @@ DankModal {
|
||||
clipboardHistory.searchText = text;
|
||||
updateFilteredModel();
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: clipboardHistory
|
||||
function onShouldFocusSearchChanged() {
|
||||
if (shouldFocusSearch) {
|
||||
Qt.callLater(function() {
|
||||
searchField.forceActiveFocus();
|
||||
shouldFocusSearch = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Clipboard entries list
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: parent.height - 100
|
||||
height: parent.height - 110
|
||||
radius: Theme.cornerRadius
|
||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.1)
|
||||
clip: true
|
||||
@@ -280,8 +294,6 @@ DankModal {
|
||||
onClicked: copyEntry(model.entry)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
text: "No clipboard entries found"
|
||||
anchors.centerIn: parent
|
||||
@@ -291,6 +303,7 @@ DankModal {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user