feat(bar): unify popup handling and improve layouts

- Unified popup handling in ClockWidget, Resource, BatteryPopup, and WeatherBar
  using PanelWindow + LazyLoader for consistent positioning and compositor animations.
- Replaced plain text with ColumnLayout and RowLayout where possible, adding
  MaterialSymbol icons for improved visual consistency with the overall desktop style.
- Added Translation.tr() for bilingual (Chinese/English) support to avoid hardcoded strings.
- Based on improvements from PR #1771 (mine) and PR #1773 (by @finjener), merged and refined into a more polished and practical solution.
This commit is contained in:
Runze
2025-08-06 18:02:55 +08:00
parent 1dc46fa104
commit 061bb2abeb
7 changed files with 224 additions and 72 deletions
@@ -95,11 +95,11 @@ MouseArea {
}
}
Loader {
LazyLoader {
id: popupLoader
active: root.containsMouse
sourceComponent: PanelWindow {
component: PanelWindow {
id: popupWindow
visible: true
color: "transparent"
@@ -112,7 +112,10 @@ MouseArea {
implicitHeight: batteryPopup.implicitHeight
margins {
left: root.mapToGlobal(Qt.point(0, 0)).x - batteryPopup.implicitWidth / 3
left: root.mapToGlobal(Qt.point(
(root.width - batteryPopup.implicitWidth) / 2,
0
)).x
top: root.mapToGlobal(Qt.point(0, root.height)).y - 30
}