mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-21 18:54:01 -04:00
island: fix transition regression
This commit is contained in:
@@ -54,14 +54,12 @@ PanelWindow {
|
||||
readonly property int outerGap: Math.max(0, Math.min(48, SettingsData.dankIslandOuterGap))
|
||||
readonly property int maxActivityHeight: Math.max(560, Math.min(680, (screen?.height ?? 1080) - 200))
|
||||
readonly property int hostHeight: outerGap + maxActivityHeight + 8
|
||||
readonly property int collapsedHostHeight: Math.max(reservedStripHeight, outerGap + Math.ceil(Math.max(controller.compactFaceHeight, satelliteHost.barThickness)) + 4)
|
||||
readonly property bool hostTall: controller.expanded || surface.targetEdgeExtent > collapsedHostHeight || (surface.motionRunning && surface.motionStartEdgeExtent > collapsedHostHeight)
|
||||
readonly property int maxActivityWidth: 736
|
||||
readonly property real maximumHorizontalOffset: Math.max(0, (width - maxActivityWidth) / 2 - 8)
|
||||
property bool keyboardFocusArmed: true
|
||||
|
||||
color: "transparent"
|
||||
implicitHeight: hostTall ? hostHeight : collapsedHostHeight
|
||||
implicitHeight: hostHeight
|
||||
exclusiveZone: floating ? 0 : reservedStripHeight
|
||||
readonly property alias islandController: controller
|
||||
readonly property int launcherResultCount: launcherController.flatModel?.length ?? 0
|
||||
|
||||
@@ -42,9 +42,6 @@ Item {
|
||||
|
||||
readonly property alias inputMaskItem: inputEnvelope
|
||||
readonly property bool motionRunning: motion.running
|
||||
readonly property real targetEdgeExtent: motion.targetOffsetY + motion.targetHeight
|
||||
readonly property real currentEdgeExtent: motion.currentOffsetY + motion.currentHeight
|
||||
property real motionStartEdgeExtent: 0
|
||||
property real trackedHeight: 0
|
||||
readonly property Item mediaDropdownMaskItem: mediaDropdowns.activePanel
|
||||
property real fadeCompactHeight: 48
|
||||
@@ -82,7 +79,6 @@ Item {
|
||||
}
|
||||
|
||||
function unionMotionStartBounds() {
|
||||
root.motionStartEdgeExtent = Math.max(root.motionStartEdgeExtent, root.currentEdgeExtent);
|
||||
const b = root.motionStartBounds;
|
||||
const left = Math.min(b.x, root.currentVisualX);
|
||||
const top = Math.min(b.y, root.currentVisualY);
|
||||
@@ -156,7 +152,6 @@ Item {
|
||||
function onRunningChanged() {
|
||||
if (motion.running) {
|
||||
root.motionStartBounds = Qt.rect(root.currentVisualX, root.currentVisualY, root.currentVisualWidth, root.currentVisualHeight);
|
||||
root.motionStartEdgeExtent = root.currentEdgeExtent;
|
||||
if (root.controller.activeActivity === "media")
|
||||
root.hideMediaDropdowns();
|
||||
return;
|
||||
@@ -240,8 +235,6 @@ Item {
|
||||
|
||||
anchors.fill: parent
|
||||
controller: root.controller
|
||||
islandX: root.currentVisualX
|
||||
hostWidth: root.width
|
||||
morphProgress: root.morphProgress
|
||||
expanded: root.controller.expanded
|
||||
pointerInside: root.controller.pointerInside
|
||||
|
||||
@@ -7,8 +7,6 @@ Item {
|
||||
id: root
|
||||
|
||||
required property var controller
|
||||
required property real islandX
|
||||
required property real hostWidth
|
||||
required property real morphProgress
|
||||
required property bool expanded
|
||||
required property bool pointerInside
|
||||
@@ -32,7 +30,6 @@ Item {
|
||||
required property Component notificationCenterCompactComponent
|
||||
required property Component notificationCenterExpandedComponent
|
||||
|
||||
readonly property real fitInset: Theme.spacingS
|
||||
readonly property real compactFade: root.fadeCompact(root.morphProgress)
|
||||
readonly property real expandedFade: root.fadeExpanded(root.morphProgress)
|
||||
readonly property real outgoingCompactFade: root.fadeCompact(root.outgoingMorph)
|
||||
@@ -58,23 +55,10 @@ Item {
|
||||
return root.renderedActivity === activity || root.outgoingActivity === activity;
|
||||
}
|
||||
|
||||
function compactFrame(activity) {
|
||||
const target = root.controller.compactTargetFor(activity);
|
||||
const left = Math.round((root.hostWidth - target.width) / 2 + target.offsetX);
|
||||
const top = Math.round((root.height - target.height) / 2);
|
||||
return Qt.rect(left - root.islandX, top, target.width, target.height);
|
||||
}
|
||||
|
||||
function fitFade(activity) {
|
||||
const target = root.controller.compactTargetFor(activity);
|
||||
const slack = Math.min(root.width - target.width, root.height - target.height) + root.fitInset * 4;
|
||||
return Math.max(0, Math.min(1, slack / (root.fitInset * 2)));
|
||||
}
|
||||
|
||||
function compactOpacity(activity) {
|
||||
const incoming = root.renderedActivity === activity ? root.activityFade * root.compactFade : 0;
|
||||
const outgoing = root.outgoingActivity === activity ? (1 - root.activityFade) * root.outgoingCompactFade : 0;
|
||||
return Math.max(incoming, outgoing) * root.fitFade(activity);
|
||||
return Math.max(incoming, outgoing);
|
||||
}
|
||||
|
||||
function expandedOpacity(activity) {
|
||||
@@ -157,15 +141,7 @@ Item {
|
||||
}
|
||||
|
||||
component CompactFace: Loader {
|
||||
id: face
|
||||
|
||||
required property string activity
|
||||
readonly property rect frame: root.compactFrame(face.activity)
|
||||
|
||||
x: frame.x
|
||||
y: frame.y
|
||||
width: frame.width
|
||||
height: frame.height
|
||||
anchors.fill: parent
|
||||
asynchronous: false
|
||||
visible: opacity > 0.001
|
||||
enabled: opacity >= 0.5
|
||||
@@ -178,7 +154,6 @@ Item {
|
||||
}
|
||||
|
||||
CompactFace {
|
||||
activity: "home"
|
||||
active: true
|
||||
sourceComponent: root.homeCompactComponent
|
||||
opacity: root.compactOpacity("home")
|
||||
@@ -194,7 +169,6 @@ Item {
|
||||
}
|
||||
|
||||
CompactFace {
|
||||
activity: "media"
|
||||
active: root.mediaSurfaceActive
|
||||
sourceComponent: root.mediaCompactComponent
|
||||
opacity: root.compactOpacity("media")
|
||||
@@ -210,7 +184,6 @@ Item {
|
||||
}
|
||||
|
||||
CompactFace {
|
||||
activity: "launcher"
|
||||
active: root.surfaceActive("launcher")
|
||||
sourceComponent: root.launcherCompactComponent
|
||||
opacity: root.compactOpacity("launcher")
|
||||
@@ -226,7 +199,6 @@ Item {
|
||||
}
|
||||
|
||||
CompactFace {
|
||||
activity: "controlcenter"
|
||||
active: root.surfaceActive("controlcenter")
|
||||
sourceComponent: root.controlCenterCompactComponent
|
||||
opacity: root.compactOpacity("controlcenter")
|
||||
@@ -240,7 +212,6 @@ Item {
|
||||
}
|
||||
|
||||
CompactFace {
|
||||
activity: "wallpaper"
|
||||
active: root.surfaceActive("wallpaper")
|
||||
sourceComponent: root.wallpaperCompactComponent
|
||||
opacity: root.compactOpacity("wallpaper")
|
||||
@@ -256,7 +227,6 @@ Item {
|
||||
}
|
||||
|
||||
CompactFace {
|
||||
activity: "weather"
|
||||
active: root.surfaceActive("weather")
|
||||
sourceComponent: root.weatherCompactComponent
|
||||
opacity: root.compactOpacity("weather")
|
||||
@@ -272,7 +242,6 @@ Item {
|
||||
}
|
||||
|
||||
CompactFace {
|
||||
activity: "notificationcenter"
|
||||
active: root.surfaceActive("notificationcenter")
|
||||
sourceComponent: root.notificationCenterCompactComponent
|
||||
opacity: root.compactOpacity("notificationcenter")
|
||||
@@ -288,7 +257,6 @@ Item {
|
||||
}
|
||||
|
||||
CompactFace {
|
||||
activity: "volume"
|
||||
active: root.systemSurfaceActive
|
||||
sourceComponent: root.systemCompactComponent
|
||||
opacity: Math.max(root.compactOpacity("volume"), root.compactOpacity("brightness"))
|
||||
@@ -302,7 +270,6 @@ Item {
|
||||
}
|
||||
|
||||
CompactFace {
|
||||
activity: "notification"
|
||||
active: root.surfaceActive("notification")
|
||||
sourceComponent: root.notificationCompactComponent
|
||||
opacity: root.compactOpacity("notification")
|
||||
|
||||
@@ -30,9 +30,13 @@ Item {
|
||||
readonly property color trackColor: {
|
||||
if (root.outlined)
|
||||
return root.hovered ? Theme.withAlpha(Theme.surfaceVariant, 0.45) : "transparent";
|
||||
return Theme.withAlpha(Theme.surfaceText, root.hovered ? 0.42 : 0.28);
|
||||
return Theme.withAlpha(Theme.surfaceText, root.hovered ? 0.25 : 0.14);
|
||||
}
|
||||
readonly property color onFillColor: {
|
||||
if (root.lowState)
|
||||
return Theme.isLightColor(Theme.error) ? Qt.rgba(0, 0, 0, 0.9) : Qt.rgba(1, 1, 1, 0.95);
|
||||
return Theme.primaryText;
|
||||
}
|
||||
readonly property color onFillColor: Theme.isLightColor(root.fillColor) ? Qt.rgba(0, 0, 0, 0.9) : Qt.rgba(1, 1, 1, 0.95)
|
||||
readonly property string numberText: Math.round(root.level) + (root.showPercentSign ? "%" : "")
|
||||
readonly property bool boltInside: root.charging && root.showBolt
|
||||
readonly property bool numberInside: !root.vertical && root.showNumber && BatteryService.batteryAvailable
|
||||
|
||||
Reference in New Issue
Block a user