Fixed PopUpWindow
This commit is contained in:
@@ -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] || ""
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user