mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
launcher: add sort by alphabetically option
sounds: convert files to wav
This commit is contained in:
@@ -97,6 +97,7 @@ Singleton {
|
||||
property alias dankBarRightWidgetsModel: rightWidgetsModel
|
||||
property string appLauncherViewMode: "list"
|
||||
property string spotlightModalViewMode: "list"
|
||||
property bool sortAppsAlphabetically: false
|
||||
property string networkPreference: "auto"
|
||||
property string iconTheme: "System Default"
|
||||
property var availableIconThemes: ["System Default"]
|
||||
@@ -376,6 +377,7 @@ Singleton {
|
||||
}
|
||||
appLauncherViewMode = settings.appLauncherViewMode !== undefined ? settings.appLauncherViewMode : "list"
|
||||
spotlightModalViewMode = settings.spotlightModalViewMode !== undefined ? settings.spotlightModalViewMode : "list"
|
||||
sortAppsAlphabetically = settings.sortAppsAlphabetically !== undefined ? settings.sortAppsAlphabetically : false
|
||||
networkPreference = settings.networkPreference !== undefined ? settings.networkPreference : "auto"
|
||||
iconTheme = settings.iconTheme !== undefined ? settings.iconTheme : "System Default"
|
||||
if (settings.useOSLogo !== undefined) {
|
||||
@@ -529,6 +531,7 @@ Singleton {
|
||||
"dankBarRightWidgets": dankBarRightWidgets,
|
||||
"appLauncherViewMode": appLauncherViewMode,
|
||||
"spotlightModalViewMode": spotlightModalViewMode,
|
||||
"sortAppsAlphabetically": sortAppsAlphabetically,
|
||||
"networkPreference": networkPreference,
|
||||
"iconTheme": iconTheme,
|
||||
"launcherLogoMode": launcherLogoMode,
|
||||
@@ -1009,6 +1012,11 @@ Singleton {
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
function setSortAppsAlphabetically(enabled) {
|
||||
sortAppsAlphabetically = enabled
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
// Weather location setter
|
||||
function setWeatherLocation(displayName, coordinates) {
|
||||
weatherLocation = displayName
|
||||
|
||||
@@ -49,6 +49,13 @@ Item {
|
||||
function onPluginListUpdated() { updateCategories() }
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: SettingsData
|
||||
function onSortAppsAlphabeticallyChanged() {
|
||||
updateFilteredModel()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function updateFilteredModel() {
|
||||
@@ -123,6 +130,11 @@ Item {
|
||||
}
|
||||
|
||||
if (searchQuery.length === 0) {
|
||||
if (SettingsData.sortAppsAlphabetically) {
|
||||
apps = apps.sort((a, b) => {
|
||||
return (a.name || "").localeCompare(b.name || "")
|
||||
})
|
||||
} else {
|
||||
apps = apps.sort((a, b) => {
|
||||
const aId = a.id || a.execString || a.exec || ""
|
||||
const bId = b.id || b.execString || b.exec || ""
|
||||
@@ -134,6 +146,7 @@ Item {
|
||||
return (a.name || "").localeCompare(b.name || "")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const seenNames = new Set()
|
||||
const uniqueApps = []
|
||||
|
||||
@@ -457,6 +457,71 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: sortingSection.implicitHeight + Theme.spacingL * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
||||
Theme.outline.b, 0.2)
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
id: sortingSection
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.spacingL
|
||||
spacing: Theme.spacingM
|
||||
|
||||
Row {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingM
|
||||
|
||||
DankIcon {
|
||||
name: "sort_by_alpha"
|
||||
size: Theme.iconSize
|
||||
color: Theme.primary
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Sort Alphabetically")
|
||||
font.pixelSize: Theme.fontSizeLarge
|
||||
font.weight: Font.Medium
|
||||
color: Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Item {
|
||||
width: parent.width - parent.children[0].width
|
||||
- parent.children[1].width
|
||||
- sortToggle.width - Theme.spacingM * 3
|
||||
height: 1
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
id: sortToggle
|
||||
|
||||
width: 32
|
||||
height: 18
|
||||
checked: SettingsData.sortAppsAlphabetically
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onToggled: checked => {
|
||||
SettingsData.setSortAppsAlphabetically(checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
width: parent.width
|
||||
text: I18n.tr("When enabled, apps are sorted alphabetically. When disabled, apps are sorted by usage frequency.")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: recentlyUsedSection.implicitHeight + Theme.spacingL * 2
|
||||
|
||||
@@ -61,7 +61,7 @@ Singleton {
|
||||
import QtQuick
|
||||
import QtMultimedia
|
||||
MediaPlayer {
|
||||
source: Qt.resolvedUrl("../assets/sounds/freedesktop/audio-volume-change.oga")
|
||||
source: Qt.resolvedUrl("../assets/sounds/freedesktop/audio-volume-change.wav")
|
||||
audioOutput: AudioOutput { volume: 1.0 }
|
||||
}
|
||||
`, root, "AudioService.VolumeChangeSound")
|
||||
@@ -70,7 +70,7 @@ Singleton {
|
||||
import QtQuick
|
||||
import QtMultimedia
|
||||
MediaPlayer {
|
||||
source: Qt.resolvedUrl("../assets/sounds/plasma/power-plug.ogg")
|
||||
source: Qt.resolvedUrl("../assets/sounds/plasma/power-plug.wav")
|
||||
audioOutput: AudioOutput { volume: 1.0 }
|
||||
}
|
||||
`, root, "AudioService.PowerPlugSound")
|
||||
@@ -79,7 +79,7 @@ Singleton {
|
||||
import QtQuick
|
||||
import QtMultimedia
|
||||
MediaPlayer {
|
||||
source: Qt.resolvedUrl("../assets/sounds/plasma/power-unplug.ogg")
|
||||
source: Qt.resolvedUrl("../assets/sounds/plasma/power-unplug.wav")
|
||||
audioOutput: AudioOutput { volume: 1.0 }
|
||||
}
|
||||
`, root, "AudioService.PowerUnplugSound")
|
||||
@@ -88,7 +88,7 @@ Singleton {
|
||||
import QtQuick
|
||||
import QtMultimedia
|
||||
MediaPlayer {
|
||||
source: Qt.resolvedUrl("../assets/sounds/freedesktop/message.oga")
|
||||
source: Qt.resolvedUrl("../assets/sounds/freedesktop/message.wav")
|
||||
audioOutput: AudioOutput { volume: 1.0 }
|
||||
}
|
||||
`, root, "AudioService.NormalNotificationSound")
|
||||
@@ -97,7 +97,7 @@ Singleton {
|
||||
import QtQuick
|
||||
import QtMultimedia
|
||||
MediaPlayer {
|
||||
source: Qt.resolvedUrl("../assets/sounds/freedesktop/message-new-instant.oga")
|
||||
source: Qt.resolvedUrl("../assets/sounds/freedesktop/message-new-instant.wav")
|
||||
audioOutput: AudioOutput { volume: 1.0 }
|
||||
}
|
||||
`, root, "AudioService.CriticalNotificationSound")
|
||||
|
||||
BIN
assets/sounds/freedesktop/audio-volume-change.wav
Normal file
BIN
assets/sounds/freedesktop/audio-volume-change.wav
Normal file
Binary file not shown.
BIN
assets/sounds/freedesktop/message-new-instant.wav
Normal file
BIN
assets/sounds/freedesktop/message-new-instant.wav
Normal file
Binary file not shown.
BIN
assets/sounds/freedesktop/message.wav
Normal file
BIN
assets/sounds/freedesktop/message.wav
Normal file
Binary file not shown.
BIN
assets/sounds/plasma/power-plug.wav
Normal file
BIN
assets/sounds/plasma/power-plug.wav
Normal file
Binary file not shown.
BIN
assets/sounds/plasma/power-unplug.wav
Normal file
BIN
assets/sounds/plasma/power-unplug.wav
Normal file
Binary file not shown.
21
assets/sounds/wavconvert.sh
Executable file
21
assets/sounds/wavconvert.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Convert freedesktop sounds
|
||||
cd freedesktop
|
||||
for file in *.oga; do
|
||||
if [ -f "$file" ]; then
|
||||
echo "Converting $file to WAV..."
|
||||
ffmpeg -i "$file" -acodec pcm_s16le -ar 44100 -ac 2 "${file%.oga}.wav"
|
||||
fi
|
||||
done
|
||||
|
||||
# Convert plasma sounds
|
||||
cd ../plasma
|
||||
for file in *.ogg; do
|
||||
if [ -f "$file" ]; then
|
||||
echo "Converting $file to WAV..."
|
||||
ffmpeg -i "$file" -acodec pcm_s16le -ar 44100 -ac 2 "${file%.ogg}.wav"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Conversion complete!"
|
||||
Reference in New Issue
Block a user