This commit is contained in:
Lemmy
2026-02-11 19:02:57 -05:00
parent 3fe44cbc95
commit 52c5aa952c
4 changed files with 82 additions and 51 deletions
+48 -23
View File
@@ -447,9 +447,7 @@ SmartPanel {
NIconButton {
icon: "color-swatch"
tooltipText: Settings.data.colorSchemes.useWallpaperColors
? I18n.tr("wallpaper.panel.color-extraction-enabled")
: I18n.tr("wallpaper.panel.color-extraction-disabled")
tooltipText: Settings.data.colorSchemes.useWallpaperColors ? I18n.tr("wallpaper.panel.color-extraction-enabled") : I18n.tr("wallpaper.panel.color-extraction-disabled")
baseSize: Style.baseWidgetSize * 0.8
onClicked: {
Settings.data.colorSchemes.useWallpaperColors = !Settings.data.colorSchemes.useWallpaperColors;
@@ -469,19 +467,18 @@ SmartPanel {
property bool _initialized: false
property bool _userChanging: false
Component.onCompleted: Qt.callLater(() => { _initialized = true; })
Component.onCompleted: Qt.callLater(() => {
_initialized = true;
})
model: Settings.data.colorSchemes.useWallpaperColors
? TemplateProcessor.schemeTypes
: ColorSchemeService.schemes.map(s => ({
model: Settings.data.colorSchemes.useWallpaperColors ? TemplateProcessor.schemeTypes : ColorSchemeService.schemes.map(s => ({
"key": ColorSchemeService.getBasename(s),
"name": ColorSchemeService.getBasename(s)
}))
currentKey: Settings.data.colorSchemes.useWallpaperColors
? Settings.data.colorSchemes.generationMethod
: Settings.data.colorSchemes.predefinedScheme
currentKey: Settings.data.colorSchemes.useWallpaperColors ? Settings.data.colorSchemes.generationMethod : Settings.data.colorSchemes.predefinedScheme
onCurrentKeyChanged: {
if (!_initialized) return;
if (!_initialized)
return;
if (_userChanging) {
_userChanging = false;
return;
@@ -496,13 +493,27 @@ SmartPanel {
} else {
ColorSchemeService.setPredefinedScheme(key);
}
Qt.callLater(() => { _userChanging = false; });
Qt.callLater(() => {
_userChanging = false;
});
}
SequentialAnimation {
id: schemeGlowAnimation
NumberAnimation { target: colorSchemeComboBox; property: "opacity"; to: 0.3; duration: Style.animationSlow; easing.type: Easing.OutCubic }
NumberAnimation { target: colorSchemeComboBox; property: "opacity"; to: 1.0; duration: Style.animationSlow; easing.type: Easing.InCubic }
NumberAnimation {
target: colorSchemeComboBox
property: "opacity"
to: 0.3
duration: Style.animationSlow
easing.type: Easing.OutCubic
}
NumberAnimation {
target: colorSchemeComboBox
property: "opacity"
to: 1.0
duration: Style.animationSlow
easing.type: Easing.InCubic
}
}
}
@@ -632,7 +643,9 @@ SmartPanel {
property var directoriesList: [] // List of directories in browse mode
// ListModel for the grid — enables animated reordering via move()
ListModel { id: wallpaperModel }
ListModel {
id: wallpaperModel
}
// Browse mode properties
property string currentBrowsePath: WallpaperService.getCurrentBrowsePath(targetScreen?.name ?? "")
@@ -683,7 +696,8 @@ SmartPanel {
// Apply filter if text is present
if (!panelContent.filterText || panelContent.filterText.trim().length === 0) {
filteredItems = combinedItems;
if (!skipSync) syncModel();
if (!skipSync)
syncModel();
return;
}
@@ -695,7 +709,8 @@ SmartPanel {
return r.obj;
});
filteredItems = sortFavoritesToTop(filtered);
if (!skipSync) syncModel();
if (!skipSync)
syncModel();
}
// Copy filteredItems into the ListModel (full rebuild, no animation).
@@ -718,7 +733,8 @@ SmartPanel {
break;
}
}
if (fromIndex === -1) return;
if (fromIndex === -1)
return;
// Find where it should be in the freshly-computed filteredItems
var toIndex = -1;
@@ -728,7 +744,8 @@ SmartPanel {
break;
}
}
if (toIndex === -1 || fromIndex === toIndex) return;
if (toIndex === -1 || fromIndex === toIndex)
return;
wallpaperGridView.animateMovement = true;
wallpaperModel.move(fromIndex, toIndex, 1);
@@ -1183,10 +1200,14 @@ SmartPanel {
z: 5
Behavior on color {
ColorAnimation { duration: Style.animationFast }
ColorAnimation {
duration: Style.animationFast
}
}
Behavior on opacity {
NumberAnimation { duration: Style.animationFast }
NumberAnimation {
duration: Style.animationFast
}
}
NIcon {
@@ -1223,14 +1244,18 @@ SmartPanel {
property int diameter: 25 * Style.uiScaleRatio
property int _favRevision: 0
property var favData: { _favRevision; return WallpaperService.getFavorite(wallpaperItem.wallpaperPath); }
property var favData: {
_favRevision;
return WallpaperService.getFavorite(wallpaperItem.wallpaperPath);
}
property var colors: favData && favData.paletteColors ? favData.paletteColors : []
property bool isDark: favData ? favData.darkMode : false
Connections {
target: WallpaperService
function onFavoriteDataUpdated(path) {
if (path === wallpaperItem.wallpaperPath) paletteRow._favRevision++;
if (path === wallpaperItem.wallpaperPath)
paletteRow._favRevision++;
}
}
+2 -9
View File
@@ -366,9 +366,7 @@ Singleton {
// Save the color scheme of any favorited wallpapers that are about
// to be replaced, while the current settings still reflect them.
function _saveOutgoingFavorites(newPath, screenName) {
var outgoing = screenName !== undefined
? [currentWallpapers[screenName]]
: Object.values(currentWallpapers);
var outgoing = screenName !== undefined ? [currentWallpapers[screenName]] : Object.values(currentWallpapers);
var unique = [...new Set(outgoing)];
@@ -942,12 +940,7 @@ Singleton {
"darkMode": Settings.data.colorSchemes.darkMode,
"useWallpaperColors": Settings.data.colorSchemes.useWallpaperColors,
"generationMethod": Settings.data.colorSchemes.generationMethod,
"paletteColors": [
Color.mPrimary.toString(),
Color.mSecondary.toString(),
Color.mTertiary.toString(),
Color.mError.toString()
]
"paletteColors": [Color.mPrimary.toString(), Color.mSecondary.toString(), Color.mTertiary.toString(), Color.mError.toString()]
};
}
+10 -2
View File
@@ -256,11 +256,19 @@ Item {
Transition {
id: moveTransitionImpl
NumberAnimation { properties: "x,y"; duration: Style.animationNormal; easing.type: Easing.InOutQuad }
NumberAnimation {
properties: "x,y"
duration: Style.animationNormal
easing.type: Easing.InOutQuad
}
}
Transition {
id: displacedTransitionImpl
NumberAnimation { properties: "x,y"; duration: Style.animationNormal; easing.type: Easing.InOutQuad }
NumberAnimation {
properties: "x,y"
duration: Style.animationNormal
easing.type: Easing.InOutQuad
}
}
// Enable clipping to keep content within bounds
+9 -4
View File
@@ -1,10 +1,10 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import "../Helpers/Keybinds.js" as Keybinds
import qs.Commons
import qs.Services.UI
import qs.Widgets
import "../Helpers/Keybinds.js" as Keybinds
Item {
id: root
@@ -37,13 +37,16 @@ Item {
readonly property real _pillHeight: Style.baseWidgetSize * 1.1 * Style.uiScaleRatio
function _applyKeybind(keyStr) {
if (!keyStr) return;
if (!keyStr)
return;
// 1. Internal duplicate check (same action)
for (let i = 0; i < root.currentKeybinds.length; i++) {
if (i !== root.recordingIndex && String(root.currentKeybinds[i]).toLowerCase() === keyStr.toLowerCase()) {
hasConflict = true;
ToastService.showWarning(I18n.tr("panels.general.keybinds-conflict-title"), I18n.tr("panels.general.keybinds-conflict-description", { "action": root.label || "This action" }));
ToastService.showWarning(I18n.tr("panels.general.keybinds-conflict-title"), I18n.tr("panels.general.keybinds-conflict-description", {
"action": root.label || "This action"
}));
conflictTimer.restart();
return;
}
@@ -53,7 +56,9 @@ Item {
const conflict = Keybinds.getKeybindConflict(keyStr, root.settingsPath, Settings.data);
if (conflict) {
hasConflict = true;
ToastService.showWarning(I18n.tr("panels.general.keybinds-conflict-title"), I18n.tr("panels.general.keybinds-conflict-description", { "action": conflict }));
ToastService.showWarning(I18n.tr("panels.general.keybinds-conflict-title"), I18n.tr("panels.general.keybinds-conflict-description", {
"action": conflict
}));
conflictTimer.restart();
return;
}