added tray menu + fixed antialising
This commit is contained in:
@@ -128,16 +128,11 @@ PanelWindow {
|
||||
implicitWidth: Theme.padM * 2
|
||||
implicitHeight: Theme.barHeight
|
||||
|
||||
Rectangle {
|
||||
Skew {
|
||||
anchors.centerIn: parent
|
||||
width: 1
|
||||
height: 20
|
||||
color: Theme.alpha(Theme.outline, 0.9)
|
||||
|
||||
transform: Matrix4x4 {
|
||||
matrix: Qt.matrix4x4(1, -Theme.skew, 0, 20 * Theme.skew,
|
||||
0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,13 @@ Item {
|
||||
readonly property real ruleInset: 5
|
||||
readonly property real ruleBand: root.standalone ? 0 : root.ruleHeight + root.ruleInset
|
||||
|
||||
// Modules with a notion of progress (the player's track position) draw it in
|
||||
// the same band, so it can never be struck through the content. A module
|
||||
// cannot do this for itself: anything it declares becomes a child of the
|
||||
// content holder, whose bottom edge is above the band, and the rule lands
|
||||
// across the text instead of under it. Negative means "no progress".
|
||||
property real progress: -1
|
||||
|
||||
// Total horizontal inset a module must add on top of its content width.
|
||||
readonly property real contentPad: standalone
|
||||
? (panelLoader.item?.contentPad ?? root.padding)
|
||||
@@ -100,16 +107,24 @@ Item {
|
||||
height: root.ruleHeight
|
||||
clip: true
|
||||
|
||||
Rectangle {
|
||||
// Track progress, shown until the pointer arrives and the hover rule
|
||||
// takes the band over.
|
||||
Skew {
|
||||
height: parent.height
|
||||
width: parent.width * Math.max(0, Math.min(1, root.progress))
|
||||
color: Theme.accent
|
||||
visible: root.progress >= 0 && !root.hovered && !root.active
|
||||
|
||||
Behavior on width {
|
||||
NumberAnimation { duration: 480; easing.type: Easing.OutQuad }
|
||||
}
|
||||
}
|
||||
|
||||
Skew {
|
||||
height: parent.height
|
||||
width: root.hovered || root.active ? parent.width : 0
|
||||
color: root.accent
|
||||
|
||||
transform: Matrix4x4 {
|
||||
matrix: Qt.matrix4x4(1, -Theme.skew, 0, 2 * Theme.skew,
|
||||
0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
|
||||
}
|
||||
|
||||
Behavior on width {
|
||||
NumberAnimation { duration: Theme.durBase; easing.type: Easing.OutExpo }
|
||||
}
|
||||
|
||||
@@ -50,15 +50,11 @@ BarPill {
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Skew {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: 2
|
||||
height: 22
|
||||
color: Theme.alpha(Theme.accent, 0.6)
|
||||
transform: Matrix4x4 {
|
||||
matrix: Qt.matrix4x4(1, -Theme.skew, 0, 22 * Theme.skew,
|
||||
0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
|
||||
}
|
||||
}
|
||||
|
||||
SplitText {
|
||||
|
||||
@@ -16,6 +16,9 @@ BarPill {
|
||||
padding: Theme.padS
|
||||
visible: Media.hasPlayer || width > 1
|
||||
|
||||
// Track position, drawn by the pill in its own rule band.
|
||||
progress: Media.canSeek ? Media.progress : -1
|
||||
|
||||
implicitWidth: Media.hasPlayer
|
||||
? layout.implicitWidth + contentPad * 2
|
||||
: 0
|
||||
@@ -83,12 +86,21 @@ BarPill {
|
||||
}
|
||||
}
|
||||
|
||||
// Title and artist size to the text, up to a cap.
|
||||
//
|
||||
// These used to be a flat 130px wide each, which meant a short title
|
||||
// still reserved 130px and left a hand-sized hole between the artist and
|
||||
// the equaliser — the pill looked broken rather than compact. They take
|
||||
// what they need now and only start scrolling past the cap.
|
||||
Column {
|
||||
id: meta
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 0
|
||||
|
||||
readonly property real cap: 150
|
||||
|
||||
Marquee {
|
||||
width: 130
|
||||
width: Math.min(meta.cap, implicitWidth)
|
||||
height: 14
|
||||
text: Media.title || Media.identity
|
||||
color: Theme.text
|
||||
@@ -99,7 +111,7 @@ BarPill {
|
||||
}
|
||||
|
||||
Marquee {
|
||||
width: 130
|
||||
width: Math.min(meta.cap, implicitWidth)
|
||||
height: 12
|
||||
text: Media.artist || Media.album || Media.identity
|
||||
color: Theme.muted
|
||||
@@ -146,22 +158,6 @@ BarPill {
|
||||
}
|
||||
}
|
||||
|
||||
// Track progress, hairline along the bottom of the pill.
|
||||
Rectangle {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 3
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: root.leanInset
|
||||
width: Math.max(0, (root.width - root.leanInset * 2) * Media.progress)
|
||||
height: 2
|
||||
color: Theme.accent
|
||||
visible: Media.canSeek
|
||||
|
||||
Behavior on width {
|
||||
NumberAnimation { duration: 480; easing.type: Easing.OutQuad }
|
||||
}
|
||||
}
|
||||
|
||||
onVisibleChanged: if (visible) titleGlitch.restart()
|
||||
|
||||
Connections {
|
||||
|
||||
@@ -35,7 +35,7 @@ BarPill {
|
||||
}
|
||||
|
||||
// Unread badge, chopped like everything else.
|
||||
Rectangle {
|
||||
Skew {
|
||||
visible: Notifs.unread > 0 && !Notifs.dnd
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 2
|
||||
@@ -45,6 +45,8 @@ BarPill {
|
||||
height: 12
|
||||
color: Theme.accent
|
||||
|
||||
// The badge count stays upright. It used to inherit the shear from the
|
||||
// transform on the block below, which at 8px left the digits smeared.
|
||||
Text {
|
||||
id: badge
|
||||
anchors.centerIn: parent
|
||||
@@ -55,11 +57,6 @@ BarPill {
|
||||
font.weight: Font.Bold
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
transform: Matrix4x4 {
|
||||
matrix: Qt.matrix4x4(1, -Theme.skew, 0, 12 * Theme.skew,
|
||||
0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
||||
@@ -177,17 +177,12 @@ PanelWindow {
|
||||
implicitWidth: Theme.railWidth
|
||||
implicitHeight: Theme.padM + 4
|
||||
|
||||
Rectangle {
|
||||
Skew {
|
||||
anchors.centerIn: parent
|
||||
width: 22
|
||||
height: 1
|
||||
vertical: true
|
||||
color: Theme.alpha(Theme.outline, 0.9)
|
||||
|
||||
transform: Matrix4x4 {
|
||||
matrix: Qt.matrix4x4(1, 0, 0, 0,
|
||||
-Theme.skew, 1, 0, 22 * Theme.skew / 2,
|
||||
0, 0, 1, 0, 0, 0, 0, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,15 +49,11 @@ BarPill {
|
||||
}
|
||||
}
|
||||
|
||||
component Divider: Rectangle {
|
||||
component Divider: Skew {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: 1
|
||||
height: 18
|
||||
color: Theme.alpha(Theme.outline, 0.8)
|
||||
transform: Matrix4x4 {
|
||||
matrix: Qt.matrix4x4(1, -Theme.skew, 0, 18 * Theme.skew,
|
||||
0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
|
||||
}
|
||||
}
|
||||
|
||||
// The CPU/MEM/GPU labels are gone: three characters of chrome per metric,
|
||||
|
||||
@@ -5,6 +5,7 @@ import Quickshell.Services.SystemTray
|
||||
import Quickshell.Widgets
|
||||
import "root:/config"
|
||||
import "root:/components"
|
||||
import "root:/popouts"
|
||||
|
||||
// StatusNotifier tray, as a vertical column for the right-hand rail. Left click
|
||||
// activates, right click opens the app's own menu, middle click is the
|
||||
@@ -72,7 +73,7 @@ Column {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onTapped: {
|
||||
if (entry.modelData.onlyMenu) {
|
||||
menuAnchor.open();
|
||||
menu.toggle();
|
||||
} else {
|
||||
entry.modelData.activate();
|
||||
}
|
||||
@@ -81,7 +82,9 @@ Column {
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.RightButton
|
||||
onTapped: menuAnchor.open()
|
||||
onTapped: {
|
||||
if (entry.modelData.hasMenu) menu.toggle();
|
||||
}
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
@@ -90,13 +93,10 @@ Column {
|
||||
}
|
||||
|
||||
// Menus open to the left, into the screen rather than off its edge.
|
||||
QsMenuAnchor {
|
||||
id: menuAnchor
|
||||
menu: entry.modelData.menu
|
||||
anchor.item: entry
|
||||
anchor.edges: Edges.Left
|
||||
anchor.gravity: Edges.Left
|
||||
anchor.margins.right: Theme.popoutGap
|
||||
TrayMenu {
|
||||
id: menu
|
||||
anchorItem: entry
|
||||
menuHandle: entry.modelData.menu
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Skew {
|
||||
id: tick
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -89,18 +89,10 @@ Item {
|
||||
if (pip.occupied) return Theme.alpha(Theme.text, 0.5);
|
||||
return "transparent";
|
||||
}
|
||||
border.color: pip.occupied || pip.focused
|
||||
borderColor: pip.occupied || pip.focused
|
||||
? "transparent"
|
||||
: Theme.alpha(Theme.text, 0.35)
|
||||
border.width: 1
|
||||
|
||||
transform: Matrix4x4 {
|
||||
matrix: Qt.matrix4x4(
|
||||
1, -Theme.skew, 0, pip.height * Theme.skew,
|
||||
0, 1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1)
|
||||
}
|
||||
borderWidth: 1
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation { duration: Theme.durBase }
|
||||
|
||||
Reference in New Issue
Block a user