misc qs updates
This commit is contained in:
parent
ee9bb5b3fc
commit
3c91610d5a
9 changed files with 60 additions and 147 deletions
|
|
@ -7,11 +7,10 @@ import "systray" as SysTray
|
|||
import "audio" as Audio
|
||||
import "mpris" as Mpris
|
||||
import "power" as Power
|
||||
import "root:notifications" as Notifs
|
||||
import "../notifications" as Notifs
|
||||
|
||||
BarContainment {
|
||||
id: root
|
||||
|
||||
property bool isSoleBar: Quickshell.screens.length == 1;
|
||||
|
||||
ColumnLayout {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Wayland
|
||||
import ".."
|
||||
import "../lock" as Lock
|
||||
|
|
@ -15,41 +16,58 @@ PanelWindow {
|
|||
bottom: true
|
||||
}
|
||||
|
||||
width: 70
|
||||
exclusiveZone: width - margins.left
|
||||
property real baseWidth: 55
|
||||
property real leftMargin: root.compactState * 10
|
||||
width: baseWidth + 15
|
||||
exclusiveZone: baseWidth + (isFullscreenWorkspace ? 0 : 15) - margins.left
|
||||
|
||||
mask: Region {
|
||||
height: root.height
|
||||
width: root.exclusiveZone
|
||||
}
|
||||
|
||||
color: "transparent"
|
||||
|
||||
WlrLayershell.namespace: "shell:bar"
|
||||
|
||||
readonly property var tooltip: tooltip;
|
||||
readonly property Tooltip tooltip: tooltip;
|
||||
Tooltip {
|
||||
id: tooltip
|
||||
bar: root
|
||||
}
|
||||
|
||||
readonly property real tooltipXOffset: root.width + 2;
|
||||
readonly property real tooltipXOffset: root.baseWidth + root.leftMargin + 5;
|
||||
|
||||
function boundedY(targetY: real, height: real): real {
|
||||
return Math.max(barRect.anchors.topMargin + height, Math.min(barRect.height + barRect.anchors.topMargin - height, targetY))
|
||||
}
|
||||
|
||||
readonly property bool isFullscreenWorkspace: Hyprland.monitorFor(screen).activeWorkspace.hasFullscreen
|
||||
property real compactState: isFullscreenWorkspace ? 0 : 1
|
||||
Behavior on compactState {
|
||||
NumberAnimation {
|
||||
duration: 600
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: [0.0, 0.75, 0.15, 1.0, 1.0, 1.0]
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: barRect
|
||||
|
||||
x: 10 - Lock.Controller.lockSlide * (barRect.width + 10)
|
||||
x: root.leftMargin - Lock.Controller.lockSlide * (barRect.width + root.leftMargin)
|
||||
width: parent.width - 15
|
||||
|
||||
anchors {
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
margins: 10
|
||||
margins: root.compactState * 10
|
||||
}
|
||||
|
||||
color: ShellGlobals.colors.bar
|
||||
radius: 5
|
||||
radius: root.compactState * 5
|
||||
border.color: ShellGlobals.colors.barOutline
|
||||
border.width: 1
|
||||
border.width: root.compactState
|
||||
|
||||
Item {
|
||||
id: containment
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ FullwidthMouseArea {
|
|||
property int wsIndex: root.wsBaseIndex + index;
|
||||
property HyprlandWorkspace workspace: null;
|
||||
property bool exists: workspace != null;
|
||||
property bool active: (root.monitor?.activeWorkspace ?? false) && root.monitor.activeWorkspace == workspace;
|
||||
property bool active: workspace?.active ?? false
|
||||
|
||||
onActiveChanged: {
|
||||
if (active) root.currentIndex = wsIndex;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ BarWidgetInner {
|
|||
}
|
||||
|
||||
id: column;
|
||||
implicitHeight: childrenRect.height;
|
||||
spacing: 5;
|
||||
|
||||
Loader {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ T.Slider {
|
|||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitHandleHeight + topPadding + bottomPadding)
|
||||
|
||||
property color barColor: "#80ceffff"
|
||||
property color grooveColor: "#30ceffff"
|
||||
|
||||
background: Rectangle {
|
||||
x: control.leftPadding
|
||||
y: control.topPadding + control.availableHeight / 2 - height / 2
|
||||
|
|
@ -18,7 +21,7 @@ T.Slider {
|
|||
height: implicitHeight
|
||||
|
||||
radius: 5
|
||||
color: "#30ceffff"
|
||||
color: control.grooveColor
|
||||
border.width: 0
|
||||
|
||||
Rectangle {
|
||||
|
|
@ -29,7 +32,7 @@ T.Slider {
|
|||
|
||||
width: control.handle.x + (control.handle.width / 2) - parent.x
|
||||
radius: parent.radius
|
||||
color: "#80ceffff"
|
||||
color: control.barColor
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,15 @@ FullwidthMouseArea {
|
|||
|
||||
property alias widgetOpen: persist.widgetOpen;
|
||||
|
||||
acceptedButtons: Qt.RightButton
|
||||
onPressed: widgetOpen = !widgetOpen
|
||||
acceptedButtons: Qt.RightButton | Qt.ForwardButton | Qt.BackButton
|
||||
onPressed: event => {
|
||||
if (event.button == Qt.RightButton) widgetOpen = !widgetOpen;
|
||||
else if (event.button == Qt.ForwardButton) {
|
||||
MprisController.next();
|
||||
} else if (event.button == Qt.BackButton) {
|
||||
MprisController.previous();
|
||||
}
|
||||
}
|
||||
|
||||
onWheel: event => {
|
||||
event.accepted = true;
|
||||
|
|
@ -664,6 +671,20 @@ FullwidthMouseArea {
|
|||
}
|
||||
}
|
||||
|
||||
ColorQuantizer {
|
||||
id: quant
|
||||
rescaleSize: 200
|
||||
depth: 0
|
||||
source: MprisController.activeTrack.artUrl
|
||||
onColorsChanged: console.log(colors)
|
||||
}
|
||||
|
||||
grooveColor: quant.colors.length === 0 ? "#30ceffff" : Qt.alpha(quant.colors[0], 0.2)
|
||||
barColor: quant.colors.length === 0 ? "#80ceffff" : Qt.alpha(Qt.lighter(quant.colors[0]), 0.5)
|
||||
|
||||
Behavior on grooveColor { ColorAnimation { duration: 200 } }
|
||||
Behavior on barColor { ColorAnimation { duration: 200 } }
|
||||
|
||||
Layout.fillWidth: true
|
||||
enabled: player.canSeek
|
||||
from: 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue