test blob bounciness
This commit is contained in:
+13
-3
@@ -219,10 +219,20 @@ Variants {
|
|||||||
PanelBg {
|
PanelBg {
|
||||||
id: popoutBg
|
id: popoutBg
|
||||||
|
|
||||||
deformAmount: 0.15 * Config.appearance.deform.scale
|
// Extra height to prevent vertical movement deformation partially detaching panel from bar
|
||||||
implicitWidth: panels.popouts.width
|
property real extraHeight: panels.popouts.isDetached ? 0 : 0.2
|
||||||
|
|
||||||
|
deformAmount: panels.popouts.isDetached ? 0.05 * Config.appearance.deform.scale : panels.popouts.hasCurrent ? 0.15 * Config.appearance.deform.scale : 0.1 * Config.appearance.deform.scale
|
||||||
|
implicitHeight: panels.popouts.height * (1 + extraHeight)
|
||||||
|
implicitWidth: panels.popoutsWrapper.width
|
||||||
panel: panels.popoutsWrapper
|
panel: panels.popoutsWrapper
|
||||||
radius: (panels.popouts.currentName.startsWith("audio") || panels.popouts.currentName.startsWith("updates")) ? Appearance.rounding.normal : Appearance.rounding.smallest
|
radius: (panels.popouts.currentName.startsWith("audio") || panels.popouts.currentName.startsWith("updates")) ? Appearance.rounding.normal : Appearance.rounding.smallest
|
||||||
|
y: panels.popoutsWrapper.y + panels.popouts.y + bar.implicitHeight - panels.popouts.height * extraHeight
|
||||||
|
|
||||||
|
Behavior on extraHeight {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PanelBg {
|
PanelBg {
|
||||||
@@ -342,7 +352,7 @@ Variants {
|
|||||||
required property Item panel
|
required property Item panel
|
||||||
|
|
||||||
deformScale: deformAmount / 10000
|
deformScale: deformAmount / 10000
|
||||||
group: panel.width > 0 && panel.height > 0 ? blobGroup : null
|
group: blobGroup
|
||||||
implicitHeight: panel.height
|
implicitHeight: panel.height
|
||||||
implicitWidth: panel.width
|
implicitWidth: panel.width
|
||||||
radius: Appearance.rounding.smallest
|
radius: Appearance.rounding.smallest
|
||||||
|
|||||||
@@ -17,12 +17,16 @@ Item {
|
|||||||
implicitWidth: content.implicitWidth
|
implicitWidth: content.implicitWidth
|
||||||
visible: width > 0 && height > 0
|
visible: width > 0 && height > 0
|
||||||
x: {
|
x: {
|
||||||
const off = content.currentCenter - content.nonAnimWidth / 2;
|
if (content.isDetached)
|
||||||
|
return (parent.width - content.nonAnimWidth) / 2;
|
||||||
|
|
||||||
|
const off = content.currentCenter - Config.barConfig.border - content.nonAnimWidth / 2;
|
||||||
const diff = parent.width - Math.floor(off + content.nonAnimWidth);
|
const diff = parent.width - Math.floor(off + content.nonAnimWidth);
|
||||||
if (diff < 0)
|
if (diff < 0)
|
||||||
return off + diff;
|
return off + diff;
|
||||||
return Math.floor(Math.max(off, 0));
|
return Math.floor(Math.max(off, 0));
|
||||||
}
|
}
|
||||||
|
y: content.isDetached ? (parent.height - content.nonAnimHeight) / 2 : 0
|
||||||
|
|
||||||
Behavior on offsetScale {
|
Behavior on offsetScale {
|
||||||
Anim {
|
Anim {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ CustomClippingRect {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
height: 200
|
height: 200
|
||||||
visible: script.values.length === 0
|
visible: script.values.length === 0
|
||||||
width: 300
|
width: 600
|
||||||
|
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
id: noUpdatesIcon
|
id: noUpdatesIcon
|
||||||
|
|||||||
+1
-2
@@ -15,6 +15,7 @@ Item {
|
|||||||
property real currentCenter
|
property real currentCenter
|
||||||
property alias currentName: popoutState.currentName
|
property alias currentName: popoutState.currentName
|
||||||
property string detachedMode
|
property string detachedMode
|
||||||
|
readonly property bool isDetached: detachedMode.length > 0
|
||||||
property alias hasCurrent: popoutState.hasCurrent
|
property alias hasCurrent: popoutState.hasCurrent
|
||||||
readonly property real nonAnimHeight: children.find(c => c.shouldBeActive)?.implicitHeight ?? content.implicitHeight
|
readonly property real nonAnimHeight: children.find(c => c.shouldBeActive)?.implicitHeight ?? content.implicitHeight
|
||||||
readonly property real nonAnimWidth: children.find(c => c.shouldBeActive)?.implicitWidth ?? content.implicitWidth
|
readonly property real nonAnimWidth: children.find(c => c.shouldBeActive)?.implicitWidth ?? content.implicitWidth
|
||||||
@@ -50,8 +51,6 @@ Item {
|
|||||||
implicitWidth: nonAnimWidth
|
implicitWidth: nonAnimWidth
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
Behavior on implicitHeight {
|
||||||
enabled: root.offsetScale < 1
|
|
||||||
|
|
||||||
Anim {
|
Anim {
|
||||||
duration: root.animLength
|
duration: root.animLength
|
||||||
easing.bezierCurve: root.animCurve
|
easing.bezierCurve: root.animCurve
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ BlobRect::~BlobRect() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BlobRect::updatePolish() {
|
void BlobRect::updatePolish() {
|
||||||
BlobShape::updatePolish();
|
|
||||||
|
|
||||||
if (m_physicsActive) {
|
if (m_physicsActive) {
|
||||||
// Check if deformation is visually imperceptible
|
// Check if deformation is visually imperceptible
|
||||||
float totalDelta = std::abs(m_dm00 - 1.0f) + std::abs(m_dm01) + std::abs(m_dm11 - 1.0f);
|
float totalDelta = std::abs(m_dm00 - 1.0f) + std::abs(m_dm01) + std::abs(m_dm11 - 1.0f);
|
||||||
@@ -41,6 +39,8 @@ void BlobRect::updatePolish() {
|
|||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BlobShape::updatePolish();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlobRect::updatePhysics() {
|
void BlobRect::updatePhysics() {
|
||||||
|
|||||||
@@ -68,21 +68,8 @@ void BlobShape::componentComplete() {
|
|||||||
void BlobShape::geometryChange(const QRectF& newGeometry, const QRectF& oldGeometry) {
|
void BlobShape::geometryChange(const QRectF& newGeometry, const QRectF& oldGeometry) {
|
||||||
QQuickItem::geometryChange(newGeometry, oldGeometry);
|
QQuickItem::geometryChange(newGeometry, oldGeometry);
|
||||||
updateCenteredDeformMatrix();
|
updateCenteredDeformMatrix();
|
||||||
if (m_group) {
|
if (m_group && newGeometry != oldGeometry) {
|
||||||
// Accumulate sub-pixel drift so slow movements don't desync the shader
|
m_group->markShapeDirty(this);
|
||||||
m_pendingDx += static_cast<float>(newGeometry.x() - oldGeometry.x());
|
|
||||||
m_pendingDy += static_cast<float>(newGeometry.y() - oldGeometry.y());
|
|
||||||
m_pendingDw += static_cast<float>(newGeometry.width() - oldGeometry.width());
|
|
||||||
m_pendingDh += static_cast<float>(newGeometry.height() - oldGeometry.height());
|
|
||||||
|
|
||||||
if (std::abs(m_pendingDx) > 0.5f || std::abs(m_pendingDy) > 0.5f ||
|
|
||||||
std::abs(m_pendingDw) > 0.5f || std::abs(m_pendingDh) > 0.5f) {
|
|
||||||
m_pendingDx = 0;
|
|
||||||
m_pendingDy = 0;
|
|
||||||
m_pendingDw = 0;
|
|
||||||
m_pendingDh = 0;
|
|
||||||
m_group->markShapeDirty(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,13 +82,9 @@ float m_cachedPaddedW = 0;
|
|||||||
float m_cachedPaddedH = 0;
|
float m_cachedPaddedH = 0;
|
||||||
QRectF m_localPaddedRect;
|
QRectF m_localPaddedRect;
|
||||||
QVector<BlobRectData> m_cachedRects;
|
QVector<BlobRectData> m_cachedRects;
|
||||||
int m_cachedMyIndex = -2;
|
int m_cachedMyIndex = -2;
|
||||||
float m_pendingDx = 0;
|
bool m_cachedHasInverted = false;
|
||||||
float m_pendingDy = 0;
|
float m_cachedInvertedRadius = 0;
|
||||||
float m_pendingDw = 0;
|
|
||||||
float m_pendingDh = 0;
|
|
||||||
bool m_cachedHasInverted = false;
|
|
||||||
float m_cachedInvertedRadius = 0;
|
|
||||||
float m_cachedInvertedOuter[4] = {};
|
float m_cachedInvertedOuter[4] = {};
|
||||||
float m_cachedInvertedInner[4] = {};
|
float m_cachedInvertedInner[4] = {};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//@ pragma UseQApplication
|
//@ pragma UseQApplication
|
||||||
//@ pragma Env QSG_RENDER_LOOP=threaded
|
//@ pragma Env QSG_RENDER_LOOP=threaded
|
||||||
//@ pragma Env QSG_RHI_BACKEND=vulkan
|
// @ pragma Env QSG_RHI_BACKEND=vulkan
|
||||||
//@ pragma Env QSG_USE_SIMPLE_ANIMATION_DRIVER=0
|
//@ pragma Env QSG_USE_SIMPLE_ANIMATION_DRIVER=0
|
||||||
//@ pragma Env QS_NO_RELOAD_POPUP=1
|
//@ pragma Env QS_NO_RELOAD_POPUP=1
|
||||||
//@ pragma Env QT_SCALE_FACTOR_ROUNDING_POLICY=Round
|
//@ pragma Env QT_SCALE_FACTOR_ROUNDING_POLICY=Round
|
||||||
|
|||||||
Reference in New Issue
Block a user