feat(quickshell): separate Bar from shell.qml

This commit is contained in:
matt1432 2025-04-27 18:11:50 -04:00
parent 94271ba42e
commit c1d7bcb2b6
4 changed files with 84 additions and 33 deletions
modules/quickshell/config
Components/RoundCorner
Widgets
Bar
ScreenCorners
shell.qml

View file

@ -1,7 +1,5 @@
import QtQuick
import "../../Config/Theme"
Item {
id: root
@ -12,8 +10,8 @@ Item {
BottomRight
}
property color color: theme.windowBg
property int corner: RoundCorner.Corner.TopLeft // Default to TopLeft
property color color: "black"
property int corner: RoundCorner.Corner.TopLeft
property int size: 15
@ -24,11 +22,6 @@ Item {
canvas.requestPaint();
}
Theme {
id: theme
}
Canvas {
id: canvas

View file

@ -0,0 +1,66 @@
import Quickshell
import QtQuick
import QtQuick.Layouts
import "../../Components/RoundCorner"
import "../../Config/Theme"
PanelWindow {
id: toplevel
color: "transparent"
exclusiveZone: bar.height
Theme {
id: theme
}
anchors {
left: true
right: true
top: true
}
Rectangle {
id: bar
color: theme.windowBg
height: 30
anchors {
left: parent.left
right: parent.right
}
Text {
anchors.centerIn: parent
color: theme.windowFg
text: "hello world"
}
}
RowLayout {
spacing: bar.width - leftCorner.width - rightCorner.width
anchors {
left: parent.left
right: parent.right
top: bar.bottom
}
RoundCorner {
id: leftCorner
color: theme.windowBg
corner: RoundCorner.Corner.TopLeft
}
RoundCorner {
id: rightCorner
color: theme.windowBg
corner: RoundCorner.Corner.TopRight
}
}
}

View file

@ -19,18 +19,29 @@ Scope {
WlrLayershell.layer: WlrLayer.Overlay
WlrLayershell.namespace: "quickshell:screenCorners"
color: "transparent"
exclusionMode: ExclusionMode.Normal
margins.bottom: -1
exclusionMode: ExclusionMode.Ignore
screen: modelData
mask: Region {
item: null
}
anchors {
bottom: true
left: true
right: true
top: true
}
RoundCorner {
anchors.left: parent.left
anchors.top: parent.top
corner: RoundCorner.Corner.TopLeft
}
RoundCorner {
anchors.right: parent.right
anchors.top: parent.top
corner: RoundCorner.Corner.TopRight
}
RoundCorner {

View file

@ -1,32 +1,13 @@
import Quickshell
import QtQuick
import "./Widgets/Bar"
import "./Widgets/ScreenCorners"
import "./Config/Theme"
ShellRoot {
Theme {
id: theme
Bar {
}
ScreenCorners {
}
PanelWindow {
color: theme.windowBg
height: 30
anchors {
bottom: true
left: true
right: true
}
Text {
anchors.centerIn: parent
color: theme.windowFg
text: "hello world"
}
}
}