Thanks Nate!!
I’ve implemented the feature but changed only FolderView, made it configurable there under the Icons configuration. Can you review it?
Created merge request in invent but can not paste link in post so: plasma/plasma-desktop/-/merge_requests/3599
I’ve tested it against my environment and works fine but as I do not have a Master branch up to date environment I’d need help for testing.
What I did was
# Create the local directory
mkdir -p ~/.local/share/plasma/plasmoids/
cp -r /usr/share/plasma/plasmoids/org.kde.desktopcontainment ~/.local/share/plasma/plasmoids/
For Testing:
rm -rf ~/.cache/plasmashell/qmlcache/*
plasmashell --replace &
/home/administrador/.local/share/plasma/plasmoids/org.kde.desktopcontainment/contents/ui/FolderView.qml
//Replaced function Keys.onPressed adding icon handling (in master code is upgrades but change is basically the same)
// Properties for Dolphin-style type-ahead search
property string searchString: “”
Timer {
id: typeAheadTimer
interval: 1000 // Resets search string after 1 second of inactivity
onTriggered: gridView.searchString = “”
}
Keys.onPressed: function(event) {
// We don’t set event.accepted = true globally anymore.
// We only accept it if we actually use the key.
// 1. Handle Standard shortcuts (Control, Shift, etc.)
if (event.key === Qt.Key_Control) {
event.accepted = true;
ctrlPressed = true;
} else if (event.key === Qt.Key_Shift) {
event.accepted = true;
shiftPressed = true;
if (currentIndex !== -1) { anchorIndex = currentIndex; }
} else if (event.key === Qt.Key_Home) {
event.accepted = true;
currentIndex = 0;
updateSelection(event.modifiers);
} else if (event.key === Qt.Key_End) {
event.accepted = true;
currentIndex = count - 1;
updateSelection(event.modifiers);
} else if (event.matches(StandardKey.Copy)) {
event.accepted = true;
dir.copy();
} else if (event.matches(StandardKey.Paste)) {
event.accepted = true;
dir.paste();
} else if (event.matches(StandardKey.Cut)) {
event.accepted = true;
dir.cut();
} else if (event.matches(StandardKey.SelectAll)) {
event.accepted = true;
positioner.setRangeSelected(0, count - 1);
}
// 2. Handle Type-Ahead Logic
else if (event.text.length === 1 && event.modifiers === Qt.NoModifier) {
// CONFIG CHECK: If disabled, let the event pass through to KRunner
if (!Plasmoid.configuration.useTypeAhead) {
event.accepted = false;
return;
}
// If enabled, we “consume” the event so KRunner doesn’t see it
event.accepted = true;
typeAheadTimer.restart();
var charPressed = event.text.toLowerCase();
// Sequence search logic
if (searchString.length >= 1 && searchString.indexOf(charPressed) !== 0) {
searchString += charPressed;
} else if (searchString !== charPressed) {
searchString = charPressed;
}
var matches = [];
for (var i = 0; i < gridView.count; i++) {
var itemData = positioner.data(positioner.index(i, 0), Qt.DisplayRole);
if (itemData && itemData.toLowerCase().indexOf(searchString) === 0) {
matches.push(i);
}
}
if (matches.length > 0) {
var nextIdx = matches[0];
if (searchString.length === 1) {
for (var j = 0; j < matches.length; j++) {
if (matches[j] > gridView.currentIndex) {
nextIdx = matches[j];
break;
}
}
}
currentIndex = nextIdx;
dir.clearSelection();
dir.setSelected(positioner.map(nextIdx));
} else {
searchString = charPressed;
}
}
// 3. Fallback for everything else (Escape, Enter, etc.)
else {
event.accepted = false;
}
}
/home/administrador/.local/share/plasma/plasmoids/org.kde.desktopcontainment/contents/config/main.xml
Inside the section, add the following:
Use type-ahead to select desktop icons in Folder View.
true
/usr/share/plasma/plasmoids/org.kde.desktopcontainment/contents/ui/ConfigIcons.qml
A. Add the alias (top of the file)
Find the long list of property alias lines (around line 30) and add this one:
property alias cfg_useTypeAhead: useTypeAhead.checked
B. Add the CheckBox (near the bottom)
Scroll down to the “Features section” (around line 245). I recommend placing it right after the Popup checkbox so it’s grouped with other interaction behaviors:
// — ADD THIS BLOCK —
Item {
Kirigami.FormData.isSection: true
}
CheckBox {
id: useTypeAhead
Kirigami.FormData.label: i18n(“Keyboard Navigation:”)
text: i18n(“Enable type-ahead search (disables KRunner)”)
}
// ----------------------