mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-02 02:22:06 -04:00
restore CC and notification standalone behavior
This commit is contained in:
@@ -265,6 +265,7 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
|
enabled: SettingsData.connectedFrameModeActive
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.variantDuration(Theme.popoutAnimationDuration, detailHost.active)
|
duration: Theme.variantDuration(Theme.popoutAnimationDuration, detailHost.active)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
|
|||||||
@@ -86,7 +86,14 @@ DankPopout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
popupWidth: 550
|
popupWidth: 550
|
||||||
popupHeight: targetPopupHeight
|
popupHeight: {
|
||||||
|
if (SettingsData.connectedFrameModeActive)
|
||||||
|
return targetPopupHeight;
|
||||||
|
const screenHeight = (triggerScreen?.height ?? 1080);
|
||||||
|
const maxHeight = screenHeight - 100;
|
||||||
|
const contentHeight = contentLoader.item && contentLoader.item.implicitHeight > 0 ? contentLoader.item.implicitHeight + 20 : 400;
|
||||||
|
return Math.min(maxHeight, contentHeight);
|
||||||
|
}
|
||||||
triggerWidth: 80
|
triggerWidth: 80
|
||||||
positioning: ""
|
positioning: ""
|
||||||
screen: triggerScreen
|
screen: triggerScreen
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Behavior on expandedContentOpacity {
|
Behavior on expandedContentOpacity {
|
||||||
enabled: root.__initialized && root.userInitiatedExpansion && root.animateExpansion
|
enabled: root.connectedFrameMode && root.__initialized && root.userInitiatedExpansion && root.animateExpansion
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: root.expansionMotionDuration()
|
duration: root.expansionMotionDuration()
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
@@ -123,7 +123,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Behavior on collapsedContentOpacity {
|
Behavior on collapsedContentOpacity {
|
||||||
enabled: root.__initialized && root.userInitiatedExpansion && root.animateExpansion
|
enabled: root.connectedFrameMode && root.__initialized && root.userInitiatedExpansion && root.animateExpansion
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: root.expansionMotionDuration()
|
duration: root.expansionMotionDuration()
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
|
|||||||
@@ -10,19 +10,24 @@ import qs.Widgets
|
|||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: win
|
id: win
|
||||||
|
|
||||||
readonly property bool connectedFrameMode: SettingsData.frameEnabled
|
readonly property bool connectedFrameMode: SettingsData.frameEnabled && Theme.isConnectedEffect && SettingsData.isScreenInPreferences(win.screen, SettingsData.frameScreenPreferences)
|
||||||
&& Theme.isConnectedEffect
|
|
||||||
&& SettingsData.isScreenInPreferences(win.screen, SettingsData.frameScreenPreferences)
|
|
||||||
readonly property string notifBarSide: {
|
readonly property string notifBarSide: {
|
||||||
const pos = SettingsData.notificationPopupPosition;
|
const pos = SettingsData.notificationPopupPosition;
|
||||||
if (pos === -1) return "top";
|
if (pos === -1)
|
||||||
|
return "top";
|
||||||
switch (pos) {
|
switch (pos) {
|
||||||
case SettingsData.Position.Top: return "right";
|
case SettingsData.Position.Top:
|
||||||
case SettingsData.Position.Left: return "left";
|
return "right";
|
||||||
case SettingsData.Position.BottomCenter: return "bottom";
|
case SettingsData.Position.Left:
|
||||||
case SettingsData.Position.Right: return "right";
|
return "left";
|
||||||
case SettingsData.Position.Bottom: return "left";
|
case SettingsData.Position.BottomCenter:
|
||||||
default: return "top";
|
return "bottom";
|
||||||
|
case SettingsData.Position.Right:
|
||||||
|
return "right";
|
||||||
|
case SettingsData.Position.Bottom:
|
||||||
|
return "left";
|
||||||
|
default:
|
||||||
|
return "top";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
readonly property int inlineExpandDuration: Theme.notificationInlineExpandDuration
|
readonly property int inlineExpandDuration: Theme.notificationInlineExpandDuration
|
||||||
@@ -190,9 +195,7 @@ PanelWindow {
|
|||||||
property real renderedAlignedHeight: targetAlignedHeight
|
property real renderedAlignedHeight: targetAlignedHeight
|
||||||
property real allocatedAlignedHeight: targetAlignedHeight
|
property real allocatedAlignedHeight: targetAlignedHeight
|
||||||
readonly property bool inlineGeometryGrowing: targetAlignedHeight >= renderedAlignedHeight
|
readonly property bool inlineGeometryGrowing: targetAlignedHeight >= renderedAlignedHeight
|
||||||
readonly property bool contentAnchorsTop: isTopCenter
|
readonly property bool contentAnchorsTop: isTopCenter || SettingsData.notificationPopupPosition === SettingsData.Position.Top || SettingsData.notificationPopupPosition === SettingsData.Position.Left
|
||||||
|| SettingsData.notificationPopupPosition === SettingsData.Position.Top
|
|
||||||
|| SettingsData.notificationPopupPosition === SettingsData.Position.Left
|
|
||||||
readonly property real renderedContentOffsetY: contentAnchorsTop ? 0 : Math.max(0, allocatedAlignedHeight - renderedAlignedHeight)
|
readonly property real renderedContentOffsetY: contentAnchorsTop ? 0 : Math.max(0, allocatedAlignedHeight - renderedAlignedHeight)
|
||||||
implicitWidth: contentImplicitWidth + (windowShadowPad * 2)
|
implicitWidth: contentImplicitWidth + (windowShadowPad * 2)
|
||||||
implicitHeight: allocatedAlignedHeight + (windowShadowPad * 2)
|
implicitHeight: allocatedAlignedHeight + (windowShadowPad * 2)
|
||||||
@@ -252,7 +255,7 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Behavior on renderedAlignedHeight {
|
Behavior on renderedAlignedHeight {
|
||||||
enabled: !exiting && !_isDestroying
|
enabled: win.connectedFrameMode && !exiting && !_isDestroying
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
id: renderedHeightAnim
|
id: renderedHeightAnim
|
||||||
duration: win.inlineMotionDuration(win.inlineGeometryGrowing)
|
duration: win.inlineMotionDuration(win.inlineGeometryGrowing)
|
||||||
@@ -364,8 +367,7 @@ PanelWindow {
|
|||||||
return Math.max(0, Math.round(Theme.px(raw, dpr)));
|
return Math.max(0, Math.round(Theme.px(raw, dpr)));
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property bool frameOnlyNoConnected: SettingsData.frameEnabled && !connectedFrameMode && !!screen
|
readonly property bool frameOnlyNoConnected: SettingsData.frameEnabled && !connectedFrameMode && !!screen && SettingsData.isScreenInPreferences(screen, SettingsData.frameScreenPreferences)
|
||||||
&& SettingsData.isScreenInPreferences(screen, SettingsData.frameScreenPreferences)
|
|
||||||
|
|
||||||
// Frame ON + Connected OFF. frameEdgeInset is the full bar/frame inset
|
// Frame ON + Connected OFF. frameEdgeInset is the full bar/frame inset
|
||||||
function _frameGapMargin(side) {
|
function _frameGapMargin(side) {
|
||||||
@@ -379,9 +381,7 @@ PanelWindow {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (connectedFrameMode) {
|
if (connectedFrameMode) {
|
||||||
const cornerClear = (isCenterPosition || SettingsData.frameCloseGaps)
|
const cornerClear = (isCenterPosition || SettingsData.frameCloseGaps) ? 0 : (Theme.px(SettingsData.frameRounding, dpr) + Theme.px(Theme.connectedCornerRadius, dpr));
|
||||||
? 0
|
|
||||||
: (Theme.px(SettingsData.frameRounding, dpr) + Theme.px(Theme.connectedCornerRadius, dpr));
|
|
||||||
return _frameEdgeInset("top") + cornerClear + screenY;
|
return _frameEdgeInset("top") + cornerClear + screenY;
|
||||||
}
|
}
|
||||||
if (frameOnlyNoConnected)
|
if (frameOnlyNoConnected)
|
||||||
@@ -398,9 +398,7 @@ PanelWindow {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (connectedFrameMode) {
|
if (connectedFrameMode) {
|
||||||
const cornerClear = (isCenterPosition || SettingsData.frameCloseGaps)
|
const cornerClear = (isCenterPosition || SettingsData.frameCloseGaps) ? 0 : (Theme.px(SettingsData.frameRounding, dpr) + Theme.px(Theme.connectedCornerRadius, dpr));
|
||||||
? 0
|
|
||||||
: (Theme.px(SettingsData.frameRounding, dpr) + Theme.px(Theme.connectedCornerRadius, dpr));
|
|
||||||
return _frameEdgeInset("bottom") + cornerClear + screenY;
|
return _frameEdgeInset("bottom") + cornerClear + screenY;
|
||||||
}
|
}
|
||||||
if (frameOnlyNoConnected)
|
if (frameOnlyNoConnected)
|
||||||
|
|||||||
Reference in New Issue
Block a user