forked from Shinonome/dots-hyprland
BarContent: remove useless Item wrapping left/right sides
This commit is contained in:
@@ -54,6 +54,7 @@ Item { // Bar content region
|
|||||||
id: barLeftSideMouseArea
|
id: barLeftSideMouseArea
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
implicitHeight: Appearance.sizes.baseBarHeight
|
implicitHeight: Appearance.sizes.baseBarHeight
|
||||||
|
implicitWidth: leftSectionRowLayout.implicitWidth
|
||||||
height: Appearance.sizes.barHeight
|
height: Appearance.sizes.barHeight
|
||||||
width: (root.width - middleSection.width) / 2
|
width: (root.width - middleSection.width) / 2
|
||||||
property bool hovered: false
|
property bool hovered: false
|
||||||
@@ -75,6 +76,7 @@ Item { // Bar content region
|
|||||||
GlobalStates.sidebarLeftOpen = !GlobalStates.sidebarLeftOpen;
|
GlobalStates.sidebarLeftOpen = !GlobalStates.sidebarLeftOpen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scroll to change brightness
|
// Scroll to change brightness
|
||||||
WheelHandler {
|
WheelHandler {
|
||||||
onWheel: event => {
|
onWheel: event => {
|
||||||
@@ -99,12 +101,8 @@ Item { // Bar content region
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item {
|
|
||||||
// Left section
|
|
||||||
anchors.fill: parent
|
|
||||||
implicitHeight: leftSectionRowLayout.implicitHeight
|
|
||||||
implicitWidth: leftSectionRowLayout.implicitWidth
|
|
||||||
|
|
||||||
|
// Visual content
|
||||||
ScrollHint {
|
ScrollHint {
|
||||||
reveal: barLeftSideMouseArea.hovered
|
reveal: barLeftSideMouseArea.hovered
|
||||||
icon: "light_mode"
|
icon: "light_mode"
|
||||||
@@ -114,7 +112,7 @@ Item { // Bar content region
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout { // Content
|
RowLayout {
|
||||||
id: leftSectionRowLayout
|
id: leftSectionRowLayout
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: 10
|
spacing: 10
|
||||||
@@ -161,7 +159,6 @@ Item { // Bar content region
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout { // Middle section
|
RowLayout { // Middle section
|
||||||
id: middleSection
|
id: middleSection
|
||||||
@@ -171,7 +168,7 @@ Item { // Bar content region
|
|||||||
BarGroup {
|
BarGroup {
|
||||||
id: leftCenterGroup
|
id: leftCenterGroup
|
||||||
Layout.preferredWidth: root.centerSideModuleWidth
|
Layout.preferredWidth: root.centerSideModuleWidth
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: false
|
||||||
|
|
||||||
Resources {
|
Resources {
|
||||||
alwaysShowAllResources: root.useShortenedForm === 2
|
alwaysShowAllResources: root.useShortenedForm === 2
|
||||||
@@ -252,6 +249,7 @@ Item { // Bar content region
|
|||||||
id: barRightSideMouseArea
|
id: barRightSideMouseArea
|
||||||
|
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
implicitWidth: rightSectionRowLayout.implicitWidth
|
||||||
implicitHeight: Appearance.sizes.baseBarHeight
|
implicitHeight: Appearance.sizes.baseBarHeight
|
||||||
height: Appearance.sizes.barHeight
|
height: Appearance.sizes.barHeight
|
||||||
width: (root.width - middleSection.width) / 2
|
width: (root.width - middleSection.width) / 2
|
||||||
@@ -278,6 +276,7 @@ Item { // Bar content region
|
|||||||
MprisController.activePlayer.next();
|
MprisController.activePlayer.next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scroll to change volume
|
// Scroll to change volume
|
||||||
WheelHandler {
|
WheelHandler {
|
||||||
onWheel: event => {
|
onWheel: event => {
|
||||||
@@ -305,11 +304,7 @@ Item { // Bar content region
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
// Visual content
|
||||||
anchors.fill: parent
|
|
||||||
implicitHeight: rightSectionRowLayout.implicitHeight
|
|
||||||
implicitWidth: rightSectionRowLayout.implicitWidth
|
|
||||||
|
|
||||||
ScrollHint {
|
ScrollHint {
|
||||||
reveal: barRightSideMouseArea.hovered
|
reveal: barRightSideMouseArea.hovered
|
||||||
icon: "volume_up"
|
icon: "volume_up"
|
||||||
@@ -364,11 +359,7 @@ Item { // Bar content region
|
|||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.rightMargin: reveal ? indicatorsRowLayout.realSpacing : 0
|
Layout.rightMargin: reveal ? indicatorsRowLayout.realSpacing : 0
|
||||||
Behavior on Layout.rightMargin {
|
Behavior on Layout.rightMargin {
|
||||||
NumberAnimation {
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
duration: Appearance.animation.elementMoveFast.duration
|
|
||||||
easing.type: Appearance.animation.elementMoveFast.type
|
|
||||||
easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
text: "volume_off"
|
text: "volume_off"
|
||||||
@@ -381,11 +372,7 @@ Item { // Bar content region
|
|||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.rightMargin: reveal ? indicatorsRowLayout.realSpacing : 0
|
Layout.rightMargin: reveal ? indicatorsRowLayout.realSpacing : 0
|
||||||
Behavior on Layout.rightMargin {
|
Behavior on Layout.rightMargin {
|
||||||
NumberAnimation {
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
duration: Appearance.animation.elementMoveFast.duration
|
|
||||||
easing.type: Appearance.animation.elementMoveFast.type
|
|
||||||
easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
text: "mic_off"
|
text: "mic_off"
|
||||||
@@ -441,4 +428,3 @@ Item { // Bar content region
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user