forked from Shinonome/dots-hyprland
changes from main n stuff
This commit is contained in:
@@ -18,9 +18,11 @@ Item {
|
||||
property int screenWidth: QsWindow.window.width
|
||||
property int screenHeight: QsWindow.window.height
|
||||
|
||||
// Signals
|
||||
// Signals & loading
|
||||
signal requestFocus()
|
||||
signal dismissed()
|
||||
property bool load: true
|
||||
property bool shown: true
|
||||
|
||||
// Some info
|
||||
property int reservedTop: 0
|
||||
|
||||
@@ -10,6 +10,8 @@ import "../../common/widgets/shapes/material-shapes.js" as MaterialShapes
|
||||
import "../../common/widgets/shapes/shapes/corner-rounding.js" as CornerRounding
|
||||
import "../../common/widgets/shapes/geometry/offset.js" as Offset
|
||||
|
||||
import "bar"
|
||||
|
||||
/**
|
||||
* Fullscreen layer. Uses masking to not block clicks on windows n' stuff.
|
||||
*/
|
||||
@@ -35,15 +37,31 @@ PanelWindow {
|
||||
///////////////// Content //////////////////
|
||||
|
||||
property alias roundedPolygon: backgroundShape.roundedPolygon
|
||||
property bool finishedMorphing: true
|
||||
onRoundedPolygonChanged: finishedMorphing = false
|
||||
Connections {
|
||||
target: backgroundShape
|
||||
function onProgressChanged() {
|
||||
// While it overshoots because of the spring animation, waiting for the bounce to finish entirely would be too slow
|
||||
// ^ (totally not an excuse for my laziness)
|
||||
if (backgroundShape.progress >= 1.0) {
|
||||
root.finishedMorphing = true
|
||||
}
|
||||
}
|
||||
}
|
||||
S.ShapeCanvas {
|
||||
id: backgroundShape
|
||||
anchors.fill: parent
|
||||
polygonIsNormalized: false
|
||||
roundedPolygon: MaterialShapes.customPolygon([new MaterialShapes.PointNRound(new Offset.Offset(root.screen.width, 0), new CornerRounding.CornerRounding(9999)),])
|
||||
animation: NumberAnimation {
|
||||
duration: 500
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: Appearance.animationCurves.expressiveDefaultSpatial
|
||||
// animation: NumberAnimation {
|
||||
// duration: 500
|
||||
// easing.type: Easing.BezierSpline
|
||||
// easing.bezierCurve: Appearance.animationCurves.expressiveDefaultSpatial
|
||||
// }
|
||||
animation: SpringAnimation {
|
||||
spring: 3.5
|
||||
damping: 0.35
|
||||
}
|
||||
color: Appearance.colors.colLayer0
|
||||
borderWidth: (root.currentPanel === bar && Config.options.bar.cornerStyle !== 1) ? 0 : 1
|
||||
@@ -60,7 +78,8 @@ PanelWindow {
|
||||
color: "#44000000"
|
||||
}
|
||||
|
||||
property HAbstractMorphedPanel currentPanel: bar
|
||||
property HAbstractMorphedPanel currentPanel: null
|
||||
Component.onCompleted: currentPanel = bar
|
||||
roundedPolygon: currentPanel.backgroundPolygon
|
||||
|
||||
// Do we want to have reserved area always follow the bar or maybe differ per panel?
|
||||
@@ -89,10 +108,14 @@ PanelWindow {
|
||||
|
||||
HBar {
|
||||
id: bar
|
||||
load: root.currentPanel === this
|
||||
shown: root.finishedMorphing
|
||||
}
|
||||
|
||||
HOverview {
|
||||
id: overview
|
||||
load: root.currentPanel === this
|
||||
shown: root.finishedMorphing
|
||||
onRequestFocus: root.currentPanel = overview;
|
||||
onDismissed: root.dismiss();
|
||||
}
|
||||
|
||||
+17
-3
@@ -1,8 +1,11 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import qs.modules.common
|
||||
import "../../common/widgets/shapes/material-shapes.js" as MaterialShapes
|
||||
import "../../common/widgets/shapes/shapes/corner-rounding.js" as CornerRounding
|
||||
import "../../common/widgets/shapes/geometry/offset.js" as Offset
|
||||
import qs.modules.common.widgets
|
||||
import "../../../common/widgets/shapes/material-shapes.js" as MaterialShapes
|
||||
import "../../../common/widgets/shapes/shapes/corner-rounding.js" as CornerRounding
|
||||
import "../../../common/widgets/shapes/geometry/offset.js" as Offset
|
||||
import ".."
|
||||
|
||||
HAbstractMorphedPanel {
|
||||
id: root
|
||||
@@ -131,4 +134,15 @@ HAbstractMorphedPanel {
|
||||
easing.bezierCurve: Appearance.animationCurves.expressiveDefaultSpatial
|
||||
}
|
||||
}
|
||||
|
||||
FadeLazyLoader {
|
||||
id: contentLoader
|
||||
load: root.load
|
||||
shown: root.shown
|
||||
anchors.fill: parent
|
||||
component: HBarContent {
|
||||
parent: contentLoader
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.services
|
||||
import qs.modules.common.widgets
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
Side {
|
||||
id: leftSide
|
||||
anchors.left: parent.left
|
||||
width: (parent.width - centerSide.width) / 2
|
||||
}
|
||||
|
||||
Side {
|
||||
id: centerSide
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
FallbackLoader {
|
||||
asynchronous: true
|
||||
source: "/home/end/.config/quickshell/ii/modules/ii/bar/WrongModuleName"
|
||||
fallbacks: ["/home/end/.config/quickshell/ii/modules/ii/bar/Workspaces.qml"]
|
||||
}
|
||||
}
|
||||
|
||||
Side {
|
||||
id: rightSide
|
||||
anchors.right: parent.right
|
||||
width: (parent.width - centerSide.width) / 2
|
||||
}
|
||||
|
||||
component Side: RowLayout {
|
||||
anchors {
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user