1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

didnt mean to push topbar change

This commit is contained in:
bbedward
2025-09-18 19:01:32 -04:00
parent 32f3e579e7
commit 97f0acadb6

View File

@@ -1,7 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Effects import QtQuick.Effects
import QtQuick.Shapes
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import Quickshell.Services.Mpris import Quickshell.Services.Mpris
@@ -17,18 +16,12 @@ import qs.Widgets
PanelWindow { PanelWindow {
id: root id: root
WlrLayershell.namespace: "quickshell:bar" WlrLayershell.namespace: "quickshell:bar"
property var modelData property var modelData
property var notepadVariants: null property var notepadVariants: null
property bool wingtipsEnabled: true
property real wingtipsRadius: 12
readonly property real _wingR: Math.max(0, Math.min(wingtipsRadius, effectiveBarHeight))
readonly property color _bgColor: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, topBarCore.backgroundTransparency)
readonly property color _tintColor: Qt.rgba(Theme.surfaceTint.r, Theme.surfaceTint.g, Theme.surfaceTint.b, 0.04)
signal colorPickerRequested() signal colorPickerRequested()
function getNotepadInstanceForScreen() { function getNotepadInstanceForScreen() {
@@ -48,7 +41,7 @@ PanelWindow {
readonly property real widgetHeight: Math.max(20, 26 + SettingsData.topBarInnerPadding * 0.6) readonly property real widgetHeight: Math.max(20, 26 + SettingsData.topBarInnerPadding * 0.6)
screen: modelData screen: modelData
implicitHeight: effectiveBarHeight + SettingsData.topBarSpacing + (wingtipsEnabled ? _wingR : 0) implicitHeight: effectiveBarHeight + SettingsData.topBarSpacing
color: "transparent" color: "transparent"
Component.onCompleted: { Component.onCompleted: {
const fonts = Qt.fontFamilies() const fonts = Qt.fontFamilies()
@@ -139,7 +132,7 @@ PanelWindow {
exclusiveZone: (!SettingsData.topBarVisible || topBarCore.autoHide) ? -1 : root.effectiveBarHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap exclusiveZone: (!SettingsData.topBarVisible || topBarCore.autoHide) ? -1 : root.effectiveBarHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap
mask: Region { mask: Region {
item: barCanvas item: topBarMouseArea
} }
Item { Item {
@@ -255,80 +248,44 @@ PanelWindow {
anchors.leftMargin: SettingsData.topBarSpacing anchors.leftMargin: SettingsData.topBarSpacing
anchors.rightMargin: SettingsData.topBarSpacing anchors.rightMargin: SettingsData.topBarSpacing
Item { Rectangle {
id: barBackground
anchors.fill: parent anchors.fill: parent
anchors.bottomMargin: -(root.wingtipsEnabled ? root._wingR : 0) radius: SettingsData.topBarSquareCorners ? 0 : Theme.cornerRadius
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, topBarCore.backgroundTransparency)
layer.enabled: true
Canvas { Rectangle {
id: barCanvas
anchors.fill: parent anchors.fill: parent
antialiasing: true color: Qt.rgba(Theme.surfaceTint.r, Theme.surfaceTint.g, Theme.surfaceTint.b, 0.04)
renderTarget: Canvas.FramebufferObject radius: parent.radius
property real mainHeight: height - (root.wingtipsEnabled ? root._wingR : 0) SequentialAnimation on opacity {
property real wingRadius: root.wingtipsEnabled ? root._wingR : 0 running: false
property real topRadius: SettingsData.topBarSquareCorners ? 0 : Theme.cornerRadius loops: Animation.Infinite
onPaint: { NumberAnimation {
const ctx = getContext("2d") to: 0.08
const W = width, H = barCanvas.mainHeight, R = barCanvas.wingRadius, RT = barCanvas.topRadius duration: Theme.extraLongDuration
easing.type: Theme.standardEasing
ctx.reset()
ctx.clearRect(0, 0, W, height)
function tracePath() {
ctx.beginPath()
ctx.moveTo(RT, 0)
ctx.lineTo(W - RT, 0)
ctx.arcTo(W, 0, W, RT, RT)
ctx.lineTo(W, H)
if (R > 0) {
ctx.lineTo(W, H + R)
ctx.arc(W - R, H + R, R, 0, -Math.PI / 2, true)
ctx.lineTo(R, H)
ctx.arc(R, H + R, R, -Math.PI / 2, -Math.PI, true)
ctx.lineTo(0, H + R)
}
ctx.lineTo(0, RT)
ctx.arcTo(0, 0, RT, 0, RT)
ctx.closePath()
} }
ctx.fillStyle = root._bgColor NumberAnimation {
tracePath() to: 0.02
ctx.fill() duration: Theme.extraLongDuration
easing.type: Theme.standardEasing
ctx.fillStyle = root._tintColor }
tracePath()
ctx.fill()
}
layer.enabled: true
layer.samples: 4
layer.effect: MultiEffect {
shadowEnabled: true
shadowHorizontalOffset: 0
shadowVerticalOffset: 4
shadowBlur: 0.5
shadowColor: Qt.rgba(0, 0, 0, 0.15)
shadowOpacity: 0.15
} }
} }
}
}
Item { layer.effect: MultiEffect {
anchors.fill: parent shadowEnabled: true
anchors.topMargin: SettingsData.topBarSpacing shadowHorizontalOffset: 0
anchors.bottomMargin: 0 shadowVerticalOffset: 4
anchors.leftMargin: SettingsData.topBarSpacing shadowBlur: 0.5 // radius/32, adjusted for visual match
anchors.rightMargin: SettingsData.topBarSpacing shadowColor: Qt.rgba(0, 0, 0, 0.15)
shadowOpacity: 0.15
}
}
Item { Item {
id: topBarContent id: topBarContent
@@ -1080,7 +1037,6 @@ PanelWindow {
} }
} }
} }
} }
} }