1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-05 05:12:05 -04:00

feat(danklauncher): add launcher history (#2086)

* remember last search query

* add launcherLastQuery SessionSpec

* add rememberLastQuery option

* Add remember last query for appdrawer

* Add query history sessiondata

* Complete and cleanup

* Discard changes to quickshell/Modules/Settings/LauncherTab.qml

* Cleanup logic

* Add rememberLastQuery option

* Add rememberLastQuery option description

* Move setLauncherLastQuery above validation

* Fix logic bug with empty query
This commit is contained in:
Triệu Kha
2026-03-30 20:09:39 +07:00
committed by GitHub
parent 03d2a3fd39
commit 577863b969
9 changed files with 119 additions and 25 deletions

View File

@@ -831,6 +831,15 @@ Item {
checked: SessionData.searchAppActions
onToggled: checked => SessionData.setSearchAppActions(checked)
}
SettingsToggleRow {
settingKey: "rememberLastQuery"
tags: ["launcher", "remember", "last", "search", "query"]
text: I18n.tr("Remember Last Query")
description: I18n.tr("Autofill last remembered query when opened")
checked: SettingsData.rememberLastQuery
onToggled: checked => SettingsData.set("rememberLastQuery", checked)
}
}
SettingsCard {
@@ -1189,17 +1198,11 @@ Item {
if (diffMins < 1)
return I18n.tr("Last launched just now");
if (diffMins < 60)
return diffMins === 1
? I18n.tr("Last launched %1 minute ago").arg(diffMins)
: I18n.tr("Last launched %1 minutes ago").arg(diffMins);
return diffMins === 1 ? I18n.tr("Last launched %1 minute ago").arg(diffMins) : I18n.tr("Last launched %1 minutes ago").arg(diffMins);
if (diffHours < 24)
return diffHours === 1
? I18n.tr("Last launched %1 hour ago").arg(diffHours)
: I18n.tr("Last launched %1 hours ago").arg(diffHours);
return diffHours === 1 ? I18n.tr("Last launched %1 hour ago").arg(diffHours) : I18n.tr("Last launched %1 hours ago").arg(diffHours);
if (diffDays < 7)
return diffDays === 1
? I18n.tr("Last launched %1 day ago").arg(diffDays)
: I18n.tr("Last launched %1 days ago").arg(diffDays);
return diffDays === 1 ? I18n.tr("Last launched %1 day ago").arg(diffDays) : I18n.tr("Last launched %1 days ago").arg(diffDays);
return I18n.tr("Last launched %1").arg(date.toLocaleDateString());
}
font.pixelSize: Theme.fontSizeSmall