Tighten weather popup layout and add outside-click dismiss

PopupCard now uses HyprlandFocusGrab so any popup in the shell closes
when the user clicks outside it (or any other window in the listed set).
Single primitive — every widget gets it for free.

Weather popup rewritten:
- Smaller cloud glyph beside the city name on one row, both vertically
  centered.
- Condition string flows on its own line and wraps inside the popup.
- Refresh and wttr.in pills sit side by side instead of stacked, no
  more dead vertical space.
- contentHeight tracks the actual content height so the popup is no
  taller than it needs to be.
This commit is contained in:
Ryan Hughes
2026-05-14 02:21:48 -04:00
parent 5476b9d13b
commit 7425dd74ae
2 changed files with 66 additions and 41 deletions
@@ -1,5 +1,6 @@
import QtQuick
import Quickshell
import Quickshell.Hyprland
PopupWindow {
id: root
@@ -14,6 +15,7 @@ PopupWindow {
property bool open: false
readonly property var coordinatorKey: owner || root
readonly property var anchorWindow: anchorItem ? anchorItem.QsWindow.window : null
function closePopout() {
if (owner && "closePopout" in owner) owner.closePopout()
@@ -33,6 +35,15 @@ PopupWindow {
else if (bar.activePopout === coordinatorKey) bar.releasePopout(coordinatorKey)
}
// Outside-click dismissal via Hyprland's focus grab. While `active`, input
// is routed only to the listed windows; clicking anywhere else clears the
// grab and we close the popup.
HyprlandFocusGrab {
active: root.open
windows: root.anchorWindow ? [root, root.anchorWindow] : [root]
onCleared: root.closePopout()
}
anchor {
id: popupAnchor
window: anchorItem ? anchorItem.QsWindow.window : null