mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-03 19:12:11 -04:00
frame(Motion): Restore fluid motion & Update component connections
This commit is contained in:
@@ -86,14 +86,7 @@ DankPopout {
|
||||
}
|
||||
|
||||
popupWidth: 550
|
||||
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);
|
||||
}
|
||||
popupHeight: targetPopupHeight
|
||||
triggerWidth: 80
|
||||
positioning: ""
|
||||
screen: triggerScreen
|
||||
|
||||
@@ -53,7 +53,8 @@ DankPopout {
|
||||
function __hideDropdowns() {
|
||||
__volumeCloseTimer.stop();
|
||||
__dropdownType = 0;
|
||||
__mediaTabRef?.resetDropdownStates();
|
||||
if (__mediaTabRef && typeof __mediaTabRef.resetDropdownStates === "function")
|
||||
__mediaTabRef.resetDropdownStates();
|
||||
}
|
||||
|
||||
function __startCloseTimer() {
|
||||
@@ -74,7 +75,11 @@ DankPopout {
|
||||
}
|
||||
}
|
||||
|
||||
overlayContent: Component {
|
||||
overlayContent: shouldBeVisible ? mediaDropdownOverlayComponent : null
|
||||
|
||||
Component {
|
||||
id: mediaDropdownOverlayComponent
|
||||
|
||||
MediaDropdownOverlay {
|
||||
dropdownType: root.__dropdownType
|
||||
anchorPos: root.__dropdownAnchor
|
||||
@@ -182,11 +187,8 @@ DankPopout {
|
||||
Connections {
|
||||
target: root
|
||||
function onShouldBeVisibleChanged() {
|
||||
if (root.shouldBeVisible) {
|
||||
Qt.callLater(function () {
|
||||
mainContainer.forceActiveFocus();
|
||||
});
|
||||
}
|
||||
if (root.shouldBeVisible)
|
||||
mainContainer.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,6 +380,10 @@ DankPopout {
|
||||
section: root.triggerSection
|
||||
barPosition: root.effectiveBarPosition
|
||||
Component.onCompleted: root.__mediaTabRef = this
|
||||
Component.onDestruction: {
|
||||
if (root.__mediaTabRef === this)
|
||||
root.__mediaTabRef = null;
|
||||
}
|
||||
onShowVolumeDropdown: (pos, screen, rightEdge, player, players) => {
|
||||
root.__showVolumeDropdown(pos, rightEdge, player, players);
|
||||
}
|
||||
|
||||
@@ -50,11 +50,9 @@ Item {
|
||||
}
|
||||
|
||||
function volumeAreaExited() {
|
||||
__volumeHoverCount--;
|
||||
Qt.callLater(() => {
|
||||
if (__volumeHoverCount <= 0)
|
||||
panelExited();
|
||||
});
|
||||
__volumeHoverCount = Math.max(0, __volumeHoverCount - 1);
|
||||
if (__volumeHoverCount === 0)
|
||||
panelExited();
|
||||
}
|
||||
|
||||
readonly property Item __activePanel: {
|
||||
|
||||
@@ -203,7 +203,7 @@ Item {
|
||||
SettingsDropdownRow {
|
||||
visible: SettingsData.motionEffect === 1
|
||||
tab: "typography"
|
||||
tags: ["animation", "directional", "behavior", "overlap", "sticky", "roll", "connected"]
|
||||
tags: ["animation", "directional", "behavior", "fluid", "connected"]
|
||||
settingKey: "directionalAnimationMode"
|
||||
text: I18n.tr("Directional Behavior")
|
||||
description: {
|
||||
@@ -211,30 +211,24 @@ Item {
|
||||
return I18n.tr("Popouts emerge flush from the bar edge as a single continuous piece, with corner connectors bridging the junction");
|
||||
return I18n.tr("How the popout emerges from the DankBar");
|
||||
}
|
||||
options: SettingsData.frameEnabled ? [I18n.tr("Overlap"), I18n.tr("Slide"), I18n.tr("Roll"), I18n.tr("Connected")] : [I18n.tr("Overlap"), I18n.tr("Slide"), I18n.tr("Roll")]
|
||||
options: SettingsData.frameEnabled ? [I18n.tr("Fluid"), I18n.tr("Connected")] : [I18n.tr("Fluid")]
|
||||
currentValue: {
|
||||
switch (SettingsData.directionalAnimationMode) {
|
||||
case 1:
|
||||
return I18n.tr("Slide");
|
||||
case 2:
|
||||
return I18n.tr("Roll");
|
||||
case 3:
|
||||
return SettingsData.frameEnabled ? I18n.tr("Connected") : I18n.tr("Slide");
|
||||
return SettingsData.frameEnabled ? I18n.tr("Connected") : I18n.tr("Fluid");
|
||||
default:
|
||||
return I18n.tr("Overlap");
|
||||
return I18n.tr("Fluid");
|
||||
}
|
||||
}
|
||||
onValueChanged: value => {
|
||||
if (value === I18n.tr("Slide"))
|
||||
if (value === I18n.tr("Fluid"))
|
||||
SettingsData.set("directionalAnimationMode", 1);
|
||||
else if (value === I18n.tr("Roll"))
|
||||
SettingsData.set("directionalAnimationMode", 2);
|
||||
else if (value === I18n.tr("Connected") && SettingsData.frameEnabled) {
|
||||
if (SettingsData.directionalAnimationMode !== 3)
|
||||
SettingsData.set("previousDirectionalMode", SettingsData.directionalAnimationMode);
|
||||
SettingsData.set("previousDirectionalMode", 1);
|
||||
SettingsData.set("directionalAnimationMode", 3);
|
||||
} else
|
||||
SettingsData.set("directionalAnimationMode", 0);
|
||||
SettingsData.set("directionalAnimationMode", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user