mirror of
https://github.com/belsabbagh/dotfiles.git
synced 2026-04-11 09:36:46 +00:00
quickshell and hyprland additions
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import Caelestia
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
|
||||
IconImage {
|
||||
id: root
|
||||
|
||||
required property color colour
|
||||
|
||||
asynchronous: true
|
||||
|
||||
layer.enabled: true
|
||||
layer.effect: Colouriser {
|
||||
sourceColor: analyser.dominantColour
|
||||
colorizationColor: root.colour
|
||||
}
|
||||
|
||||
layer.onEnabledChanged: {
|
||||
if (layer.enabled && status === Image.Ready)
|
||||
analyser.requestUpdate();
|
||||
}
|
||||
|
||||
onStatusChanged: {
|
||||
if (layer.enabled && status === Image.Ready)
|
||||
analyser.requestUpdate();
|
||||
}
|
||||
|
||||
ImageAnalyser {
|
||||
id: analyser
|
||||
|
||||
sourceItem: root
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import ".."
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
|
||||
MultiEffect {
|
||||
property color sourceColor: "black"
|
||||
|
||||
colorization: 1
|
||||
brightness: 1 - sourceColor.hslLightness
|
||||
|
||||
Behavior on colorizationColor {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import ".."
|
||||
import qs.services
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
|
||||
RectangularShadow {
|
||||
property int level
|
||||
property real dp: [0, 1, 3, 6, 8, 12][level]
|
||||
|
||||
color: Qt.alpha(Colours.palette.m3shadow, 0.7)
|
||||
blur: (dp * 5) ** 0.7
|
||||
spread: -dp * 0.3 + (dp * 0.1) ** 2
|
||||
offset.y: dp / 2
|
||||
|
||||
Behavior on dp {
|
||||
Anim {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
|
||||
StyledRect {
|
||||
property alias innerRadius: maskInner.radius
|
||||
property alias thickness: maskInner.anchors.margins
|
||||
property alias leftThickness: maskInner.anchors.leftMargin
|
||||
property alias topThickness: maskInner.anchors.topMargin
|
||||
property alias rightThickness: maskInner.anchors.rightMargin
|
||||
property alias bottomThickness: maskInner.anchors.bottomMargin
|
||||
|
||||
anchors.fill: parent
|
||||
color: Colours.tPalette.m3surfaceContainer
|
||||
|
||||
layer.enabled: true
|
||||
layer.effect: MultiEffect {
|
||||
maskSource: mask
|
||||
maskEnabled: true
|
||||
maskInverted: true
|
||||
maskThresholdMin: 0.5
|
||||
maskSpreadAtMin: 1
|
||||
}
|
||||
|
||||
Item {
|
||||
id: mask
|
||||
|
||||
anchors.fill: parent
|
||||
layer.enabled: true
|
||||
visible: false
|
||||
|
||||
Rectangle {
|
||||
id: maskInner
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Appearance.padding.normal
|
||||
radius: Appearance.rounding.small
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
|
||||
ShaderEffect {
|
||||
required property Item source
|
||||
required property Item maskSource
|
||||
|
||||
fragmentShader: Qt.resolvedUrl(`${Quickshell.shellDir}/assets/shaders/opacitymask.frag.qsb`)
|
||||
}
|
||||
Reference in New Issue
Block a user