Blob bounciness #67

Merged
zach merged 9 commits from bounce-test into main 2026-04-22 00:01:47 +02:00
11 changed files with 159 additions and 406 deletions
Showing only changes of commit c1035e8a06 - Show all commits
+16 -16
View File
@@ -96,25 +96,25 @@ CustomMouseArea {
if (dragY < -10) if (dragY < -10)
visibilities.dock = true; visibilities.dock = true;
if (panels.sidebar.width === 0) { if (panels.sidebar.width === 0) {
const showOsd = inRightPanel(panels.osd, x, y); const showOsd = inRightPanel(panels.osdWrapper, x, y);
if (showOsd) { if (showOsd) {
osdShortcutActive = false; osdShortcutActive = false;
root.panels.osd.hovered = true; root.panels.osd.hovered = true;
} }
} else { } else {
const outOfSidebar = x < width - panels.sidebar.width; const outOfSidebar = x < width - panels.sidebar.width;
const showOsd = outOfSidebar && inRightPanel(panels.osd, x, y); const showOsd = outOfSidebar && inRightPanel(panels.osdWrapper, x, y);
if (!osdShortcutActive) { if (!osdShortcutActive) {
visibilities.osd = showOsd; visibilities.osd = showOsd;
root.panels.osd.hovered = showOsd; root.panels.osd.hovered = showOsd;
} else if (showOsd) { } else if (showOsd) {
osdShortcutActive = false; osdShortcutActive = false;
root.panels.osd.hovered = true; root.panels.osd.hovered = true;
}
} }
}
if (Config.dock.enable && !Config.dock.hoverToReveal && !visibilities.dock && !visibilities.launcher && inBottomPanel(panels.dock, x, y)) if (Config.dock.enable && !Config.dock.hoverToReveal && !visibilities.dock && !visibilities.launcher && inBottomPanel(panels.dock, x, y))
visibilities.dock = true; visibilities.dock = true;
+23 -11
View File
@@ -26,6 +26,7 @@ Item {
readonly property alias launcher: launcher readonly property alias launcher: launcher
readonly property alias notifications: notifications readonly property alias notifications: notifications
readonly property alias osd: osd readonly property alias osd: osd
readonly property alias osdWrapper: osdWrapper
readonly property alias popouts: popouts.content readonly property alias popouts: popouts.content
readonly property alias popoutsWrapper: popouts readonly property alias popoutsWrapper: popouts
readonly property alias resources: resources readonly property alias resources: resources
@@ -48,6 +49,28 @@ Item {
visibilities: root.visibilities visibilities: root.visibilities
} }
Item {
id: osdWrapper
anchors.right: parent.right
anchors.rightMargin: sidebar.width * (1 - sidebar.offsetScale)
anchors.verticalCenter: parent.verticalCenter
clip: sidebar.visible
implicitHeight: osd.implicitHeight
implicitWidth: osd.implicitWidth * (1 - osd.offsetScale)
Osd.Wrapper {
id: osd
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
screen: root.screen
sidebarOrSessionVisible: sidebar.visible
visibilities: root.visibilities
}
}
Drawing.Wrapper { Drawing.Wrapper {
id: drawing id: drawing
@@ -58,17 +81,6 @@ Item {
visibilities: root.visibilities visibilities: root.visibilities
} }
Osd.Wrapper {
id: osd
anchors.right: parent.right
anchors.rightMargin: sidebar.width
anchors.verticalCenter: parent.verticalCenter
clip: sidebar.width > 0
screen: root.screen
visibilities: root.visibilities
}
Modules.ClipWrapper { Modules.ClipWrapper {
id: popouts id: popouts
+4 -2
View File
@@ -188,7 +188,7 @@ Variants {
bottomLeftRadius: 0 bottomLeftRadius: 0
deformAmount: 0.1 * Config.appearance.deform.scale deformAmount: 0.1 * Config.appearance.deform.scale
exclude: panels.sidebar.offsetscale > 0.08 ? [] : [utilsBg] exclude: panels.sidebar.offsetScale > 0.08 ? [] : [utilsBg]
implicitHeight: panel.height * (1 / rawDeformMatrix.m22) + 2 implicitHeight: panel.height * (1 / rawDeformMatrix.m22) + 2
panel: panels.sidebar panel: panels.sidebar
} }
@@ -197,8 +197,10 @@ Variants {
id: osdBg id: osdBg
deformAmount: 0.1 * Config.appearance.deform.scale deformAmount: 0.1 * Config.appearance.deform.scale
panel: panels.osd implicitWidth: panels.osd.width
panel: panels.osdWrapper
radius: 20 radius: 20
x: panels.osdWrapper.x + panels.osd.x + Config.barConfig.border
} }
PanelBg { PanelBg {
+19 -62
View File
@@ -17,76 +17,33 @@ Item {
readonly property real nonAnimHeight: state === "visible" ? (content.item?.nonAnimHeight ?? 0) : 0 readonly property real nonAnimHeight: state === "visible" ? (content.item?.nonAnimHeight ?? 0) : 0
required property PersistentProperties visibilities required property PersistentProperties visibilities
implicitHeight: 0 readonly property bool shouldBeActive: root.visibilities.dashboard && Config.dashboard.enabled
implicitWidth: content.implicitWidth property real offsetScale: shouldBeActive ? 0 : 1
visible: height > 0
states: State { visible: offsetScale < 1
name: "visible" anchors.topMargin: (-implicitHeight - 5) * offsetScale
when: root.visibilities.dashboard && Config.dashboard.enabled implicitHeight: content.implicitHeight
implicitWidth: content.implicitWidth || 854 // Hard coded fallback for first open
opacity: 1 - offsetScale
PropertyChanges { Behavior on offsetScale {
root.implicitHeight: content.implicitHeight Anim {
} duration: Appearance.anim.durations.expressiveDefaultSpatial
} easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
transitions: [
Transition {
from: ""
to: "visible"
Anim {
duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
property: "implicitHeight"
target: root
}
},
Transition {
from: "visible"
to: ""
Anim {
easing.bezierCurve: MaterialEasing.expressiveEffects
property: "implicitHeight"
target: root
}
}
]
onStateChanged: {
if (state === "visible" && timer.running) {
timer.triggered();
timer.stop();
} }
} }
Timer { Loader {
id: timer id: content
interval: Appearance.anim.durations.extraLarge anchors.bottom: parent.bottom
running: true anchors.horizontalCenter: parent.horizontalCenter
onTriggered: { active: root.shouldBeActive || root.visible
content.active = Qt.binding(() => (root.visibilities.dashboard && Config.dashboard.enabled) || root.visible);
content.visible = true;
}
}
CustomClippingRect { sourceComponent: Content {
anchors.fill: parent state: root.dashState
visibilities: root.visibilities
Loader {
id: content
active: true
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
visible: false
sourceComponent: Content {
state: root.dashState
visibilities: root.visibilities
}
} }
} }
} }
+13 -74
View File
@@ -11,97 +11,36 @@ Item {
property int contentHeight property int contentHeight
required property var panels required property var panels
required property ShellScreen screen required property ShellScreen screen
readonly property bool shouldBeActive: visibilities.dock
required property PersistentProperties visibilities required property PersistentProperties visibilities
implicitHeight: 0 readonly property bool shouldBeActive: visibilities.dock
implicitWidth: content.implicitWidth property real offsetScale: shouldBeActive ? 0 : 1
visible: height > 0
Behavior on implicitWidth { visible: offsetScale < 1
anchors.bottomMargin: (-implicitHeight - 5) * offsetScale
implicitHeight: content.implicitHeight
implicitWidth: content.implicitWidth || 400
opacity: 1 - offsetScale
Behavior on offsetScale {
Anim { Anim {
duration: Appearance.anim.durations.small duration: Appearance.anim.durations.expressiveDefaultSpatial
} easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
}
onShouldBeActiveChanged: {
if (shouldBeActive) {
timer.stop();
hideAnim.stop();
showAnim.start();
} else {
showAnim.stop();
hideAnim.start();
}
}
SequentialAnimation {
id: showAnim
Anim {
duration: Appearance.anim.durations.small
easing.bezierCurve: Appearance.anim.curves.expressiveEffects
property: "implicitHeight"
target: root
to: root.contentHeight
}
ScriptAction {
script: root.implicitHeight = Qt.binding(() => content.implicitHeight)
}
}
SequentialAnimation {
id: hideAnim
ScriptAction {
script: root.implicitHeight = root.implicitHeight
}
Anim {
easing.bezierCurve: Appearance.anim.curves.expressiveEffects
property: "implicitHeight"
target: root
to: 0
}
}
Timer {
id: timer
interval: Appearance.anim.durations.small
onRunningChanged: {
if (running && !root.shouldBeActive) {
content.visible = false;
content.active = true;
} else {
content.active = Qt.binding(() => root.shouldBeActive || root.visible);
content.visible = true;
if (showAnim.running) {
showAnim.stop();
showAnim.start();
}
}
} }
} }
Loader { Loader {
id: content id: content
active: false
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
visible: false
active: root.shouldBeActive || root.visible
sourceComponent: Content { sourceComponent: Content {
panels: root.panels panels: root.panels
screen: root.screen screen: root.screen
visibilities: root.visibilities visibilities: root.visibilities
Component.onCompleted: root.contentHeight = implicitHeight
} }
Component.onCompleted: timer.start()
} }
} }
+14 -45
View File
@@ -21,53 +21,27 @@ Item {
} }
required property var panels required property var panels
required property ShellScreen screen required property ShellScreen screen
readonly property bool shouldBeActive: visibilities.launcher
required property PersistentProperties visibilities required property PersistentProperties visibilities
readonly property bool shouldBeActive: visibilities.launcher
property real offsetScale: shouldBeActive ? 0 : 1
implicitHeight: 0 visible: offsetScale < 1
implicitWidth: content.implicitWidth anchors.bottomMargin: (-implicitHeight - 5) * offsetScale
visible: height > 0 implicitHeight: contentHeight
implicitWidth: content.implicitWidth || 400
opacity: 1 - offsetScale
Behavior on offsetScale {
Anim {
duration: Appearance.anim.durations.expressiveDefaultSpatial
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
}
}
onMaxHeightChanged: timer.start() onMaxHeightChanged: timer.start()
onShouldBeActiveChanged: { onShouldBeActiveChanged: {
if (shouldBeActive) { if (shouldBeActive) {
timer.stop(); timer.stop();
hideAnim.stop();
showAnim.start();
} else {
showAnim.stop();
hideAnim.start();
}
}
SequentialAnimation {
id: showAnim
Anim {
duration: Appearance.anim.durations.small
easing.bezierCurve: Appearance.anim.curves.expressiveEffects
property: "implicitHeight"
target: root
to: root.contentHeight
}
ScriptAction {
script: root.implicitHeight = Qt.binding(() => content.implicitHeight)
}
}
SequentialAnimation {
id: hideAnim
ScriptAction {
script: root.implicitHeight = root.implicitHeight
}
Anim {
easing.bezierCurve: Appearance.anim.curves.expressiveEffects
property: "implicitHeight"
target: root
to: 0
} }
} }
@@ -105,10 +79,6 @@ Item {
root.contentHeight = Math.min(root.maxHeight, content.implicitHeight); root.contentHeight = Math.min(root.maxHeight, content.implicitHeight);
content.active = Qt.binding(() => root.shouldBeActive || root.visible); content.active = Qt.binding(() => root.shouldBeActive || root.visible);
content.visible = true; content.visible = true;
if (showAnim.running) {
showAnim.stop();
showAnim.start();
}
} }
} }
} }
@@ -119,7 +89,6 @@ Item {
active: false active: false
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top anchors.top: parent.top
visible: false
sourceComponent: Content { sourceComponent: Content {
maxHeight: root.maxHeight maxHeight: root.maxHeight
+12 -52
View File
@@ -20,69 +20,29 @@ Item {
required property Item sidebar required property Item sidebar
required property var visibilities required property var visibilities
implicitHeight: 0 property real offsetScale: shouldBeActive ? 0 : 1
implicitWidth: sidebar.visible ? sidebar.width : Config.utilities.sizes.width
visible: height > 0
states: State { visible: offsetScale < 1
name: "visible" anchors.bottomMargin: (-implicitHeight - 5) * offsetScale
when: root.shouldBeActive implicitHeight: content.implicitHeight + 8 * 2
implicitWidth: sidebar.width * (1 - sidebar.offsetScale)
opacity: 1 - offsetScale
PropertyChanges { Behavior on offsetScale {
root.implicitHeight: content.implicitHeight + 8 * 2 Anim {
} duration: Appearance.anim.durations.expressiveDefaultSpatial
} easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
transitions: [
Transition {
from: ""
to: "visible"
Anim {
duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
property: "implicitHeight"
target: root
}
},
Transition {
from: "visible"
to: ""
Anim {
easing.bezierCurve: MaterialEasing.expressiveEffects
property: "implicitHeight"
target: root
}
}
]
onStateChanged: {
if (state === "visible" && timer.running) {
timer.triggered();
timer.stop();
}
}
Timer {
id: timer
interval: 1000
running: true
onTriggered: {
content.active = Qt.binding(() => root.shouldBeActive || root.visible);
content.visible = true;
} }
} }
Loader { Loader {
id: content id: content
active: true
anchors.left: parent.left anchors.left: parent.left
anchors.margins: 8 anchors.margins: 8
anchors.top: parent.top anchors.top: parent.top
visible: false
active: root.shouldBeActive || root.visible
sourceComponent: Content { sourceComponent: Content {
implicitWidth: root.implicitWidth - 8 * 2 implicitWidth: root.implicitWidth - 8 * 2
+12 -33
View File
@@ -12,57 +12,36 @@ Item {
} }
required property var visibilities required property var visibilities
implicitWidth: 0 readonly property bool shouldBeActive: root.visibilities.sidebar && Config.sidebar.enabled
visible: width > 0 property real offsetScale: shouldBeActive ? 0 : 1
states: State { visible: offsetScale < 1
name: "visible" anchors.rightMargin: (-implicitWidth - 5) * offsetScale
when: root.visibilities.sidebar implicitWidth: Config.sidebar.sizes.width
opacity: 1 - offsetScale
PropertyChanges { Behavior on offsetScale {
root.implicitWidth: Config.sidebar.sizes.width Anim {
duration: Appearance.anim.durations.expressiveDefaultSpatial
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
} }
} }
transitions: [
Transition {
from: ""
to: "visible"
Anim {
duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
property: "implicitWidth"
target: root
}
},
Transition {
from: "visible"
to: ""
Anim {
easing.bezierCurve: MaterialEasing.expressiveEffects
property: "implicitWidth"
target: root
}
}
]
Loader { Loader {
id: content id: content
active: true
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.bottomMargin: 0 anchors.bottomMargin: 0
anchors.left: parent.left anchors.left: parent.left
anchors.margins: 8 anchors.margins: 8
anchors.top: parent.top anchors.top: parent.top
active: root.shouldBeActive || root.visible
sourceComponent: Content { sourceComponent: Content {
implicitWidth: Config.sidebar.sizes.width - 8 * 2 implicitWidth: Config.sidebar.sizes.width - 8 * 2
props: root.props props: root.props
visibilities: root.visibilities visibilities: root.visibilities
} }
Component.onCompleted: active = Qt.binding(() => (root.visibilities.sidebar && Config.sidebar.enabled) || root.visible)
} }
} }
+2 -2
View File
@@ -22,8 +22,8 @@ Item {
} }
transitions: Transition { transitions: Transition {
Anim { Anim {
duration: MaterialEasing.expressiveEffectsTime duration: Appearance.anim.durations.expressiveDefaultSpatial
easing.bezierCurve: MaterialEasing.expressiveEffects easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
property: "implicitHeight" property: "implicitHeight"
target: root target: root
} }
+25 -47
View File
@@ -26,40 +26,22 @@ Item {
timer.restart(); timer.restart();
} }
property real offsetScale: shouldBeActive ? 0 : 1
required property bool sidebarOrSessionVisible
property real sidebarOffset: sidebarOrSessionVisible ? 12 : 0
visible: offsetScale < 1
anchors.rightMargin: (-implicitWidth - 5 - sidebarOffset) * offsetScale
implicitWidth: content.implicitWidth
implicitHeight: content.implicitHeight implicitHeight: content.implicitHeight
implicitWidth: 0 opacity: 1 - offsetScale
visible: width > 0
states: State { Behavior on offsetScale {
name: "visible" Anim {
when: root.shouldBeActive duration: Appearance.anim.durations.expressiveDefaultSpatial
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
PropertyChanges {
root.implicitWidth: content.implicitWidth
} }
} }
transitions: [
Transition {
from: ""
to: "visible"
Anim {
easing.bezierCurve: MaterialEasing.expressiveEffects
property: "implicitWidth"
target: root
}
},
Transition {
from: "visible"
to: ""
Anim {
easing.bezierCurve: MaterialEasing.expressiveEffects
property: "implicitWidth"
target: root
}
}
]
Component.onCompleted: { Component.onCompleted: {
volume = Audio.volume; volume = Audio.volume;
@@ -113,26 +95,22 @@ Item {
} }
} }
CustomClippingRect { Loader {
anchors.fill: parent id: content
Loader { anchors.left: parent.left
id: content anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left active: root.shouldBeActive || root.visible
anchors.verticalCenter: parent.verticalCenter
sourceComponent: Content { sourceComponent: Content {
brightness: root.brightness brightness: root.brightness
monitor: root.monitor monitor: root.monitor
muted: root.muted muted: root.muted
sourceMuted: root.sourceMuted sourceMuted: root.sourceMuted
sourceVolume: root.sourceVolume sourceVolume: root.sourceVolume
visibilities: root.visibilities visibilities: root.visibilities
volume: root.volume volume: root.volume
}
Component.onCompleted: active = Qt.binding(() => root.shouldBeActive || root.visible)
} }
} }
} }
+19 -62
View File
@@ -11,76 +11,33 @@ Item {
readonly property real nonAnimHeight: state === "visible" ? (content.item?.nonAnimHeight ?? 0) : 0 readonly property real nonAnimHeight: state === "visible" ? (content.item?.nonAnimHeight ?? 0) : 0
required property PersistentProperties visibilities required property PersistentProperties visibilities
implicitHeight: 0 readonly property bool shouldBeActive: root.visibilities.resources
implicitWidth: content.implicitWidth property real offsetScale: shouldBeActive ? 0 : 1
visible: height > 0
states: State { visible: offsetScale < 1
name: "visible" anchors.topMargin: (-implicitHeight - 5) * offsetScale
when: root.visibilities.resources implicitHeight: content.implicitHeight
implicitWidth: content.implicitWidth || 854 // Hard coded fallback for first open
opacity: 1 - offsetScale
PropertyChanges { Behavior on offsetScale {
root.implicitHeight: content.implicitHeight Anim {
} duration: Appearance.anim.durations.expressiveDefaultSpatial
} easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
transitions: [
Transition {
from: ""
to: "visible"
Anim {
duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
property: "implicitHeight"
target: root
}
},
Transition {
from: "visible"
to: ""
Anim {
easing.bezierCurve: MaterialEasing.expressiveEffects
property: "implicitHeight"
target: root
}
}
]
onStateChanged: {
if (state === "visible" && timer.running) {
timer.triggered();
timer.stop();
} }
} }
Timer { Loader {
id: timer id: content
interval: Appearance.anim.durations.extraLarge anchors.bottom: parent.bottom
running: true anchors.horizontalCenter: parent.horizontalCenter
onTriggered: { active: root.shouldBeActive || root.visible
content.active = Qt.binding(() => (root.visibilities.resources) || root.visible);
content.visible = true;
}
}
CustomClippingRect { sourceComponent: Content {
anchors.fill: parent padding: Appearance.padding.normal
visibilities: root.visibilities
Loader {
id: content
active: true
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
visible: false
sourceComponent: Content {
padding: Appearance.padding.normal
visibilities: root.visibilities
}
} }
} }
} }