mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-07 14:08:29 -04:00
qs: improve initial load of wallpaper, dock, and desktop plugins
This commit is contained in:
@@ -213,7 +213,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
dockRecreateDebounce.start();
|
dockEnabled = true;
|
||||||
loginSoundTimer.start();
|
loginSoundTimer.start();
|
||||||
osdStartupTimer.start();
|
osdStartupTimer.start();
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ Variants {
|
|||||||
|
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
|
visible: root.contentReady && !root.surfaceBounce
|
||||||
|
|
||||||
updatesEnabled: root.renderActive || root._settleFrames > 0
|
updatesEnabled: root.renderActive || root._settleFrames > 0
|
||||||
|
|
||||||
mask: Region {
|
mask: Region {
|
||||||
@@ -56,6 +58,8 @@ Variants {
|
|||||||
|
|
||||||
property string source: SessionData.getMonitorWallpaper(modelData.name) || ""
|
property string source: SessionData.getMonitorWallpaper(modelData.name) || ""
|
||||||
property bool isColorSource: source.startsWith("#")
|
property bool isColorSource: source.startsWith("#")
|
||||||
|
property bool contentReady: false
|
||||||
|
property bool surfaceBounce: false
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: SessionData
|
target: SessionData
|
||||||
@@ -94,6 +98,9 @@ Variants {
|
|||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
isInitialized = true;
|
isInitialized = true;
|
||||||
|
if (!source || isColorSource) {
|
||||||
|
contentReady = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property bool isInitialized: false
|
property bool isInitialized: false
|
||||||
@@ -136,9 +143,9 @@ Variants {
|
|||||||
interval: 0
|
interval: 0
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
blurWallpaperWindow.visible = false;
|
root.surfaceBounce = true;
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
blurWallpaperWindow.visible = true;
|
root.surfaceBounce = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -246,6 +253,8 @@ Variants {
|
|||||||
transitionAnimation.stop();
|
transitionAnimation.stop();
|
||||||
root.transitionProgress = 0.0;
|
root.transitionProgress = 0.0;
|
||||||
root.effectActive = false;
|
root.effectActive = false;
|
||||||
|
if (!newSource)
|
||||||
|
root.contentReady = true;
|
||||||
currentWallpaper.source = newSource;
|
currentWallpaper.source = newSource;
|
||||||
nextWallpaper.source = "";
|
nextWallpaper.source = "";
|
||||||
}
|
}
|
||||||
@@ -318,6 +327,9 @@ Variants {
|
|||||||
if (status === Image.Error) {
|
if (status === Image.Error) {
|
||||||
log.warn("failed to load active wallpaper for", modelData.name + ":", source);
|
log.warn("failed to load active wallpaper for", modelData.name + ":", source);
|
||||||
}
|
}
|
||||||
|
if (status === Image.Ready || status === Image.Error) {
|
||||||
|
root.contentReady = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -340,7 +340,19 @@ Variants {
|
|||||||
return ConnectedModeState.dockRetractActiveForSide(dock._dockScreenName, dock.connectedBarSide);
|
return ConnectedModeState.dockRetractActiveForSide(dock._dockScreenName, dock.connectedBarSide);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property bool startupRevealDone: false
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: startupRevealTimer
|
||||||
|
interval: 200
|
||||||
|
running: true
|
||||||
|
onTriggered: dock.startupRevealDone = true
|
||||||
|
}
|
||||||
|
|
||||||
property bool reveal: {
|
property bool reveal: {
|
||||||
|
if (!startupRevealDone)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (_modalRetractActive)
|
if (_modalRetractActive)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -628,6 +640,7 @@ Variants {
|
|||||||
id: dockContainer
|
id: dockContainer
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
clip: false
|
clip: false
|
||||||
|
opacity: dock.startupRevealDone ? 1 : 0
|
||||||
|
|
||||||
transform: Translate {
|
transform: Translate {
|
||||||
id: dockSlide
|
id: dockSlide
|
||||||
|
|||||||
@@ -359,6 +359,17 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
active: root.widgetEnabled && root.activeComponent !== null
|
active: root.widgetEnabled && root.activeComponent !== null
|
||||||
sourceComponent: root.activeComponent
|
sourceComponent: root.activeComponent
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
|
NumberAnimation {
|
||||||
|
id: revealFade
|
||||||
|
target: contentLoader
|
||||||
|
property: "opacity"
|
||||||
|
from: 0
|
||||||
|
to: 1
|
||||||
|
duration: Theme.mediumDuration
|
||||||
|
easing.type: Theme.standardEasing
|
||||||
|
}
|
||||||
|
|
||||||
function reloadComponent() {
|
function reloadComponent() {
|
||||||
active = false;
|
active = false;
|
||||||
@@ -384,6 +395,8 @@ Item {
|
|||||||
if (!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
revealFade.restart();
|
||||||
|
|
||||||
if (item.pluginService !== undefined) {
|
if (item.pluginService !== undefined) {
|
||||||
item.pluginService = root.isInstance ? instanceScopedPluginService : root.pluginService;
|
item.pluginService = root.isInstance ? instanceScopedPluginService : root.pluginService;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ Variants {
|
|||||||
|
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
|
visible: root.contentReady && !root.surfaceBounce
|
||||||
|
|
||||||
updatesEnabled: root.renderActive || root._settleFrames > 0
|
updatesEnabled: root.renderActive || root._settleFrames > 0
|
||||||
|
|
||||||
mask: Region {
|
mask: Region {
|
||||||
@@ -64,6 +66,9 @@ Variants {
|
|||||||
property string actualTransitionType: transitionType
|
property string actualTransitionType: transitionType
|
||||||
property bool isInitialized: false
|
property bool isInitialized: false
|
||||||
|
|
||||||
|
property bool contentReady: false
|
||||||
|
property bool surfaceBounce: false
|
||||||
|
|
||||||
property string scrollMode: SettingsData.wallpaperFillMode
|
property string scrollMode: SettingsData.wallpaperFillMode
|
||||||
property bool scrollingEnabled: scrollMode === "Scrolling"
|
property bool scrollingEnabled: scrollMode === "Scrolling"
|
||||||
property int currentWorkspaceIndex: 0
|
property int currentWorkspaceIndex: 0
|
||||||
@@ -263,9 +268,9 @@ Variants {
|
|||||||
interval: 0
|
interval: 0
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
wallpaperWindow.visible = false;
|
root.surfaceBounce = true;
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
wallpaperWindow.visible = true;
|
root.surfaceBounce = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -506,6 +511,9 @@ Variants {
|
|||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
isInitialized = true;
|
isInitialized = true;
|
||||||
|
if (!source || isColorSource) {
|
||||||
|
contentReady = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (scrollingEnabled) {
|
if (scrollingEnabled) {
|
||||||
updateWorkspaceData();
|
updateWorkspaceData();
|
||||||
@@ -574,8 +582,10 @@ Variants {
|
|||||||
root.effectActive = false;
|
root.effectActive = false;
|
||||||
root.screenScale = CompositorService.getScreenScale(modelData);
|
root.screenScale = CompositorService.getScreenScale(modelData);
|
||||||
// No status change coming to clear the flag
|
// No status change coming to clear the flag
|
||||||
if (!newSource || currentWallpaper.source.toString() === newSource)
|
if (!newSource || currentWallpaper.source.toString() === newSource) {
|
||||||
root.changePending = false;
|
root.changePending = false;
|
||||||
|
root.contentReady = true;
|
||||||
|
}
|
||||||
currentWallpaper.source = newSource;
|
currentWallpaper.source = newSource;
|
||||||
nextWallpaper.source = "";
|
nextWallpaper.source = "";
|
||||||
|
|
||||||
@@ -746,6 +756,7 @@ Variants {
|
|||||||
}
|
}
|
||||||
if (status === Image.Ready || status === Image.Error) {
|
if (status === Image.Ready || status === Image.Error) {
|
||||||
root.changePending = false;
|
root.changePending = false;
|
||||||
|
root.contentReady = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user