forked from Shinonome/dots-hyprland
bar: introduce borderless mode
This commit is contained in:
@@ -8,6 +8,7 @@ import Quickshell.Services.UPower
|
|||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
|
property bool borderless: ConfigOptions.bar.borderless
|
||||||
readonly property var chargeState: UPower.displayDevice.state
|
readonly property var chargeState: UPower.displayDevice.state
|
||||||
readonly property bool isCharging: chargeState == UPowerDeviceState.Charging
|
readonly property bool isCharging: chargeState == UPowerDeviceState.Charging
|
||||||
readonly property bool isPluggedIn: isCharging || chargeState == UPowerDeviceState.PendingCharge
|
readonly property bool isPluggedIn: isCharging || chargeState == UPowerDeviceState.PendingCharge
|
||||||
@@ -18,7 +19,7 @@ Rectangle {
|
|||||||
|
|
||||||
implicitWidth: rowLayout.implicitWidth + rowLayout.spacing * 2
|
implicitWidth: rowLayout.implicitWidth + rowLayout.spacing * 2
|
||||||
implicitHeight: 32
|
implicitHeight: 32
|
||||||
color: Appearance.colors.colLayer1
|
color: borderless ? "transparent" : Appearance.colors.colLayer1
|
||||||
radius: Appearance.rounding.small
|
radius: Appearance.rounding.small
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|||||||
@@ -5,9 +5,10 @@ import QtQuick
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
property bool borderless: ConfigOptions.bar.borderless
|
||||||
implicitWidth: rowLayout.implicitWidth + rowLayout.spacing * 6 // idk, text seems nicer w/ more padding
|
implicitWidth: rowLayout.implicitWidth + rowLayout.spacing * 6 // idk, text seems nicer w/ more padding
|
||||||
implicitHeight: 32
|
implicitHeight: 32
|
||||||
color: Appearance.colors.colLayer1
|
color: borderless ? "transparent" : Appearance.colors.colLayer1
|
||||||
radius: Appearance.rounding.small
|
radius: Appearance.rounding.small
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import Quickshell.Hyprland
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
property bool borderless: ConfigOptions.bar.borderless
|
||||||
readonly property MprisPlayer activePlayer: MprisController.activePlayer
|
readonly property MprisPlayer activePlayer: MprisController.activePlayer
|
||||||
readonly property string cleanedTitle: StringUtils.cleanMusicTitle(activePlayer?.trackTitle) || qsTr("No media")
|
readonly property string cleanedTitle: StringUtils.cleanMusicTitle(activePlayer?.trackTitle) || qsTr("No media")
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ Item {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: parent.width
|
width: parent.width
|
||||||
implicitHeight: 32
|
implicitHeight: 32
|
||||||
color: Appearance.colors.colLayer1
|
color: borderless ? "transparent" : Appearance.colors.colLayer1
|
||||||
radius: Appearance.rounding.small
|
radius: Appearance.rounding.small
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,10 @@ import Quickshell.Io
|
|||||||
import Quickshell.Services.Mpris
|
import Quickshell.Services.Mpris
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
property bool borderless: ConfigOptions.bar.borderless
|
||||||
implicitWidth: rowLayout.implicitWidth + rowLayout.anchors.leftMargin + rowLayout.anchors.rightMargin
|
implicitWidth: rowLayout.implicitWidth + rowLayout.anchors.leftMargin + rowLayout.anchors.rightMargin
|
||||||
implicitHeight: 32
|
implicitHeight: 32
|
||||||
color: Appearance.colors.colLayer1
|
color: borderless ? "transparent" : Appearance.colors.colLayer1
|
||||||
radius: Appearance.rounding.small
|
radius: Appearance.rounding.small
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|||||||
@@ -7,10 +7,12 @@ import Quickshell.Io
|
|||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: root
|
||||||
|
property bool borderless: ConfigOptions.bar.borderless
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
implicitWidth: rowLayout.implicitWidth + rowLayout.spacing * 2
|
implicitWidth: rowLayout.implicitWidth + rowLayout.spacing * 2
|
||||||
implicitHeight: 32
|
implicitHeight: 32
|
||||||
color: Appearance.colors.colLayer1
|
color: borderless ? "transparent" : Appearance.colors.colLayer1
|
||||||
radius: Appearance.rounding.small
|
radius: Appearance.rounding.small
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import Qt5Compat.GraphicalEffects
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
required property var bar
|
required property var bar
|
||||||
|
property bool borderless: ConfigOptions.bar.borderless
|
||||||
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(bar.screen)
|
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(bar.screen)
|
||||||
readonly property Toplevel activeWindow: ToplevelManager.activeToplevel
|
readonly property Toplevel activeWindow: ToplevelManager.activeToplevel
|
||||||
|
|
||||||
@@ -66,7 +67,7 @@ Item {
|
|||||||
implicitHeight: 32
|
implicitHeight: 32
|
||||||
implicitWidth: rowLayout.implicitWidth + widgetPadding * 2
|
implicitWidth: rowLayout.implicitWidth + widgetPadding * 2
|
||||||
radius: Appearance.rounding.small
|
radius: Appearance.rounding.small
|
||||||
color: Appearance.colors.colLayer1
|
color: borderless ? "transparent" : Appearance.colors.colLayer1
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scroll to switch workspaces
|
// Scroll to switch workspaces
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ Singleton {
|
|||||||
property int batteryLowThreshold: 20
|
property int batteryLowThreshold: 20
|
||||||
property string topLeftIcon: "spark" // Options: distro, spark
|
property string topLeftIcon: "spark" // Options: distro, spark
|
||||||
property bool showBackground: true
|
property bool showBackground: true
|
||||||
|
property bool borderless: false
|
||||||
property QtObject resources: QtObject {
|
property QtObject resources: QtObject {
|
||||||
property bool alwaysShowSwap: true
|
property bool alwaysShowSwap: true
|
||||||
property bool alwaysShowCpu: false
|
property bool alwaysShowCpu: false
|
||||||
|
|||||||
Reference in New Issue
Block a user