mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 14:59:27 -05:00
refactor(WeatherBar): put in barRightSide
This commit is contained in:
@@ -85,7 +85,7 @@ Scope {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Background shadow
|
||||
Loader {
|
||||
active: showBarBackground && Config.options.bar.cornerStyle === 1
|
||||
@@ -105,7 +105,7 @@ Scope {
|
||||
color: showBarBackground ? Appearance.colors.colLayer0 : "transparent"
|
||||
radius: Config.options.bar.cornerStyle === 1 ? Appearance.rounding.windowRounding : 0
|
||||
}
|
||||
|
||||
|
||||
MouseArea { // Left side | scroll to change brightness
|
||||
id: barLeftSideMouseArea
|
||||
anchors.left: parent.left
|
||||
@@ -203,8 +203,7 @@ Scope {
|
||||
anchors.centerIn: parent
|
||||
width: 19.5
|
||||
height: 19.5
|
||||
source: Config.options.bar.topLeftIcon == 'distro' ?
|
||||
SystemInfo.distroIcon : "spark-symbolic"
|
||||
source: Config.options.bar.topLeftIcon == 'distro' ? SystemInfo.distroIcon : "spark-symbolic"
|
||||
}
|
||||
|
||||
ColorOverlay {
|
||||
@@ -246,7 +245,9 @@ Scope {
|
||||
}
|
||||
}
|
||||
|
||||
VerticalBarSeparator {visible: Config.options?.bar.borderless}
|
||||
VerticalBarSeparator {
|
||||
visible: Config.options?.bar.borderless
|
||||
}
|
||||
|
||||
BarGroup {
|
||||
id: middleCenterGroup
|
||||
@@ -271,7 +272,9 @@ Scope {
|
||||
}
|
||||
}
|
||||
|
||||
VerticalBarSeparator {visible: Config.options?.bar.borderless}
|
||||
VerticalBarSeparator {
|
||||
visible: Config.options?.bar.borderless
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: rightCenterGroup
|
||||
@@ -307,20 +310,7 @@ Scope {
|
||||
}
|
||||
|
||||
VerticalBarSeparator {
|
||||
visible: Config.options.bar.borderless
|
||||
}
|
||||
}
|
||||
|
||||
// Weather
|
||||
Loader {
|
||||
id: weatherLoader
|
||||
active: Config.options.bar.weather.enable
|
||||
anchors.left: middleSection.right
|
||||
anchors.margins: 10
|
||||
sourceComponent: BarGroup {
|
||||
implicitHeight: Appearance.sizes.baseBarHeight
|
||||
height: Appearance.sizes.barHeight
|
||||
WeatherBar {}
|
||||
visible: Config.options.bar.borderless && Config.options.bar.weather.enable
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,7 +320,7 @@ Scope {
|
||||
anchors.right: parent.right
|
||||
implicitHeight: Appearance.sizes.baseBarHeight
|
||||
height: Appearance.sizes.barHeight
|
||||
width: barRoot.width - (barLeftSideMouseArea.width + middleSection.width + weatherLoader.width)
|
||||
width: (barRoot.width - middleSection.width) / 2
|
||||
|
||||
property bool hovered: false
|
||||
property real lastScrollX: 0
|
||||
@@ -493,6 +483,15 @@ Scope {
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
// Weather
|
||||
Loader {
|
||||
active: Config.options.bar.weather.enable
|
||||
sourceComponent: BarGroup {
|
||||
implicitHeight: Appearance.sizes.baseBarHeight
|
||||
WeatherBar {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ import QtQuick.Layouts
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property real margin: 5
|
||||
implicitHeight: 32
|
||||
property real margin: 10
|
||||
implicitHeight: mouseArea.implicitHeight
|
||||
implicitWidth: mouseArea.implicitWidth + margin * 2
|
||||
|
||||
MouseArea {
|
||||
@@ -30,12 +30,12 @@ Item {
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
|
||||
MaterialSymbol {
|
||||
fill: 0
|
||||
text: WeatherIcons.codeToName[Weather.data.wCode]
|
||||
iconSize: Appearance.font.pixelSize.large
|
||||
color: Appearance.colors.colOnLayer1
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
@@ -43,6 +43,7 @@ Item {
|
||||
font.pixelSize: Appearance.font.pixelSize.large
|
||||
color: Appearance.colors.colOnLayer1
|
||||
text: Weather.data.temp
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user