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