fix: sidebar gap with utils due to deform
Also better sync utils width with sidebar width
This commit is contained in:
parent
04efa4d39d
commit
6cdecb8825
5 changed files with 15 additions and 4 deletions
|
|
@ -166,7 +166,7 @@ Variants {
|
|||
panel: panels.sidebar
|
||||
bar: bar
|
||||
deformAmount: 0.05
|
||||
height: panel.height + 2
|
||||
implicitHeight: panel.height * (1 / rawDeformMatrix.m22) + 2
|
||||
exclude: panels.sidebar.offsetScale > 0.08 ? [] : [utilsBg]
|
||||
bottomLeftRadius: Math.max(0, Math.min(1, panels.sidebar.offsetScale / 0.3)) * radius
|
||||
}
|
||||
|
|
@ -247,6 +247,8 @@ Variants {
|
|||
visibilities: visibilities
|
||||
bar: bar
|
||||
|
||||
utilities.horizontalStretch: (sidebarBg.rawDeformMatrix.m11 - 1) / 2 + 1
|
||||
|
||||
dashboard.transform: Matrix4x4 {
|
||||
matrix: dashBg.deformMatrix
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ Item {
|
|||
required property DrawerVisibilities visibilities
|
||||
required property Sidebar.Wrapper sidebar
|
||||
required property BarPopouts.Wrapper popouts
|
||||
property real horizontalStretch
|
||||
|
||||
readonly property PersistentProperties props: PersistentProperties {
|
||||
property bool recordingListExpanded: false
|
||||
|
|
@ -28,7 +29,7 @@ Item {
|
|||
visible: offsetScale < 1
|
||||
anchors.bottomMargin: (-implicitHeight - 5) * offsetScale
|
||||
implicitHeight: content.implicitHeight + content.anchors.margins * 2
|
||||
implicitWidth: sidebar.width * (1 - sidebar.offsetScale) * sidebarLerp + Config.utilities.sizes.width * (1 - sidebarLerp)
|
||||
implicitWidth: sidebar.width * (1 - sidebar.offsetScale) * horizontalStretch * sidebarLerp + Config.utilities.sizes.width * (1 - sidebarLerp)
|
||||
opacity: 1 - offsetScale
|
||||
|
||||
states: State {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ void BlobRect::updatePolish() {
|
|||
m_dm11 = 1.0f;
|
||||
m_dmVel00 = m_dmVel01 = m_dmVel11 = 0.0f;
|
||||
m_deformMatrix = QMatrix4x4();
|
||||
emit rawDeformMatrixChanged();
|
||||
updateCenteredDeformMatrix();
|
||||
m_physicsActive = false;
|
||||
} else {
|
||||
|
|
@ -113,6 +114,7 @@ void BlobRect::updatePhysics() {
|
|||
m_dm11 += m_dmVel11 * dt;
|
||||
|
||||
m_deformMatrix = QMatrix4x4(m_dm00, m_dm01, 0, 0, m_dm01, m_dm11, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
||||
emit rawDeformMatrixChanged();
|
||||
updateCenteredDeformMatrix();
|
||||
|
||||
checkAtRest(speed);
|
||||
|
|
@ -235,6 +237,7 @@ void BlobRect::checkAtRest(float speed) {
|
|||
m_dmVel01 = 0.0f;
|
||||
m_dmVel11 = 0.0f;
|
||||
m_deformMatrix = QMatrix4x4(); // identity
|
||||
emit rawDeformMatrixChanged();
|
||||
updateCenteredDeformMatrix();
|
||||
m_physicsActive = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,8 +86,10 @@ void BlobShape::updateCenteredDeformMatrix() {
|
|||
result.translate(cx, cy);
|
||||
result *= m_deformMatrix;
|
||||
result.translate(-cx, -cy);
|
||||
m_centeredDeformMatrix = result;
|
||||
emit deformMatrixChanged();
|
||||
if (m_centeredDeformMatrix != result) {
|
||||
m_centeredDeformMatrix = result;
|
||||
emit deformMatrixChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void BlobShape::cornerRadii(float out[4]) const {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ class BlobShape : public QQuickItem {
|
|||
Q_PROPERTY(BlobGroup* group READ group WRITE setGroup NOTIFY groupChanged)
|
||||
Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged)
|
||||
Q_PROPERTY(QMatrix4x4 deformMatrix READ deformMatrix NOTIFY deformMatrixChanged)
|
||||
Q_PROPERTY(QMatrix4x4 rawDeformMatrix READ rawDeformMatrix NOTIFY rawDeformMatrixChanged)
|
||||
|
||||
friend class BlobGroup;
|
||||
|
||||
|
|
@ -29,11 +30,13 @@ public:
|
|||
void setRadius(qreal r);
|
||||
|
||||
QMatrix4x4 deformMatrix() const { return m_centeredDeformMatrix; }
|
||||
QMatrix4x4 rawDeformMatrix() const { return m_deformMatrix; }
|
||||
|
||||
signals:
|
||||
void groupChanged();
|
||||
void radiusChanged();
|
||||
void deformMatrixChanged();
|
||||
void rawDeformMatrixChanged();
|
||||
|
||||
protected:
|
||||
void componentComplete() override;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue