Bring on gradient borders
This commit is contained in:
+17
-11
@@ -3,6 +3,7 @@ import Quickshell.Io
|
||||
import Quickshell.Wayland
|
||||
import QtQuick
|
||||
import qs.Commons
|
||||
import qs.Ui
|
||||
import "MenuModel.js" as MenuModel
|
||||
|
||||
Item {
|
||||
@@ -77,9 +78,12 @@ Item {
|
||||
property color background: Color.menu.background
|
||||
property color foreground: Color.menu.text
|
||||
property color border: Color.menu.border
|
||||
property var borderSpec: Border.surfaceSpec("menu", "border", border, Math.max(1, Style.space(2)))
|
||||
property color scrim: Color.menu.scrim
|
||||
property color selectedBackground: Color.menu.selectedBackground
|
||||
property color selectedText: Color.menu.selectedText
|
||||
property color selectedBorder: Color.menu.selectedBorder
|
||||
property var selectedBorderSpec: Border.surfaceSpec("menu", "selected-border", selectedBorder, 0)
|
||||
readonly property int cornerRadius: Style.cornerRadius
|
||||
property int contentMargin: Style.spacing.panelPadding
|
||||
property int headerHeight: Math.max(Style.space(34), Style.font.title + Style.spacing.controlPaddingY * 2)
|
||||
@@ -787,15 +791,15 @@ Item {
|
||||
onClicked: root.cancel()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
BorderSurface {
|
||||
id: card
|
||||
width: root.cardWidth
|
||||
height: root.cardHeight
|
||||
radius: root.cornerRadius
|
||||
anchors.centerIn: parent
|
||||
color: root.background
|
||||
border.color: root.border
|
||||
border.width: Math.max(1, Style.space(2))
|
||||
borderSpec: root.borderSpec
|
||||
padding: root.contentMargin
|
||||
|
||||
MouseArea { anchors.fill: parent; onClicked: {} }
|
||||
|
||||
@@ -842,7 +846,10 @@ Item {
|
||||
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
anchors.margins: root.contentMargin
|
||||
anchors.topMargin: card.contentTopInset
|
||||
anchors.rightMargin: card.contentRightInset
|
||||
anchors.bottomMargin: card.contentBottomInset
|
||||
anchors.leftMargin: card.contentLeftInset
|
||||
spacing: root.contentSpacing
|
||||
|
||||
Rectangle {
|
||||
@@ -850,7 +857,6 @@ Item {
|
||||
height: root.headerHeight
|
||||
radius: root.cornerRadius
|
||||
color: "transparent"
|
||||
border.width: 0
|
||||
|
||||
Text {
|
||||
anchors.left: parent.left
|
||||
@@ -898,7 +904,7 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
delegate: Rectangle {
|
||||
delegate: BorderSurface {
|
||||
id: row
|
||||
required property int index
|
||||
required property string itemId
|
||||
@@ -918,7 +924,7 @@ Item {
|
||||
height: root.rowHeightForDetail(row.detail)
|
||||
radius: root.cornerRadius
|
||||
color: row.hasCursor ? root.selectedBackground : "transparent"
|
||||
border.width: 0
|
||||
borderSpec: row.hasCursor ? root.selectedBorderSpec : Border.none()
|
||||
|
||||
Rectangle {
|
||||
visible: false
|
||||
@@ -927,7 +933,7 @@ Item {
|
||||
radius: Math.min(root.cornerRadius, Style.space(4))
|
||||
color: root.selectedBackground
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Style.space(8)
|
||||
anchors.leftMargin: row.borderLeft + Style.space(8)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
@@ -942,14 +948,14 @@ Item {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Style.space(8)
|
||||
anchors.leftMargin: row.borderLeft + Style.space(8)
|
||||
y: contentColumn.y + labelText.y + (labelText.height - height) / 2
|
||||
}
|
||||
|
||||
Column {
|
||||
id: contentColumn
|
||||
anchors.left: row.hasIcon ? iconText.right : parent.left
|
||||
anchors.leftMargin: row.hasIcon ? Style.space(6) : Style.space(18)
|
||||
anchors.leftMargin: row.hasIcon ? Style.space(6) : row.borderLeft + Style.space(18)
|
||||
anchors.right: trail.left
|
||||
anchors.rightMargin: Style.space(6)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@@ -982,7 +988,7 @@ Item {
|
||||
id: trail
|
||||
width: Style.space(14)
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.space(8)
|
||||
anchors.rightMargin: row.borderRight + Style.space(8)
|
||||
y: contentColumn.y + labelText.y + (labelText.height - height) / 2
|
||||
spacing: 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user