mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
VPN Detail: align action buttons right via RowLayout, add hover color by state, retain pointer cursor
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
@@ -35,14 +36,15 @@ Rectangle {
|
||||
height: 28
|
||||
radius: 14
|
||||
color: toggleMouse.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.5)
|
||||
visible: VpnService.connected || VpnService.profiles.length > 0
|
||||
width: 80
|
||||
// Only show quick connect when not connected
|
||||
visible: !VpnService.connected && VpnService.profiles.length > 0
|
||||
width: 100
|
||||
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.spacingXS
|
||||
DankIcon { name: VpnService.connected ? "link_off" : "link"; size: Theme.fontSizeSmall; color: Theme.surfaceText }
|
||||
StyledText { text: VpnService.connected ? "Disconnect" : "Connect"; font.pixelSize: Theme.fontSizeSmall; color: Theme.surfaceText; font.weight: Font.Medium }
|
||||
DankIcon { name: "link"; size: Theme.fontSizeSmall; color: Theme.surfaceText }
|
||||
StyledText { text: "Connect"; font.pixelSize: Theme.fontSizeSmall; color: Theme.surfaceText; font.weight: Font.Medium }
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
@@ -93,7 +95,7 @@ Rectangle {
|
||||
border.width: 1
|
||||
border.color: modelData.uuid === VpnService.activeUuid ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
|
||||
Row {
|
||||
RowLayout {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@@ -111,16 +113,20 @@ Rectangle {
|
||||
text: modelData.name
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
|
||||
Item { width: 1; height: 1 }
|
||||
Item { Layout.fillWidth: true; height: 1 }
|
||||
|
||||
Rectangle {
|
||||
height: 28
|
||||
radius: 14
|
||||
color: actMouse.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.5)
|
||||
color: actMouse.containsMouse
|
||||
? (modelData.uuid === VpnService.activeUuid
|
||||
? Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12)
|
||||
: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12))
|
||||
: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.5)
|
||||
width: 100
|
||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
|
||||
@@ -22,7 +22,7 @@ DankPopout {
|
||||
triggerScreen = screen
|
||||
}
|
||||
|
||||
popupWidth: 420
|
||||
popupWidth: 360
|
||||
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 260
|
||||
triggerX: Screen.width - 400 - Theme.spacingL
|
||||
triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingS
|
||||
@@ -64,7 +64,7 @@ DankPopout {
|
||||
width: parent.width
|
||||
height: 28
|
||||
StyledText {
|
||||
text: "VPN"
|
||||
text: "VPN Connections"
|
||||
font.pixelSize: Theme.fontSizeLarge
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
|
||||
Reference in New Issue
Block a user