mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-24 12:22:09 +00:00
bars: refractor bar groups
This commit is contained in:
parent
9fc0d26eb5
commit
d05c451294
5 changed files with 26 additions and 59 deletions
|
|
@ -4,33 +4,38 @@ import QtQuick.Layouts
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
property bool vertical: false
|
||||||
property real padding: 5
|
property real padding: 5
|
||||||
implicitHeight: Appearance.sizes.baseBarHeight
|
implicitWidth: vertical ? Appearance.sizes.baseVerticalBarWidth : (gridLayout.implicitWidth + padding * 2)
|
||||||
height: Appearance.sizes.barHeight
|
implicitHeight: vertical ? (gridLayout.implicitHeight + padding * 2) : Appearance.sizes.baseBarHeight
|
||||||
implicitWidth: rowLayout.implicitWidth + padding * 2
|
default property alias items: gridLayout.children
|
||||||
default property alias items: rowLayout.children
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: background
|
id: background
|
||||||
anchors {
|
anchors {
|
||||||
fill: parent
|
fill: parent
|
||||||
topMargin: 4
|
topMargin: root.vertical ? 0 : 4
|
||||||
bottomMargin: 4
|
bottomMargin: root.vertical ? 0 : 4
|
||||||
|
leftMargin: root.vertical ? 4 : 0
|
||||||
|
rightMargin: root.vertical ? 4 : 0
|
||||||
}
|
}
|
||||||
color: Config.options?.bar.borderless ? "transparent" : Appearance.colors.colLayer1
|
color: Config.options?.bar.borderless ? "transparent" : Appearance.colors.colLayer1
|
||||||
radius: Appearance.rounding.small
|
radius: Appearance.rounding.small
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
GridLayout {
|
||||||
id: rowLayout
|
id: gridLayout
|
||||||
|
columns: root.vertical ? 1 : -1
|
||||||
anchors {
|
anchors {
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: root.vertical ? undefined : parent.verticalCenter
|
||||||
left: parent.left
|
horizontalCenter: root.vertical ? parent.horizontalCenter : undefined
|
||||||
right: parent.right
|
left: root.vertical ? undefined : parent.left
|
||||||
leftMargin: root.padding
|
right: root.vertical ? undefined : parent.right
|
||||||
rightMargin: root.padding
|
top: root.vertical ? parent.top : undefined
|
||||||
|
bottom: root.vertical ? parent.bottom : undefined
|
||||||
|
margins: root.padding
|
||||||
}
|
}
|
||||||
spacing: 4
|
columnSpacing: 4
|
||||||
|
rowSpacing: 12
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -323,7 +323,6 @@ Singleton {
|
||||||
property real baseBarHeight: 40
|
property real baseBarHeight: 40
|
||||||
property real barHeight: Config.options.bar.cornerStyle === 1 ?
|
property real barHeight: Config.options.bar.cornerStyle === 1 ?
|
||||||
(baseBarHeight + root.sizes.hyprlandGapsOut * 2) : baseBarHeight
|
(baseBarHeight + root.sizes.hyprlandGapsOut * 2) : baseBarHeight
|
||||||
property real barGroupHeight: 32
|
|
||||||
property real barCenterSideModuleWidth: Config.options?.bar.verbose ? 360 : 140
|
property real barCenterSideModuleWidth: Config.options?.bar.verbose ? 360 : 140
|
||||||
property real barCenterSideModuleWidthShortened: 280
|
property real barCenterSideModuleWidthShortened: 280
|
||||||
property real barCenterSideModuleWidthHellaShortened: 190
|
property real barCenterSideModuleWidthHellaShortened: 190
|
||||||
|
|
@ -344,7 +343,6 @@ Singleton {
|
||||||
property real baseVerticalBarWidth: 46
|
property real baseVerticalBarWidth: 46
|
||||||
property real verticalBarWidth: Config.options.bar.cornerStyle === 1 ?
|
property real verticalBarWidth: Config.options.bar.cornerStyle === 1 ?
|
||||||
(baseVerticalBarWidth + root.sizes.hyprlandGapsOut * 2) : baseVerticalBarWidth
|
(baseVerticalBarWidth + root.sizes.hyprlandGapsOut * 2) : baseVerticalBarWidth
|
||||||
property real verticalBarGroupWidth: 38
|
|
||||||
}
|
}
|
||||||
|
|
||||||
syntaxHighlightingTheme: root.m3colors.darkmode ? "Monokai" : "ayu Light"
|
syntaxHighlightingTheme: root.m3colors.darkmode ? "Monokai" : "ayu Light"
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,6 @@ MouseArea {
|
||||||
readonly property bool isLow: percentage <= Config.options.battery.low / 100
|
readonly property bool isLow: percentage <= Config.options.battery.low / 100
|
||||||
|
|
||||||
implicitHeight: batteryProgress.implicitHeight
|
implicitHeight: batteryProgress.implicitHeight
|
||||||
implicitWidth: Appearance.sizes.verticalBarGroupWidth
|
|
||||||
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
||||||
ClippedProgressBar {
|
ClippedProgressBar {
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,8 @@ Item { // Bar content region
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: 4
|
spacing: 4
|
||||||
|
|
||||||
VerticalBarGroup {
|
Bar.BarGroup {
|
||||||
|
vertical: true
|
||||||
padding: 8
|
padding: 8
|
||||||
Resources {
|
Resources {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
@ -162,8 +163,9 @@ Item { // Bar content region
|
||||||
visible: Config.options?.bar.borderless
|
visible: Config.options?.bar.borderless
|
||||||
}
|
}
|
||||||
|
|
||||||
VerticalBarGroup {
|
Bar.BarGroup {
|
||||||
id: middleCenterGroup
|
id: middleCenterGroup
|
||||||
|
vertical: true
|
||||||
padding: 6
|
padding: 6
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
|
|
@ -187,7 +189,8 @@ Item { // Bar content region
|
||||||
visible: Config.options?.bar.borderless
|
visible: Config.options?.bar.borderless
|
||||||
}
|
}
|
||||||
|
|
||||||
VerticalBarGroup {
|
Bar.BarGroup {
|
||||||
|
vertical: true
|
||||||
padding: 8
|
padding: 8
|
||||||
|
|
||||||
VerticalClockWidget {
|
VerticalClockWidget {
|
||||||
|
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
import qs.modules.common
|
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
property real padding: 5
|
|
||||||
implicitWidth: Appearance.sizes.baseVerticalBarWidth
|
|
||||||
width: Appearance.sizes.verticalBarWidth
|
|
||||||
implicitHeight: columnLayout.implicitHeight + padding * 2
|
|
||||||
default property alias items: columnLayout.children
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: background
|
|
||||||
anchors {
|
|
||||||
fill: parent
|
|
||||||
leftMargin: 4
|
|
||||||
rightMargin: 4
|
|
||||||
}
|
|
||||||
color: Config.options?.bar.borderless ? "transparent" : Appearance.colors.colLayer1
|
|
||||||
radius: Appearance.rounding.small
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: columnLayout
|
|
||||||
anchors {
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
top: parent.top
|
|
||||||
bottom: parent.bottom
|
|
||||||
topMargin: root.padding
|
|
||||||
bottomMargin: root.padding
|
|
||||||
}
|
|
||||||
spacing: 12
|
|
||||||
|
|
||||||
// Children defined by `items` prop
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue