mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-15 16:52:47 -04:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bd46d29ff0 | |||
| 1a9d7684b9 | |||
| 0133c19276 |
@@ -58,6 +58,7 @@ Singleton {
|
|||||||
property string wallpaperPathDark: ""
|
property string wallpaperPathDark: ""
|
||||||
property var monitorWallpapersLight: ({})
|
property var monitorWallpapersLight: ({})
|
||||||
property var monitorWallpapersDark: ({})
|
property var monitorWallpapersDark: ({})
|
||||||
|
property var monitorWallpaperFillModes: ({})
|
||||||
property string wallpaperTransition: "fade"
|
property string wallpaperTransition: "fade"
|
||||||
readonly property var availableWallpaperTransitions: ["none", "fade", "wipe", "disc", "stripes", "iris bloom", "pixelate", "portal"]
|
readonly property var availableWallpaperTransitions: ["none", "fade", "wipe", "disc", "stripes", "iris bloom", "pixelate", "portal"]
|
||||||
property var includedTransitions: availableWallpaperTransitions.filter(t => t !== "none")
|
property var includedTransitions: availableWallpaperTransitions.filter(t => t !== "none")
|
||||||
@@ -1094,11 +1095,7 @@ Singleton {
|
|||||||
wallpaperPath = isLightMode ? wallpaperPathLight : wallpaperPathDark;
|
wallpaperPath = isLightMode ? wallpaperPathLight : wallpaperPathDark;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMonitorWallpaper(screenName) {
|
function _findMonitorValue(map, screenName) {
|
||||||
if (!perMonitorWallpaper) {
|
|
||||||
return wallpaperPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
var screen = null;
|
var screen = null;
|
||||||
var screens = Quickshell.screens;
|
var screens = Quickshell.screens;
|
||||||
for (var i = 0; i < screens.length; i++) {
|
for (var i = 0; i < screens.length; i++) {
|
||||||
@@ -1108,52 +1105,72 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!screen) {
|
if (!screen)
|
||||||
return monitorWallpapers[screenName] || wallpaperPath;
|
return map[screenName];
|
||||||
|
|
||||||
|
if (map[screen.name] !== undefined)
|
||||||
|
return map[screen.name];
|
||||||
|
if (screen.model && map[screen.model] !== undefined)
|
||||||
|
return map[screen.model];
|
||||||
|
if (typeof SettingsData !== "undefined") {
|
||||||
|
var displayName = SettingsData.getScreenDisplayName(screen);
|
||||||
|
if (displayName && map[displayName] !== undefined)
|
||||||
|
return map[displayName];
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMonitorWallpaper(screenName) {
|
||||||
|
if (!perMonitorWallpaper)
|
||||||
|
return wallpaperPath;
|
||||||
|
var value = _findMonitorValue(monitorWallpapers, screenName);
|
||||||
|
return value !== undefined ? value : wallpaperPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMonitorWallpaperFillMode(screenName) {
|
||||||
|
var globalFillMode = (typeof SettingsData !== "undefined") ? SettingsData.wallpaperFillMode : "Fill";
|
||||||
|
if (!perMonitorWallpaper)
|
||||||
|
return globalFillMode;
|
||||||
|
var value = _findMonitorValue(monitorWallpaperFillModes, screenName);
|
||||||
|
return value !== undefined ? value : globalFillMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setMonitorWallpaperFillMode(screenName, mode) {
|
||||||
|
var screen = null;
|
||||||
|
var screens = Quickshell.screens;
|
||||||
|
for (var i = 0; i < screens.length; i++) {
|
||||||
|
if (screens[i].name === screenName) {
|
||||||
|
screen = screens[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (monitorWallpapers[screen.name]) {
|
if (!screen)
|
||||||
return monitorWallpapers[screen.name];
|
return;
|
||||||
}
|
|
||||||
if (screen.model && monitorWallpapers[screen.model]) {
|
var identifier = typeof SettingsData !== "undefined" ? SettingsData.getScreenDisplayName(screen) : screen.name;
|
||||||
return monitorWallpapers[screen.model];
|
|
||||||
|
var newModes = {};
|
||||||
|
for (var key in monitorWallpaperFillModes) {
|
||||||
|
var isThisScreen = key === screen.name || (screen.model && key === screen.model);
|
||||||
|
if (!isThisScreen)
|
||||||
|
newModes[key] = monitorWallpaperFillModes[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return wallpaperPath;
|
newModes[identifier] = mode;
|
||||||
|
monitorWallpaperFillModes = newModes;
|
||||||
|
saveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMonitorCyclingSettings(screenName) {
|
function getMonitorCyclingSettings(screenName) {
|
||||||
var screen = null;
|
var defaults = {
|
||||||
var screens = Quickshell.screens;
|
|
||||||
for (var i = 0; i < screens.length; i++) {
|
|
||||||
if (screens[i].name === screenName) {
|
|
||||||
screen = screens[i];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!screen) {
|
|
||||||
return monitorCyclingSettings[screenName] || {
|
|
||||||
"enabled": false,
|
|
||||||
"mode": "interval",
|
|
||||||
"interval": 300,
|
|
||||||
"time": "06:00"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (monitorCyclingSettings[screen.name]) {
|
|
||||||
return monitorCyclingSettings[screen.name];
|
|
||||||
}
|
|
||||||
if (screen.model && monitorCyclingSettings[screen.model]) {
|
|
||||||
return monitorCyclingSettings[screen.model];
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"mode": "interval",
|
"mode": "interval",
|
||||||
"interval": 300,
|
"interval": 300,
|
||||||
"time": "06:00"
|
"time": "06:00"
|
||||||
};
|
};
|
||||||
|
var value = _findMonitorValue(monitorCyclingSettings, screenName);
|
||||||
|
return value !== undefined ? value : defaults;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
|
|||||||
@@ -45,11 +45,12 @@ Singleton {
|
|||||||
if (typeof SessionData === "undefined")
|
if (typeof SessionData === "undefined")
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
var monitors = SessionData.monitorWallpapers;
|
||||||
if (SessionData.perMonitorWallpaper) {
|
if (SessionData.perMonitorWallpaper) {
|
||||||
var screens = Quickshell.screens;
|
var screens = Quickshell.screens;
|
||||||
if (screens.length > 0) {
|
if (screens.length > 0) {
|
||||||
var firstMonitorWallpaper = SessionData.getMonitorWallpaper(screens[0].name);
|
var s = screens[0];
|
||||||
return firstMonitorWallpaper || SessionData.wallpaperPath;
|
return monitors[s.name] || (s.model ? monitors[s.model] : "") || SessionData.wallpaperPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,6 +60,7 @@ Singleton {
|
|||||||
if (typeof SessionData === "undefined")
|
if (typeof SessionData === "undefined")
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
var monitors = SessionData.monitorWallpapers;
|
||||||
if (SessionData.perMonitorWallpaper) {
|
if (SessionData.perMonitorWallpaper) {
|
||||||
var screens = Quickshell.screens;
|
var screens = Quickshell.screens;
|
||||||
if (screens.length > 0) {
|
if (screens.length > 0) {
|
||||||
@@ -72,12 +74,20 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!targetMonitorExists) {
|
if (!targetMonitorExists)
|
||||||
targetMonitor = screens[0].name;
|
targetMonitor = screens[0].name;
|
||||||
|
|
||||||
|
var s = null;
|
||||||
|
for (var j = 0; j < screens.length; j++) {
|
||||||
|
if (screens[j].name === targetMonitor) {
|
||||||
|
s = screens[j];
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var targetMonitorWallpaper = SessionData.getMonitorWallpaper(targetMonitor);
|
if (s)
|
||||||
return targetMonitorWallpaper || SessionData.wallpaperPath;
|
return monitors[s.name] || (s.model ? monitors[s.model] : "") || SessionData.wallpaperPath;
|
||||||
|
return monitors[targetMonitor] || SessionData.wallpaperPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ var SPEC = {
|
|||||||
wallpaperPathDark: { def: "" },
|
wallpaperPathDark: { def: "" },
|
||||||
monitorWallpapersLight: { def: {} },
|
monitorWallpapersLight: { def: {} },
|
||||||
monitorWallpapersDark: { def: {} },
|
monitorWallpapersDark: { def: {} },
|
||||||
|
monitorWallpaperFillModes: { def: {} },
|
||||||
wallpaperTransition: { def: "fade" },
|
wallpaperTransition: { def: "fade" },
|
||||||
includedTransitions: { def: ["fade", "wipe", "disc", "stripes", "iris bloom", "pixelate", "portal"] },
|
includedTransitions: { def: ["fade", "wipe", "disc", "stripes", "iris bloom", "pixelate", "portal"] },
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,9 @@ Rectangle {
|
|||||||
property var parentModal: null
|
property var parentModal: null
|
||||||
|
|
||||||
signal tabChangeRequested(int tabIndex)
|
signal tabChangeRequested(int tabIndex)
|
||||||
property var expandedCategories: ({})
|
property string _expandedIds: ","
|
||||||
property var autoExpandedCategories: ({})
|
property string _collapsedIds: ","
|
||||||
|
property string _autoExpandedIds: ","
|
||||||
property bool searchActive: searchField.text.length > 0
|
property bool searchActive: searchField.text.length > 0
|
||||||
property int searchSelectedIndex: 0
|
property int searchSelectedIndex: 0
|
||||||
property int keyboardHighlightIndex: -1
|
property int keyboardHighlightIndex: -1
|
||||||
@@ -340,24 +341,46 @@ Rectangle {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleCategory(categoryId) {
|
function _setExpanded(id, expanded) {
|
||||||
var newExpanded = Object.assign({}, expandedCategories);
|
var marker = "," + id + ",";
|
||||||
newExpanded[categoryId] = !isCategoryExpanded(categoryId);
|
if (expanded) {
|
||||||
expandedCategories = newExpanded;
|
if (_expandedIds.indexOf(marker) < 0)
|
||||||
|
_expandedIds = _expandedIds + id + ",";
|
||||||
|
_collapsedIds = _collapsedIds.replace(marker, ",");
|
||||||
|
} else {
|
||||||
|
_expandedIds = _expandedIds.replace(marker, ",");
|
||||||
|
if (_collapsedIds.indexOf(marker) < 0)
|
||||||
|
_collapsedIds = _collapsedIds + id + ",";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var newAutoExpanded = Object.assign({}, autoExpandedCategories);
|
function _setAutoExpanded(id, value) {
|
||||||
delete newAutoExpanded[categoryId];
|
var marker = "," + id + ",";
|
||||||
autoExpandedCategories = newAutoExpanded;
|
if (value) {
|
||||||
|
if (_autoExpandedIds.indexOf(marker) < 0)
|
||||||
|
_autoExpandedIds = _autoExpandedIds + id + ",";
|
||||||
|
} else {
|
||||||
|
_autoExpandedIds = _autoExpandedIds.replace(marker, ",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function _isAutoExpanded(id) {
|
||||||
|
return _autoExpandedIds.indexOf("," + id + ",") >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleCategory(categoryId) {
|
||||||
|
_setExpanded(categoryId, !isCategoryExpanded(categoryId));
|
||||||
|
_setAutoExpanded(categoryId, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isCategoryExpanded(categoryId) {
|
function isCategoryExpanded(categoryId) {
|
||||||
if (expandedCategories[categoryId] !== undefined) {
|
if (_collapsedIds.indexOf("," + categoryId + ",") >= 0)
|
||||||
return expandedCategories[categoryId];
|
return false;
|
||||||
}
|
if (_expandedIds.indexOf("," + categoryId + ",") >= 0)
|
||||||
var category = categoryStructure.find(cat => cat.id === categoryId);
|
return true;
|
||||||
if (category && category.collapsedByDefault) {
|
var category = categoryStructure.find(cat => cat.id === categoryId);
|
||||||
|
if (category && category.collapsedByDefault)
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,13 +410,8 @@ Rectangle {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!isCategoryExpanded(parent.id)) {
|
if (!isCategoryExpanded(parent.id)) {
|
||||||
var newExpanded = Object.assign({}, expandedCategories);
|
_setExpanded(parent.id, true);
|
||||||
newExpanded[parent.id] = true;
|
_setAutoExpanded(parent.id, true);
|
||||||
expandedCategories = newExpanded;
|
|
||||||
|
|
||||||
var newAutoExpanded = Object.assign({}, autoExpandedCategories);
|
|
||||||
newAutoExpanded[parent.id] = true;
|
|
||||||
autoExpandedCategories = newAutoExpanded;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,14 +419,9 @@ Rectangle {
|
|||||||
var oldParent = findParentCategory(oldTabIndex);
|
var oldParent = findParentCategory(oldTabIndex);
|
||||||
var newParent = findParentCategory(newTabIndex);
|
var newParent = findParentCategory(newTabIndex);
|
||||||
|
|
||||||
if (oldParent && oldParent !== newParent && autoExpandedCategories[oldParent.id]) {
|
if (oldParent && oldParent !== newParent && _isAutoExpanded(oldParent.id)) {
|
||||||
var newExpanded = Object.assign({}, expandedCategories);
|
_setExpanded(oldParent.id, false);
|
||||||
newExpanded[oldParent.id] = false;
|
_setAutoExpanded(oldParent.id, false);
|
||||||
expandedCategories = newExpanded;
|
|
||||||
|
|
||||||
var newAutoExpanded = Object.assign({}, autoExpandedCategories);
|
|
||||||
delete newAutoExpanded[oldParent.id];
|
|
||||||
autoExpandedCategories = newAutoExpanded;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ Variants {
|
|||||||
smooth: true
|
smooth: true
|
||||||
cache: true
|
cache: true
|
||||||
sourceSize: Qt.size(root.textureWidth, root.textureHeight)
|
sourceSize: Qt.size(root.textureWidth, root.textureHeight)
|
||||||
fillMode: root.getFillMode(SessionData.isGreeterMode ? GreetdSettings.wallpaperFillMode : SettingsData.wallpaperFillMode)
|
fillMode: root.getFillMode(SessionData.isGreeterMode ? GreetdSettings.wallpaperFillMode : SessionData.getMonitorWallpaperFillMode(modelData.name))
|
||||||
}
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
@@ -201,7 +201,7 @@ Variants {
|
|||||||
smooth: true
|
smooth: true
|
||||||
cache: true
|
cache: true
|
||||||
sourceSize: Qt.size(root.textureWidth, root.textureHeight)
|
sourceSize: Qt.size(root.textureWidth, root.textureHeight)
|
||||||
fillMode: root.getFillMode(SessionData.isGreeterMode ? GreetdSettings.wallpaperFillMode : SettingsData.wallpaperFillMode)
|
fillMode: root.getFillMode(SessionData.isGreeterMode ? GreetdSettings.wallpaperFillMode : SessionData.getMonitorWallpaperFillMode(modelData.name))
|
||||||
|
|
||||||
onStatusChanged: {
|
onStatusChanged: {
|
||||||
if (status !== Image.Ready)
|
if (status !== Image.Ready)
|
||||||
|
|||||||
@@ -303,22 +303,21 @@ Variants {
|
|||||||
id: maskItem
|
id: maskItem
|
||||||
parent: dock.contentItem
|
parent: dock.contentItem
|
||||||
visible: false
|
visible: false
|
||||||
|
readonly property bool expanded: dock.reveal
|
||||||
x: {
|
x: {
|
||||||
const baseX = dockCore.x + dockMouseArea.x;
|
const baseX = dockCore.x + dockMouseArea.x;
|
||||||
if (isVertical && SettingsData.dockPosition === SettingsData.Position.Right) {
|
if (isVertical && SettingsData.dockPosition === SettingsData.Position.Right)
|
||||||
return baseX - animationHeadroom - borderThickness;
|
return baseX - (expanded ? animationHeadroom + borderThickness : 0);
|
||||||
}
|
return baseX - (expanded ? borderThickness : 0);
|
||||||
return baseX - borderThickness;
|
|
||||||
}
|
}
|
||||||
y: {
|
y: {
|
||||||
const baseY = dockCore.y + dockMouseArea.y;
|
const baseY = dockCore.y + dockMouseArea.y;
|
||||||
if (!isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom) {
|
if (!isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom)
|
||||||
return baseY - animationHeadroom - borderThickness;
|
return baseY - (expanded ? animationHeadroom + borderThickness : 0);
|
||||||
}
|
return baseY - (expanded ? borderThickness : 0);
|
||||||
return baseY - borderThickness;
|
|
||||||
}
|
}
|
||||||
width: dockMouseArea.width + (isVertical ? animationHeadroom : 0) + borderThickness * 2
|
width: dockMouseArea.width + (isVertical && expanded ? animationHeadroom : 0) + (expanded ? borderThickness * 2 : 0)
|
||||||
height: dockMouseArea.height + (!isVertical ? animationHeadroom : 0) + borderThickness * 2
|
height: dockMouseArea.height + (!isVertical && expanded ? animationHeadroom : 0) + (expanded ? borderThickness * 2 : 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
mask: Region {
|
mask: Region {
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ Item {
|
|||||||
var currentWallpaper = SessionData.getMonitorWallpaper(screenName);
|
var currentWallpaper = SessionData.getMonitorWallpaper(screenName);
|
||||||
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? encodeFileUrl(currentWallpaper) : "";
|
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? encodeFileUrl(currentWallpaper) : "";
|
||||||
}
|
}
|
||||||
fillMode: Theme.getFillMode(SettingsData.wallpaperFillMode)
|
fillMode: Theme.getFillMode(SessionData.getMonitorWallpaperFillMode(screenName))
|
||||||
smooth: true
|
smooth: true
|
||||||
asynchronous: false
|
asynchronous: false
|
||||||
cache: true
|
cache: true
|
||||||
|
|||||||
@@ -38,6 +38,14 @@ DankOSD {
|
|||||||
|
|
||||||
property bool _pendingShow: false
|
property bool _pendingShow: false
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: artPreloader
|
||||||
|
source: TrackArtService._bgArtSource
|
||||||
|
visible: false
|
||||||
|
asynchronous: true
|
||||||
|
cache: true
|
||||||
|
}
|
||||||
|
|
||||||
onPlayerChanged: {
|
onPlayerChanged: {
|
||||||
if (!player) {
|
if (!player) {
|
||||||
_pendingShow = false;
|
_pendingShow = false;
|
||||||
@@ -48,7 +56,21 @@ DankOSD {
|
|||||||
Connections {
|
Connections {
|
||||||
target: TrackArtService
|
target: TrackArtService
|
||||||
function onLoadingChanged() {
|
function onLoadingChanged() {
|
||||||
if (!TrackArtService.loading && root._pendingShow) {
|
if (TrackArtService.loading || !root._pendingShow)
|
||||||
|
return;
|
||||||
|
if (!TrackArtService._bgArtSource || artPreloader.status !== Image.Loading) {
|
||||||
|
root._pendingShow = false;
|
||||||
|
root.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: artPreloader
|
||||||
|
function onStatusChanged() {
|
||||||
|
if (!root._pendingShow || TrackArtService.loading)
|
||||||
|
return;
|
||||||
|
if (artPreloader.status !== Image.Loading) {
|
||||||
root._pendingShow = false;
|
root._pendingShow = false;
|
||||||
root.show();
|
root.show();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,26 @@ Item {
|
|||||||
var screens = Quickshell.screens;
|
var screens = Quickshell.screens;
|
||||||
return screens.length > 0 ? screens[0].name : "";
|
return screens.length > 0 ? screens[0].name : "";
|
||||||
}
|
}
|
||||||
|
property string currentWallpaper: {
|
||||||
|
if (!SessionData.perMonitorWallpaper)
|
||||||
|
return SessionData.wallpaperPath;
|
||||||
|
var map = SessionData.monitorWallpapers;
|
||||||
|
var screens = Quickshell.screens;
|
||||||
|
for (var i = 0; i < screens.length; i++) {
|
||||||
|
if (screens[i].name !== selectedMonitorName)
|
||||||
|
continue;
|
||||||
|
var screen = screens[i];
|
||||||
|
if (map[screen.name] !== undefined)
|
||||||
|
return map[screen.name];
|
||||||
|
if (screen.model && map[screen.model] !== undefined)
|
||||||
|
return map[screen.model];
|
||||||
|
var displayName = SettingsData.getScreenDisplayName(screen);
|
||||||
|
if (displayName && map[displayName] !== undefined)
|
||||||
|
return map[displayName];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return SessionData.wallpaperPath;
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
WallpaperCyclingService.cyclingActive;
|
WallpaperCyclingService.cyclingActive;
|
||||||
@@ -55,19 +75,22 @@ Item {
|
|||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: Theme.surfaceVariant
|
color: Theme.surfaceVariant
|
||||||
|
|
||||||
CachingImage {
|
Image {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 1
|
anchors.margins: 1
|
||||||
imagePath: {
|
source: {
|
||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
|
var wp = root.currentWallpaper;
|
||||||
return (currentWallpaper !== "" && !currentWallpaper.startsWith("#")) ? currentWallpaper : "";
|
if (wp === "" || wp.startsWith("#"))
|
||||||
|
return "";
|
||||||
|
if (wp.startsWith("file://"))
|
||||||
|
wp = wp.substring(7);
|
||||||
|
return "file://" + wp.split('/').map(s => encodeURIComponent(s)).join('/');
|
||||||
}
|
}
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
visible: {
|
visible: root.currentWallpaper !== "" && !root.currentWallpaper.startsWith("#")
|
||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
|
sourceSize.width: 160
|
||||||
return currentWallpaper !== "" && !currentWallpaper.startsWith("#");
|
sourceSize.height: 160
|
||||||
}
|
asynchronous: true
|
||||||
maxCacheSize: 160
|
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.effect: MultiEffect {
|
layer.effect: MultiEffect {
|
||||||
maskEnabled: true
|
maskEnabled: true
|
||||||
@@ -81,14 +104,8 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 1
|
anchors.margins: 1
|
||||||
radius: Theme.cornerRadius - 1
|
radius: Theme.cornerRadius - 1
|
||||||
color: {
|
color: root.currentWallpaper.startsWith("#") ? root.currentWallpaper : "transparent"
|
||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
|
visible: root.currentWallpaper !== "" && root.currentWallpaper.startsWith("#")
|
||||||
return currentWallpaper.startsWith("#") ? currentWallpaper : "transparent";
|
|
||||||
}
|
|
||||||
visible: {
|
|
||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
|
|
||||||
return currentWallpaper !== "" && currentWallpaper.startsWith("#");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@@ -106,10 +123,7 @@ Item {
|
|||||||
name: "image"
|
name: "image"
|
||||||
size: Theme.iconSizeLarge + 8
|
size: Theme.iconSizeLarge + 8
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
visible: {
|
visible: root.currentWallpaper === ""
|
||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
|
|
||||||
return currentWallpaper === "";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@@ -162,8 +176,7 @@ Item {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
if (!PopoutService.colorPickerModal)
|
if (!PopoutService.colorPickerModal)
|
||||||
return;
|
return;
|
||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
|
PopoutService.colorPickerModal.selectedColor = root.currentWallpaper.startsWith("#") ? root.currentWallpaper : Theme.primary;
|
||||||
PopoutService.colorPickerModal.selectedColor = currentWallpaper.startsWith("#") ? currentWallpaper : Theme.primary;
|
|
||||||
PopoutService.colorPickerModal.pickerTitle = "Choose Wallpaper Color";
|
PopoutService.colorPickerModal.pickerTitle = "Choose Wallpaper Color";
|
||||||
PopoutService.colorPickerModal.onColorSelectedCallback = function (selectedColor) {
|
PopoutService.colorPickerModal.onColorSelectedCallback = function (selectedColor) {
|
||||||
if (SessionData.perMonitorWallpaper) {
|
if (SessionData.perMonitorWallpaper) {
|
||||||
@@ -182,10 +195,7 @@ Item {
|
|||||||
height: 32
|
height: 32
|
||||||
radius: 16
|
radius: 16
|
||||||
color: Qt.rgba(255, 255, 255, 0.9)
|
color: Qt.rgba(255, 255, 255, 0.9)
|
||||||
visible: {
|
visible: root.currentWallpaper !== ""
|
||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
|
|
||||||
return currentWallpaper !== "";
|
|
||||||
}
|
|
||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@@ -227,10 +237,7 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: root.currentWallpaper ? root.currentWallpaper.split('/').pop() : "No wallpaper selected"
|
||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
|
|
||||||
return currentWallpaper ? currentWallpaper.split('/').pop() : "No wallpaper selected";
|
|
||||||
}
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
elide: Text.ElideMiddle
|
elide: Text.ElideMiddle
|
||||||
@@ -240,39 +247,27 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: root.currentWallpaper
|
||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
|
|
||||||
return currentWallpaper ? currentWallpaper : "";
|
|
||||||
}
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
elide: Text.ElideMiddle
|
elide: Text.ElideMiddle
|
||||||
maximumLineCount: 1
|
maximumLineCount: 1
|
||||||
width: parent.width
|
width: parent.width
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
visible: {
|
visible: root.currentWallpaper !== ""
|
||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
|
|
||||||
return currentWallpaper !== "";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
layoutDirection: I18n.isRtl ? Qt.RightToLeft : Qt.LeftToRight
|
layoutDirection: I18n.isRtl ? Qt.RightToLeft : Qt.LeftToRight
|
||||||
visible: {
|
visible: root.currentWallpaper !== ""
|
||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
|
|
||||||
return currentWallpaper !== "";
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
DankActionButton {
|
||||||
buttonSize: 32
|
buttonSize: 32
|
||||||
iconName: "skip_previous"
|
iconName: "skip_previous"
|
||||||
iconSize: Theme.iconSizeSmall
|
iconSize: Theme.iconSizeSmall
|
||||||
enabled: {
|
enabled: root.currentWallpaper && !root.currentWallpaper.startsWith("#") && !root.currentWallpaper.startsWith("we")
|
||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
|
|
||||||
return currentWallpaper && !currentWallpaper.startsWith("#") && !currentWallpaper.startsWith("we");
|
|
||||||
}
|
|
||||||
opacity: enabled ? 1 : 0.5
|
opacity: enabled ? 1 : 0.5
|
||||||
backgroundColor: Theme.surfaceContainerHigh
|
backgroundColor: Theme.surfaceContainerHigh
|
||||||
iconColor: Theme.surfaceText
|
iconColor: Theme.surfaceText
|
||||||
@@ -289,10 +284,7 @@ Item {
|
|||||||
buttonSize: 32
|
buttonSize: 32
|
||||||
iconName: "skip_next"
|
iconName: "skip_next"
|
||||||
iconSize: Theme.iconSizeSmall
|
iconSize: Theme.iconSizeSmall
|
||||||
enabled: {
|
enabled: root.currentWallpaper && !root.currentWallpaper.startsWith("#") && !root.currentWallpaper.startsWith("we")
|
||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
|
|
||||||
return currentWallpaper && !currentWallpaper.startsWith("#") && !currentWallpaper.startsWith("we");
|
|
||||||
}
|
|
||||||
opacity: enabled ? 1 : 0.5
|
opacity: enabled ? 1 : 0.5
|
||||||
backgroundColor: Theme.surfaceContainerHigh
|
backgroundColor: Theme.surfaceContainerHigh
|
||||||
iconColor: Theme.surfaceText
|
iconColor: Theme.surfaceText
|
||||||
@@ -311,10 +303,7 @@ Item {
|
|||||||
Item {
|
Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: fillModeGroup.height
|
height: fillModeGroup.height
|
||||||
visible: {
|
visible: root.currentWallpaper !== "" && !root.currentWallpaper.startsWith("#")
|
||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath;
|
|
||||||
return currentWallpaper !== "" && !currentWallpaper.startsWith("#");
|
|
||||||
}
|
|
||||||
|
|
||||||
DankButtonGroup {
|
DankButtonGroup {
|
||||||
id: fillModeGroup
|
id: fillModeGroup
|
||||||
@@ -329,20 +318,39 @@ Item {
|
|||||||
textSize: Theme.fontSizeSmall
|
textSize: Theme.fontSizeSmall
|
||||||
checkEnabled: false
|
checkEnabled: false
|
||||||
currentIndex: {
|
currentIndex: {
|
||||||
return internalModes.indexOf(SettingsData.wallpaperFillMode);
|
var mode = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaperFillMode(selectedMonitorName) : SettingsData.wallpaperFillMode;
|
||||||
|
return internalModes.indexOf(mode);
|
||||||
}
|
}
|
||||||
onSelectionChanged: (index, selected) => {
|
onSelectionChanged: (index, selected) => {
|
||||||
if (!selected)
|
if (!selected)
|
||||||
return;
|
return;
|
||||||
SettingsData.set("wallpaperFillMode", internalModes[index]);
|
if (SessionData.perMonitorWallpaper) {
|
||||||
|
SessionData.setMonitorWallpaperFillMode(selectedMonitorName, internalModes[index]);
|
||||||
|
} else {
|
||||||
|
SettingsData.set("wallpaperFillMode", internalModes[index]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: SettingsData
|
target: SettingsData
|
||||||
function onWallpaperFillModeChanged() {
|
function onWallpaperFillModeChanged() {
|
||||||
|
if (SessionData.perMonitorWallpaper)
|
||||||
|
return;
|
||||||
fillModeGroup.currentIndex = fillModeGroup.internalModes.indexOf(SettingsData.wallpaperFillMode);
|
fillModeGroup.currentIndex = fillModeGroup.internalModes.indexOf(SettingsData.wallpaperFillMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: root
|
||||||
|
function onSelectedMonitorNameChanged() {
|
||||||
|
if (!SessionData.perMonitorWallpaper)
|
||||||
|
return;
|
||||||
|
fillModeGroup.currentIndex = Qt.binding(() => {
|
||||||
|
var mode = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaperFillMode(selectedMonitorName) : SettingsData.wallpaperFillMode;
|
||||||
|
return fillModeGroup.internalModes.indexOf(mode);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ Variants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
property real transitionProgress: 0
|
property real transitionProgress: 0
|
||||||
property real shaderFillMode: getFillMode(SettingsData.wallpaperFillMode)
|
property real shaderFillMode: getFillMode(SessionData.getMonitorWallpaperFillMode(modelData.name))
|
||||||
property vector4d fillColor: Qt.vector4d(0, 0, 0, 1)
|
property vector4d fillColor: Qt.vector4d(0, 0, 0, 1)
|
||||||
property real edgeSmoothness: 0.1
|
property real edgeSmoothness: 0.1
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ Variants {
|
|||||||
smooth: true
|
smooth: true
|
||||||
cache: true
|
cache: true
|
||||||
sourceSize: Qt.size(root.textureWidth, root.textureHeight)
|
sourceSize: Qt.size(root.textureWidth, root.textureHeight)
|
||||||
fillMode: root.getFillMode(SettingsData.wallpaperFillMode)
|
fillMode: root.getFillMode(SessionData.getMonitorWallpaperFillMode(modelData.name))
|
||||||
}
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
@@ -249,7 +249,7 @@ Variants {
|
|||||||
smooth: true
|
smooth: true
|
||||||
cache: true
|
cache: true
|
||||||
sourceSize: Qt.size(root.textureWidth, root.textureHeight)
|
sourceSize: Qt.size(root.textureWidth, root.textureHeight)
|
||||||
fillMode: root.getFillMode(SettingsData.wallpaperFillMode)
|
fillMode: root.getFillMode(SessionData.getMonitorWallpaperFillMode(modelData.name))
|
||||||
|
|
||||||
onStatusChanged: {
|
onStatusChanged: {
|
||||||
if (status !== Image.Ready)
|
if (status !== Image.Ready)
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ Singleton {
|
|||||||
if (url === _lastArtUrl)
|
if (url === _lastArtUrl)
|
||||||
return;
|
return;
|
||||||
_lastArtUrl = url;
|
_lastArtUrl = url;
|
||||||
|
|
||||||
_bgArtSource = "";
|
|
||||||
loading = true;
|
loading = true;
|
||||||
|
|
||||||
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
||||||
@@ -34,8 +32,7 @@ Singleton {
|
|||||||
Proc.runCommand("trackart", ["test", "-f", filePath], (output, exitCode) => {
|
Proc.runCommand("trackart", ["test", "-f", filePath], (output, exitCode) => {
|
||||||
if (_lastArtUrl !== localUrl)
|
if (_lastArtUrl !== localUrl)
|
||||||
return;
|
return;
|
||||||
if (exitCode === 0)
|
_bgArtSource = exitCode === 0 ? localUrl : "";
|
||||||
_bgArtSource = localUrl;
|
|
||||||
loading = false;
|
loading = false;
|
||||||
}, 200);
|
}, 200);
|
||||||
return;
|
return;
|
||||||
@@ -50,8 +47,7 @@ Singleton {
|
|||||||
const resultPath = output.trim();
|
const resultPath = output.trim();
|
||||||
if (resultPath !== filename)
|
if (resultPath !== filename)
|
||||||
return;
|
return;
|
||||||
if (exitCode === 0)
|
_bgArtSource = exitCode === 0 ? "file://" + resultPath : "";
|
||||||
_bgArtSource = "file://" + resultPath;
|
|
||||||
loading = false;
|
loading = false;
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readonly property real dockOffset: {
|
readonly property real dockOffset: {
|
||||||
if (!SettingsData.showDock || SettingsData.dockAutoHide)
|
if (!SettingsData.showDock || SettingsData.dockAutoHide || SettingsData.dockSmartAutoHide)
|
||||||
return 0;
|
return 0;
|
||||||
return dockThickness + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin;
|
return dockThickness + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user