feat: border + colour changes
This commit is contained in:
parent
cd45cafa60
commit
c665c0ca98
16 changed files with 126 additions and 18 deletions
|
|
@ -8,7 +8,6 @@ import Qt.labs.platform
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property bool borders: true
|
|
||||||
property bool light: false
|
property bool light: false
|
||||||
readonly property Transparency transparency: Transparency {}
|
readonly property Transparency transparency: Transparency {}
|
||||||
readonly property Rounding rounding: Rounding {}
|
readonly property Rounding rounding: Rounding {}
|
||||||
|
|
|
||||||
16
config/BackgroundConfig.qml
Normal file
16
config/BackgroundConfig.qml
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import Quickshell
|
||||||
|
import QtQuick
|
||||||
|
|
||||||
|
Singleton {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
readonly property Border border: Border {}
|
||||||
|
|
||||||
|
component Border: QtObject {
|
||||||
|
readonly property bool enabled: false
|
||||||
|
readonly property int thickness: Appearance.padding.normal
|
||||||
|
readonly property int rounding: Appearance.rounding.large
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -19,8 +19,7 @@ Singleton {
|
||||||
property int totalHeight: height
|
property int totalHeight: height
|
||||||
property int height: 40
|
property int height: 40
|
||||||
property int innerHeight: 30
|
property int innerHeight: 30
|
||||||
property int floatingGap: 10
|
property int floatingGap: 10 + BackgroundConfig.border.thickness
|
||||||
property int floatingGapLarge: 15
|
|
||||||
property int maxLabelWidth: 600
|
property int maxLabelWidth: 600
|
||||||
property int maxLabelHeight: 400
|
property int maxLabelHeight: 400
|
||||||
}
|
}
|
||||||
|
|
|
||||||
34
modules/background/Background.qml
Normal file
34
modules/background/Background.qml
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
import "root:/widgets"
|
||||||
|
import "root:/config"
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Wayland
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Effects
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
model: Quickshell.screens
|
||||||
|
|
||||||
|
Scope {
|
||||||
|
id: scope
|
||||||
|
|
||||||
|
required property ShellScreen modelData
|
||||||
|
|
||||||
|
Border {
|
||||||
|
screen: scope.modelData
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledWindow {
|
||||||
|
id: win
|
||||||
|
|
||||||
|
screen: scope.modelData
|
||||||
|
name: "background"
|
||||||
|
exclusionMode: ExclusionMode.Ignore
|
||||||
|
layer: WlrLayer.Background
|
||||||
|
|
||||||
|
anchors.top: true
|
||||||
|
anchors.bottom: true
|
||||||
|
anchors.left: true
|
||||||
|
anchors.right: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
57
modules/background/Border.qml
Normal file
57
modules/background/Border.qml
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
import "root:/widgets"
|
||||||
|
import "root:/config"
|
||||||
|
import Quickshell
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Effects
|
||||||
|
|
||||||
|
StyledWindow {
|
||||||
|
id: win
|
||||||
|
|
||||||
|
name: "border"
|
||||||
|
exclusionMode: ExclusionMode.Ignore
|
||||||
|
|
||||||
|
mask: Region {
|
||||||
|
x: BackgroundConfig.border.thickness
|
||||||
|
y: BackgroundConfig.border.thickness
|
||||||
|
width: win.screen.width - BackgroundConfig.border.thickness * 2
|
||||||
|
height: win.screen.height - BackgroundConfig.border.thickness * 2
|
||||||
|
intersection: Intersection.Xor
|
||||||
|
}
|
||||||
|
|
||||||
|
anchors.top: true
|
||||||
|
anchors.bottom: true
|
||||||
|
anchors.left: true
|
||||||
|
anchors.right: true
|
||||||
|
|
||||||
|
StyledRect {
|
||||||
|
id: rect
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
color: Appearance.alpha(Appearance.colours.m3surface, false)
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: mask
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
layer.enabled: true
|
||||||
|
visible: false
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: BackgroundConfig.border.thickness
|
||||||
|
radius: BackgroundConfig.border.rounding
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MultiEffect {
|
||||||
|
anchors.fill: parent
|
||||||
|
maskEnabled: true
|
||||||
|
maskInverted: true
|
||||||
|
maskSource: mask
|
||||||
|
source: rect
|
||||||
|
maskThresholdMin: 0.5
|
||||||
|
maskSpreadAtMin: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,7 +16,7 @@ StyledRect {
|
||||||
}
|
}
|
||||||
|
|
||||||
vertical: BarConfig.vertical
|
vertical: BarConfig.vertical
|
||||||
color: Appearance.alpha(Appearance.colours.m3surfaceContainer, false)
|
color: Appearance.alpha(Appearance.colours.m3surface, false)
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
BoxLayout {
|
BoxLayout {
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,9 @@ BoxLayout {
|
||||||
spacing: Appearance.padding.large
|
spacing: Appearance.padding.large
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.leftMargin: get(BarConfig.sizes.floatingGapLarge, BarConfig.sizes.floatingGap)
|
anchors.margins: BarConfig.sizes.floatingGap
|
||||||
anchors.topMargin: get(BarConfig.sizes.floatingGap, BarConfig.sizes.floatingGapLarge)
|
anchors.rightMargin: get(BarConfig.sizes.floatingGap, 0)
|
||||||
anchors.rightMargin: get(BarConfig.sizes.floatingGapLarge, 0)
|
anchors.bottomMargin: get(0, BarConfig.sizes.floatingGap)
|
||||||
anchors.bottomMargin: get(0, BarConfig.sizes.floatingGapLarge)
|
|
||||||
|
|
||||||
Pill {
|
Pill {
|
||||||
OsIcon {
|
OsIcon {
|
||||||
|
|
@ -126,7 +125,7 @@ BoxLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
component Pill: PaddedRect {
|
component Pill: PaddedRect {
|
||||||
color: Appearance.alpha(Appearance.colours.m3surfaceContainer, false)
|
color: Appearance.alpha(Appearance.colours.m3surface, false)
|
||||||
radius: Appearance.rounding.full
|
radius: Appearance.rounding.full
|
||||||
padding: BarConfig.vertical ? [Appearance.padding.large, 0] : [0, Appearance.padding.large]
|
padding: BarConfig.vertical ? [Appearance.padding.large, 0] : [0, Appearance.padding.large]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ ListView {
|
||||||
|
|
||||||
highlight: StyledRect {
|
highlight: StyledRect {
|
||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHighest, true)
|
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: isAction ? actionItem : appItem
|
delegate: isAction ? actionItem : appItem
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ Shape {
|
||||||
|
|
||||||
ShapePath {
|
ShapePath {
|
||||||
strokeWidth: -1
|
strokeWidth: -1
|
||||||
fillColor: Appearance.colours.m3surfaceContainer
|
fillColor: Appearance.colours.m3surface
|
||||||
|
|
||||||
startY: root.wrapperHeight
|
startY: root.wrapperHeight
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ Item {
|
||||||
StyledRect {
|
StyledRect {
|
||||||
id: listWrapper
|
id: listWrapper
|
||||||
|
|
||||||
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
|
color: Appearance.alpha(Appearance.colours.m3surfaceContainer, true)
|
||||||
radius: root.rounding
|
radius: root.rounding
|
||||||
|
|
||||||
implicitWidth: list.width + root.padding * 2
|
implicitWidth: list.width + root.padding * 2
|
||||||
|
|
@ -61,7 +61,7 @@ Item {
|
||||||
placeholderText: qsTr(`Type "${LauncherConfig.actionPrefix}" for commands`)
|
placeholderText: qsTr(`Type "${LauncherConfig.actionPrefix}" for commands`)
|
||||||
|
|
||||||
background: StyledRect {
|
background: StyledRect {
|
||||||
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
|
color: Appearance.alpha(Appearance.colours.m3surfaceContainer, true)
|
||||||
radius: root.rounding
|
radius: root.rounding
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ Item {
|
||||||
id: icon
|
id: icon
|
||||||
|
|
||||||
text: "manage_search"
|
text: "manage_search"
|
||||||
color: Appearance.colours.m3outline
|
color: Appearance.colours.m3onSurfaceVariant
|
||||||
font.pointSize: Appearance.font.size.extraLarge
|
font.pointSize: Appearance.font.size.extraLarge
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
@ -153,7 +153,7 @@ Item {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
text: qsTr("No results")
|
text: qsTr("No results")
|
||||||
color: Appearance.colours.m3outline
|
color: Appearance.colours.m3onSurfaceVariant
|
||||||
font.pointSize: Appearance.font.size.larger
|
font.pointSize: Appearance.font.size.larger
|
||||||
font.weight: 500
|
font.weight: 500
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ Scope {
|
||||||
item: wrapper
|
item: wrapper
|
||||||
}
|
}
|
||||||
|
|
||||||
|
margins.bottom: BackgroundConfig.border.thickness
|
||||||
anchors.top: true
|
anchors.top: true
|
||||||
anchors.left: true
|
anchors.left: true
|
||||||
anchors.bottom: true
|
anchors.bottom: true
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ Shape {
|
||||||
|
|
||||||
ShapePath {
|
ShapePath {
|
||||||
strokeWidth: -1
|
strokeWidth: -1
|
||||||
fillColor: Appearance.colours.m3surfaceContainer
|
fillColor: Appearance.colours.m3surface
|
||||||
|
|
||||||
startX: root.wrapperWidth
|
startX: root.wrapperWidth
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ Variants {
|
||||||
item: wrapper
|
item: wrapper
|
||||||
}
|
}
|
||||||
|
|
||||||
|
margins.right: BackgroundConfig.border.thickness
|
||||||
anchors.left: true
|
anchors.left: true
|
||||||
anchors.right: true
|
anchors.right: true
|
||||||
height: wrapper.height
|
height: wrapper.height
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
import "modules/bar"
|
import "modules/bar"
|
||||||
import "modules/launcher"
|
import "modules/launcher"
|
||||||
import "modules/osd"
|
import "modules/osd"
|
||||||
|
import "modules/background"
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|
||||||
ShellRoot {
|
ShellRoot {
|
||||||
Bar {}
|
Bar {}
|
||||||
Launcher {}
|
Launcher {}
|
||||||
Osd {}
|
Osd {}
|
||||||
|
Background {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ Slider {
|
||||||
orientation: Qt.Vertical
|
orientation: Qt.Vertical
|
||||||
|
|
||||||
background: StyledRect {
|
background: StyledRect {
|
||||||
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
|
color: Appearance.alpha(Appearance.colours.m3surfaceContainer, true)
|
||||||
radius: Appearance.rounding.full
|
radius: Appearance.rounding.full
|
||||||
|
|
||||||
StyledRect {
|
StyledRect {
|
||||||
|
|
@ -57,7 +57,7 @@ Slider {
|
||||||
|
|
||||||
animate: true
|
animate: true
|
||||||
text: root.icon
|
text: root.icon
|
||||||
color: Appearance.colours.m3onPrimary
|
color: Appearance.colours.m3onInverseSurface
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
states: State {
|
states: State {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue