mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-16 10:42:06 -04:00
frame(Notifications): Update Arc path & Motion
This commit is contained in:
@@ -42,6 +42,14 @@ PanelWindow {
|
|||||||
readonly property bool hasValidData: notificationData && notificationData.notification
|
readonly property bool hasValidData: notificationData && notificationData.notification
|
||||||
readonly property alias hovered: cardHoverHandler.hovered
|
readonly property alias hovered: cardHoverHandler.hovered
|
||||||
readonly property alias swipeActive: content.swipeActive
|
readonly property alias swipeActive: content.swipeActive
|
||||||
|
readonly property alias swipeDismissing: content.swipeDismissing
|
||||||
|
readonly property bool swipeDismissTowardEdge: {
|
||||||
|
if (content.swipeDismissing)
|
||||||
|
return _swipeDismissesTowardFrameEdge();
|
||||||
|
if (content.swipeActive)
|
||||||
|
return content.swipeOffset * _frameEdgeSwipeDirection() > 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
property int screenY: 0
|
property int screenY: 0
|
||||||
property bool exiting: false
|
property bool exiting: false
|
||||||
property bool _isDestroying: false
|
property bool _isDestroying: false
|
||||||
@@ -432,15 +440,23 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function popupChromeReleaseProgress() {
|
function popupChromeReleaseProgress() {
|
||||||
if (exiting)
|
if (exiting) {
|
||||||
return Math.max(0, Math.min(1, Math.abs(_chromeMotionOffset()) / _chromeCardTravel()));
|
const exitRel = Math.max(0, Math.min(1, Math.abs(_chromeMotionOffset()) / _chromeCardTravel()));
|
||||||
|
if (content.swipeDismissing) {
|
||||||
|
const swipeRel = Math.max(0, Math.min(1, Math.abs(content.swipeOffset) / Math.max(1, content.swipeTravelDistance)));
|
||||||
|
return Math.max(exitRel, swipeRel);
|
||||||
|
}
|
||||||
|
return exitRel;
|
||||||
|
}
|
||||||
if (content.swipeDismissing)
|
if (content.swipeDismissing)
|
||||||
return Math.max(0, Math.min(1, Math.abs(content.swipeOffset) / Math.max(1, content.swipeTravelDistance)));
|
return Math.max(0, Math.min(1, Math.abs(content.swipeOffset) / Math.max(1, content.swipeTravelDistance)));
|
||||||
|
if (content.swipeActive && content.swipeOffset * _frameEdgeSwipeDirection() > 0)
|
||||||
|
return Math.max(0, Math.min(1, Math.abs(content.swipeOffset) / Math.max(1, content.swipeTravelDistance)));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function popupChromeFollowsCardMotion() {
|
function popupChromeFollowsCardMotion() {
|
||||||
return content.swipeActive || (content.swipeDismissing && !exiting);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function popupChromeMotionX() {
|
function popupChromeMotionX() {
|
||||||
@@ -1059,7 +1075,7 @@ PanelWindow {
|
|||||||
const inwardConnectedExit = win.connectedFrameMode && !win.isCenterPosition && !win._swipeDismissesTowardFrameEdge();
|
const inwardConnectedExit = win.connectedFrameMode && !win.isCenterPosition && !win._swipeDismissesTowardFrameEdge();
|
||||||
if (inwardConnectedExit)
|
if (inwardConnectedExit)
|
||||||
content.chromeOnlyExit = true;
|
content.chromeOnlyExit = true;
|
||||||
if (win.connectedFrameMode && (win.isCenterPosition || inwardConnectedExit)) {
|
if (win.connectedFrameMode) {
|
||||||
win.startExit();
|
win.startExit();
|
||||||
NotificationService.dismissNotification(notificationData);
|
NotificationService.dismissNotification(notificationData);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ QtObject {
|
|||||||
popupComponent: Component {
|
popupComponent: Component {
|
||||||
NotificationPopup {
|
NotificationPopup {
|
||||||
onExitFinished: manager._onPopupExitFinished(this)
|
onExitFinished: manager._onPopupExitFinished(this)
|
||||||
|
onExitStarted: manager._onPopupExitStarted(this)
|
||||||
onPopupHeightChanged: manager._onPopupHeightChanged(this)
|
onPopupHeightChanged: manager._onPopupHeightChanged(this)
|
||||||
onPopupChromeGeometryChanged: manager._onPopupChromeGeometryChanged(this)
|
onPopupChromeGeometryChanged: manager._onPopupChromeGeometryChanged(this)
|
||||||
}
|
}
|
||||||
@@ -263,9 +264,14 @@ QtObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _popupChromeVisibleFraction(p) {
|
function _popupChromeVisibleFraction(p) {
|
||||||
if (p.exiting && p.popupChromeReleaseProgress)
|
if (p.popupChromeReleaseProgress) {
|
||||||
return 1 - _chromeReleaseTailProgress(p.popupChromeReleaseProgress());
|
const rel = p.popupChromeReleaseProgress();
|
||||||
if (!p.exiting && p.popupChromeOpenProgress)
|
if (p.exiting)
|
||||||
|
return Math.max(0, 1 - rel);
|
||||||
|
if (rel > 0)
|
||||||
|
return p.swipeDismissTowardEdge ? Math.max(0, 1 - rel) : 1 - _chromeReleaseTailProgress(rel);
|
||||||
|
}
|
||||||
|
if (p.popupChromeOpenProgress)
|
||||||
return _clamp01(p.popupChromeOpenProgress());
|
return _clamp01(p.popupChromeOpenProgress());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -389,6 +395,7 @@ QtObject {
|
|||||||
ConnectedModeState.clearNotificationState(screenName);
|
ConnectedModeState.clearNotificationState(screenName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const trailing = chromeCandidates.length > 1 ? _trailingChromeWindow(chromeCandidates) : null;
|
const trailing = chromeCandidates.length > 1 ? _trailingChromeWindow(chromeCandidates) : null;
|
||||||
let active = chromeCandidates;
|
let active = chromeCandidates;
|
||||||
if (chromeCandidates.length > 1) {
|
if (chromeCandidates.length > 1) {
|
||||||
@@ -396,6 +403,7 @@ QtObject {
|
|||||||
if (reserving.length > 0)
|
if (reserving.length > 0)
|
||||||
active = reserving;
|
active = reserving;
|
||||||
}
|
}
|
||||||
|
|
||||||
let minX = Infinity;
|
let minX = Infinity;
|
||||||
let minY = Infinity;
|
let minY = Infinity;
|
||||||
let maxXEnd = -Infinity;
|
let maxXEnd = -Infinity;
|
||||||
@@ -449,6 +457,12 @@ QtObject {
|
|||||||
_repositionAll();
|
_repositionAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _onPopupExitStarted(p) {
|
||||||
|
if (!p || popupWindows.indexOf(p) === -1)
|
||||||
|
return;
|
||||||
|
_repositionAll();
|
||||||
|
}
|
||||||
|
|
||||||
function _onPopupExitFinished(p) {
|
function _onPopupExitFinished(p) {
|
||||||
if (!p)
|
if (!p)
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user