1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-10 07:25:37 -05:00

TopBar VPN: icon-only widget with consistent background; fix imports; quiet VpnDetail anchors

This commit is contained in:
Jon Rogers
2025-08-30 14:06:43 -04:00
parent 952e5604d9
commit 449418f537

View File

@@ -1,11 +1,10 @@
import QtQuick
import QtQuick.Controls
import Quickshell
import qs.Common
import qs.Services
import qs.Widgets
Item {
Rectangle {
id: root
// Passed in by TopBar
@@ -17,20 +16,19 @@ Item {
signal toggleVpnPopup()
width: Math.max(24, contentRow.implicitWidth + Theme.spacingXS * 2)
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
width: Theme.iconSize + horizontalPadding * 2
height: widgetHeight
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
color: {
if (SettingsData.topBarNoBackground) return "transparent"
const base = clickArea.containsMouse || (popupTarget && popupTarget.shouldBeVisible) ? Theme.primaryPressed : Theme.secondaryHover
return Qt.rgba(base.r, base.g, base.b, base.a * Theme.widgetTransparency)
}
Row {
id: contentRow
anchors.fill: parent
anchors.margins: 0
spacing: Theme.spacingXS
Rectangle {
anchors.fill: parent
radius: 6
color: "transparent"
}
Item {
anchors.centerIn: parent
DankIcon {
id: icon
@@ -47,17 +45,6 @@ Item {
duration: 900
}
}
Text {
id: label
text: VpnService.connected ? (VpnService.activeName || "VPN") : "VPN"
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium
color: VpnService.connected ? Theme.primary : Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
visible: true
elide: Text.ElideRight
}
}
MouseArea {