mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
launcher: sort by usage frequency
This commit is contained in:
@@ -550,8 +550,8 @@ DankModal {
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
iconName: "dangerous"
|
||||
iconSize: Theme.iconSize - 4
|
||||
iconName: "close"
|
||||
iconSize: Theme.iconSize - 6
|
||||
iconColor: Theme.error
|
||||
hoverColor: Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12)
|
||||
onClicked: {
|
||||
|
||||
@@ -20,7 +20,7 @@ DankModal {
|
||||
}
|
||||
// DankModal configuration
|
||||
visible: settingsVisible
|
||||
width: 650
|
||||
width: 750
|
||||
height: 750
|
||||
keyboardFocus: "ondemand"
|
||||
onBackgroundClicked: {
|
||||
@@ -92,6 +92,7 @@ DankModal {
|
||||
{ text: "Personalization", icon: "person" },
|
||||
{ text: "Time & Weather", icon: "schedule" },
|
||||
{ text: "Widgets", icon: "widgets" },
|
||||
{ text: "Launcher", icon: "apps" },
|
||||
{ text: "Appearance", icon: "palette" }
|
||||
]
|
||||
}
|
||||
@@ -128,7 +129,7 @@ DankModal {
|
||||
}
|
||||
}
|
||||
|
||||
// System Tab
|
||||
// Widgets Tab
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
active: settingsTabBar.currentIndex === 2
|
||||
@@ -139,12 +140,23 @@ DankModal {
|
||||
}
|
||||
}
|
||||
|
||||
// Appearance Tab
|
||||
// Launcher Tab
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
active: settingsTabBar.currentIndex === 3
|
||||
visible: active
|
||||
asynchronous: true
|
||||
sourceComponent: Component {
|
||||
LauncherTab {}
|
||||
}
|
||||
}
|
||||
|
||||
// Appearance Tab
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
active: settingsTabBar.currentIndex === 4
|
||||
visible: active
|
||||
asynchronous: true
|
||||
sourceComponent: Component {
|
||||
AppearanceTab {}
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ DankModal {
|
||||
|
||||
content: Component {
|
||||
Item {
|
||||
id: spotlightKeyHandler
|
||||
anchors.fill: parent
|
||||
focus: true
|
||||
// Handle keyboard shortcuts
|
||||
@@ -115,9 +116,9 @@ DankModal {
|
||||
} else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
|
||||
appLauncher.launchSelected();
|
||||
event.accepted = true;
|
||||
} else if (event.text && event.text.length > 0 && event.text.match(/[a-zA-Z0-9\\s]/)) {
|
||||
searchField.text = event.text;
|
||||
} else if (!searchField.activeFocus && event.text && event.text.length > 0 && event.text.match(/[a-zA-Z0-9\\s]/)) {
|
||||
searchField.forceActiveFocus();
|
||||
searchField.insertText(event.text);
|
||||
event.accepted = true;
|
||||
}
|
||||
}
|
||||
@@ -162,6 +163,8 @@ DankModal {
|
||||
font.pixelSize: Theme.fontSizeLarge
|
||||
enabled: spotlightOpen
|
||||
placeholderText: "Search applications..."
|
||||
ignoreLeftRightKeys: true
|
||||
keyForwardTargets: [spotlightKeyHandler]
|
||||
text: appLauncher.searchQuery
|
||||
onTextEdited: {
|
||||
appLauncher.searchQuery = text;
|
||||
@@ -170,14 +173,14 @@ DankModal {
|
||||
if (event.key === Qt.Key_Escape) {
|
||||
hide();
|
||||
event.accepted = true;
|
||||
} else if ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && appLauncher.searchQuery.length > 0) {
|
||||
// Launch first app when typing in search field
|
||||
if (appLauncher.model.count > 0)
|
||||
} else if ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && text.length > 0) {
|
||||
if (appLauncher.keyboardNavigationActive && appLauncher.model.count > 0) {
|
||||
appLauncher.launchSelected();
|
||||
} else if (appLauncher.model.count > 0) {
|
||||
appLauncher.launchApp(appLauncher.model.get(0));
|
||||
|
||||
}
|
||||
event.accepted = true;
|
||||
} else if (event.key === Qt.Key_Down || event.key === Qt.Key_Up || (event.key === Qt.Key_Left && appLauncher.viewMode === "grid") || (event.key === Qt.Key_Right && appLauncher.viewMode === "grid") || ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && appLauncher.searchQuery.length === 0)) {
|
||||
// Pass navigation keys and enter (when not searching) to main handler
|
||||
} else if (event.key === Qt.Key_Down || event.key === Qt.Key_Up || event.key === Qt.Key_Left || event.key === Qt.Key_Right || ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && text.length === 0)) {
|
||||
event.accepted = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user