forked from Shinonome/dots-hyprland
weather bar: remove unnecessary nested item
This commit is contained in:
@@ -7,44 +7,37 @@ import Quickshell
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
Item {
|
MouseArea {
|
||||||
id: root
|
id: root
|
||||||
property real margin: 10
|
property real margin: 10
|
||||||
implicitHeight: mouseArea.implicitHeight
|
property bool hovered: false
|
||||||
implicitWidth: mouseArea.implicitWidth + margin * 2
|
implicitWidth: rowLayout.implicitWidth + margin * 2
|
||||||
|
implicitHeight: rowLayout.implicitHeight
|
||||||
|
|
||||||
MouseArea {
|
hoverEnabled: true
|
||||||
id: mouseArea
|
onEntered: {
|
||||||
property bool hovered: false
|
popupLoader.item.visible = true;
|
||||||
implicitWidth: rowLayout.implicitWidth
|
}
|
||||||
implicitHeight: rowLayout.implicitHeight
|
onExited: {
|
||||||
anchors.centerIn: root
|
popupLoader.item.visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
hoverEnabled: true
|
RowLayout {
|
||||||
onEntered: {
|
id: rowLayout
|
||||||
popupLoader.item.visible = true;
|
MaterialSymbol {
|
||||||
}
|
fill: 0
|
||||||
onExited: {
|
text: WeatherIcons.codeToName[Weather.data.wCode]
|
||||||
popupLoader.item.visible = false;
|
iconSize: Appearance.font.pixelSize.large
|
||||||
|
color: Appearance.colors.colOnLayer1
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
StyledText {
|
||||||
id: rowLayout
|
visible: true
|
||||||
MaterialSymbol {
|
font.pixelSize: Appearance.font.pixelSize.small
|
||||||
fill: 0
|
color: Appearance.colors.colOnLayer1
|
||||||
text: WeatherIcons.codeToName[Weather.data.wCode]
|
text: Weather.data.temp
|
||||||
iconSize: Appearance.font.pixelSize.large
|
Layout.alignment: Qt.AlignVCenter
|
||||||
color: Appearance.colors.colOnLayer1
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
visible: true
|
|
||||||
font.pixelSize: Appearance.font.pixelSize.small
|
|
||||||
color: Appearance.colors.colOnLayer1
|
|
||||||
text: Weather.data.temp
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user