forked from Shinonome/dots-hyprland
refactor(WeatherBar): put in barRightSide
This commit is contained in:
@@ -203,8 +203,7 @@ Scope {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: 19.5
|
width: 19.5
|
||||||
height: 19.5
|
height: 19.5
|
||||||
source: Config.options.bar.topLeftIcon == 'distro' ?
|
source: Config.options.bar.topLeftIcon == 'distro' ? SystemInfo.distroIcon : "spark-symbolic"
|
||||||
SystemInfo.distroIcon : "spark-symbolic"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ColorOverlay {
|
ColorOverlay {
|
||||||
@@ -246,7 +245,9 @@ Scope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VerticalBarSeparator {visible: Config.options?.bar.borderless}
|
VerticalBarSeparator {
|
||||||
|
visible: Config.options?.bar.borderless
|
||||||
|
}
|
||||||
|
|
||||||
BarGroup {
|
BarGroup {
|
||||||
id: middleCenterGroup
|
id: middleCenterGroup
|
||||||
@@ -271,7 +272,9 @@ Scope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VerticalBarSeparator {visible: Config.options?.bar.borderless}
|
VerticalBarSeparator {
|
||||||
|
visible: Config.options?.bar.borderless
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: rightCenterGroup
|
id: rightCenterGroup
|
||||||
@@ -307,20 +310,7 @@ Scope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VerticalBarSeparator {
|
VerticalBarSeparator {
|
||||||
visible: Config.options.bar.borderless
|
visible: Config.options.bar.borderless && Config.options.bar.weather.enable
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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 {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,7 +320,7 @@ Scope {
|
|||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
implicitHeight: Appearance.sizes.baseBarHeight
|
implicitHeight: Appearance.sizes.baseBarHeight
|
||||||
height: Appearance.sizes.barHeight
|
height: Appearance.sizes.barHeight
|
||||||
width: barRoot.width - (barLeftSideMouseArea.width + middleSection.width + weatherLoader.width)
|
width: (barRoot.width - middleSection.width) / 2
|
||||||
|
|
||||||
property bool hovered: false
|
property bool hovered: false
|
||||||
property real lastScrollX: 0
|
property real lastScrollX: 0
|
||||||
@@ -493,6 +483,15 @@ Scope {
|
|||||||
Item {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: 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 {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
property real margin: 5
|
property real margin: 10
|
||||||
implicitHeight: 32
|
implicitHeight: mouseArea.implicitHeight
|
||||||
implicitWidth: mouseArea.implicitWidth + margin * 2
|
implicitWidth: mouseArea.implicitWidth + margin * 2
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
@@ -30,12 +30,12 @@ Item {
|
|||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: rowLayout
|
id: rowLayout
|
||||||
|
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
fill: 0
|
fill: 0
|
||||||
text: WeatherIcons.codeToName[Weather.data.wCode]
|
text: WeatherIcons.codeToName[Weather.data.wCode]
|
||||||
iconSize: Appearance.font.pixelSize.large
|
iconSize: Appearance.font.pixelSize.large
|
||||||
color: Appearance.colors.colOnLayer1
|
color: Appearance.colors.colOnLayer1
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
@@ -43,6 +43,7 @@ Item {
|
|||||||
font.pixelSize: Appearance.font.pixelSize.large
|
font.pixelSize: Appearance.font.pixelSize.large
|
||||||
color: Appearance.colors.colOnLayer1
|
color: Appearance.colors.colOnLayer1
|
||||||
text: Weather.data.temp
|
text: Weather.data.temp
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user