From 8888b84b0aa3b8973ce1562be400cdc6552ee460 Mon Sep 17 00:00:00 2001 From: Hannes Date: Fri, 19 Jun 2026 15:55:51 +0200 Subject: [PATCH] Fixed PopUpWindow --- modules/bar/states/Network/NetworkState.qml | 2 ++ modules/bar/widgets/BarPopup.qml | 8 ++++---- modules/bar/widgets/Network.qml | 21 ++++++++++++++++----- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/modules/bar/states/Network/NetworkState.qml b/modules/bar/states/Network/NetworkState.qml index 9f9ac3d..96d500e 100644 --- a/modules/bar/states/Network/NetworkState.qml +++ b/modules/bar/states/Network/NetworkState.qml @@ -13,6 +13,7 @@ QtObject { property string interfaceType: "" property string connectionName: "" property string ipv4: "" + property string wifiName: "" property string signalStrength: "" property string wifiChannel: "" property string wifiFrequency: "" @@ -173,6 +174,7 @@ QtObject { if (wifiSection) { var wifiParts = wifiSection.split(" ") if (wifiParts.length >= 2) { + root.wifiName = wifiParts[0] || "" root.signalStrength = wifiParts[1] || "" if (wifiParts.length >= 3) root.wifiChannel = wifiParts[2] || "" if (wifiParts.length >= 4) root.wifiFrequency = wifiParts[3] + " " + wifiParts[4] || "" diff --git a/modules/bar/widgets/BarPopup.qml b/modules/bar/widgets/BarPopup.qml index 0e47fd7..418a34c 100644 --- a/modules/bar/widgets/BarPopup.qml +++ b/modules/bar/widgets/BarPopup.qml @@ -14,8 +14,8 @@ PopupWindow { visible: false color: "transparent" - // width: popupWidth - // height: background.height + width: Math.max(300, contentColumn.implicitWidth + 2 * 12) + height: Math.max(50, contentColumn.implicitHeight + 2 * 12) onAnchorHoveredChanged: popup.updateVisibility() @@ -57,8 +57,7 @@ PopupWindow { onContainsMouseChanged: popup.updateVisibility() Rectangle { id: background - width: parent.width - height: contentColumn.implicitHeight + 2 * 12 + anchors.fill: parent color: Qt.alpha(Colors.primaryContainer, 0.9) radius: 12 border { @@ -68,6 +67,7 @@ PopupWindow { Column { id: contentColumn + width: implicitWidth height: implicitHeight anchors { top: parent.top diff --git a/modules/bar/widgets/Network.qml b/modules/bar/widgets/Network.qml index 8df54ce..213c93d 100644 --- a/modules/bar/widgets/Network.qml +++ b/modules/bar/widgets/Network.qml @@ -38,13 +38,14 @@ MouseArea { id: clockPopup anchorItem: networkButton anchorHovered: networkButton.containsMouse - property int count: 17 - property var texts: [text1, text2, text3, text4, text5, text6, text7, text8, text9, text10, text11, text12, text13, text14, text15, text16, text17] - implicitWidth: Config.maxTextWidth(count, texts) + (Config.spacing_fun(networkButton.height) * 3) - implicitHeight: (text1.height*count)+(Config.spacing_fun(networkButton.height) * (count + 4)) + popupWidth: 500 + // property int count: 17 + // property var texts: [text1, text2, text3, text4, text5, text6, text7, text8, text9, text10, text11, text12, text13, text14, text15, text16, text17] + // implicitWidth: Config.maxTextWidth(count, texts) + (Config.spacing_fun(networkButton.height) * 3) + // implicitHeight: text1.height*count+(Config.spacing_fun(networkButton.height) * (count + 2)) Column { - width: parent.width + // width: parent.width spacing: Config.spacing_fun(networkButton.height) Text { id: text1 @@ -86,6 +87,16 @@ MouseArea { font.family: Config.font } + Text { + id: text45 + text: "wifiName: " + NetworkState.wifiName + wrapMode: Text.WordWrap + color: Colors.primary + anchors.horizontalCenter: parent.horizontalCenter + font.pixelSize: Config.font_size_tiny(bar.height) + font.family: Config.font + } + Text { id: text5 text: "signalStrength: " + NetworkState.signalStrength