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