diff --git a/.config/quickshell/ii/modules/common/widgets/DirectoryIcon.qml b/.config/quickshell/ii/modules/common/widgets/DirectoryIcon.qml index b31ad021c..acdb65898 100644 --- a/.config/quickshell/ii/modules/common/widgets/DirectoryIcon.qml +++ b/.config/quickshell/ii/modules/common/widgets/DirectoryIcon.qml @@ -16,10 +16,9 @@ Image { if (!fileModelData.fileIsDir) return Quickshell.iconPath("application-x-zerosize"); - const name = fileModelData.fileName; const homeDir = Directories.home - if ([Directories.documents, Directories.downloads, Directories.music, Directories.pictures, Directories.videos].includes(name)) - return Quickshell.iconPath(`folder-${name.toLowerCase()}`); + if ([Directories.documents, Directories.downloads, Directories.music, Directories.pictures, Directories.videos].includes(fileModelData.filePath)) + return Quickshell.iconPath(`folder-${fileModelData.fileName.toLowerCase()}`); return Quickshell.iconPath("inode-directory"); } diff --git a/.config/quickshell/ii/modules/wallpaperSelector/WallpaperDirectoryItem.qml b/.config/quickshell/ii/modules/wallpaperSelector/WallpaperDirectoryItem.qml index c1f0b83c9..66f3f9e24 100644 --- a/.config/quickshell/ii/modules/wallpaperSelector/WallpaperDirectoryItem.qml +++ b/.config/quickshell/ii/modules/wallpaperSelector/WallpaperDirectoryItem.qml @@ -17,7 +17,8 @@ Item { property bool useThumbnail: Images.isValidImageByName(fileModelData.fileName) property bool isHovered: false - property alias color: background.color + property alias colBackground: background.color + property alias colText: wallpaperItemName.color property alias radius: background.radius property alias padding: background.anchors.margins @@ -122,7 +123,6 @@ Item { horizontalAlignment: Text.AlignHCenter elide: Text.ElideRight font.pixelSize: Appearance.font.pixelSize.smaller - color: (index === grid.currentIndex || parent.isHovered) ? Appearance.colors.colOnPrimary : Appearance.colors.colOnLayer0 Behavior on color { animation: Appearance.animation.elementMoveFast.colorAnimation.createObject(this) } diff --git a/.config/quickshell/ii/modules/wallpaperSelector/WallpaperSelectorContent.qml b/.config/quickshell/ii/modules/wallpaperSelector/WallpaperSelectorContent.qml index f6c19b5c1..8a985bfb0 100644 --- a/.config/quickshell/ii/modules/wallpaperSelector/WallpaperSelectorContent.qml +++ b/.config/quickshell/ii/modules/wallpaperSelector/WallpaperSelectorContent.qml @@ -116,46 +116,14 @@ Item { implicitWidth: 140 clip: true model: [ - { - icon: "home", - name: "Home", - path: Directories.home - }, - { - icon: "folder", - name: "Documents", - path: Directories.documents - }, - { - icon: "download", - name: "Downloads", - path: Directories.downloads - }, - { - icon: "image", - name: "Pictures", - path: Directories.pictures - }, - { - icon: "movie", - name: "Videos", - path: Directories.videos - }, - { - icon: "", - name: "---", - path: "INTENTIONALLY_INVALID_DIR" - }, - { - icon: "wallpaper", - name: "Wallpapers", - path: `${Directories.pictures}/Wallpapers` - }, - { - icon: "favorite", - name: "Homework", - path: `${Directories.pictures}/homework` - }, + { icon: "home", name: "Home", path: Directories.home }, + { icon: "docs", name: "Documents", path: Directories.documents }, + { icon: "download", name: "Downloads", path: Directories.downloads }, + { icon: "image", name: "Pictures", path: Directories.pictures }, + { icon: "movie", name: "Videos", path: Directories.videos }, + { icon: "", name: "---", path: "INTENTIONALLY_INVALID_DIR" }, + { icon: "wallpaper", name: "Wallpapers", path: `${Directories.pictures}/Wallpapers` }, + { icon: "favorite", name: "Homework", path: `${Directories.pictures}/homework` }, ] delegate: RippleButton { id: quickDirButton @@ -266,7 +234,8 @@ Item { fileModelData: modelData width: grid.cellWidth height: grid.cellHeight - color: (index === grid?.currentIndex || parent?.isHovered) ? Appearance.colors.colPrimary : ColorUtils.transparentize(Appearance.colors.colPrimary) + colBackground: (index === grid?.currentIndex || parent?.isHovered) ? Appearance.colors.colPrimaryContainer : ColorUtils.transparentize(Appearance.colors.colPrimaryContainer) + colText: (index === grid.currentIndex || parent.isHovered) ? Appearance.colors.colPrimary : Appearance.colors.colOnLayer0 onActivated: { Wallpapers.select(fileModelData.filePath, root.useDarkMode); @@ -314,7 +283,7 @@ Item { implicitWidth: height buttonRadius: Appearance.rounding.full onClicked: { - Wallpapers.openFallbackPicker(); + Wallpapers.openFallbackPicker(root.useDarkMode); GlobalStates.wallpaperSelectorOpen = false; } contentItem: MaterialSymbol { @@ -370,12 +339,10 @@ Item { // No filtering, just navigate grid if (event.key === Qt.Key_Down) { grid.moveSelection(grid.columns); - wallpaperGrid.forceActiveFocus(); event.accepted = true; } if (event.key === Qt.Key_Up) { grid.moveSelection(-grid.columns); - wallpaperGrid.forceActiveFocus(); event.accepted = true; } } diff --git a/.config/quickshell/ii/services/Wallpapers.qml b/.config/quickshell/ii/services/Wallpapers.qml index b98d3fe70..d1c211518 100644 --- a/.config/quickshell/ii/services/Wallpapers.qml +++ b/.config/quickshell/ii/services/Wallpapers.qml @@ -29,8 +29,11 @@ Singleton { id: applyProc } - function openFallbackPicker() { - applyProc.exec([Directories.wallpaperSwitchScriptPath]) + function openFallbackPicker(darkMode = Appearance.m3colors.darkmode) { + applyProc.exec([ + Directories.wallpaperSwitchScriptPath, + "--mode", (darkMode ? "dark" : "light") + ]) } function apply(path, darkMode = Appearance.m3colors.darkmode) { @@ -62,7 +65,7 @@ Singleton { } function select(filePath, darkMode = Appearance.m3colors.darkmode) { - selectProc.select(filePath); + selectProc.select(filePath, darkMode); } Process {