mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-07 05:58:28 -04:00
tailscale: fix inconsistency in styling of control center widget
port 1.5
(cherry picked from commit 2edf70a144)
This commit is contained in:
@@ -44,7 +44,9 @@ PluginComponent {
|
|||||||
|
|
||||||
implicitHeight: detailColumn.implicitHeight + Theme.spacingM * 2
|
implicitHeight: detailColumn.implicitHeight + Theme.spacingM * 2
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: Theme.surfaceContainerHigh
|
color: Theme.nestedSurface
|
||||||
|
border.color: Theme.outlineMedium
|
||||||
|
border.width: Theme.layerOutlineWidth
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: detailColumn
|
id: detailColumn
|
||||||
@@ -132,7 +134,11 @@ PluginComponent {
|
|||||||
width: connButtonRow.implicitWidth + Theme.spacingM * 2
|
width: connButtonRow.implicitWidth + Theme.spacingM * 2
|
||||||
|
|
||||||
readonly property bool isConnected: TailscaleService.connected
|
readonly property bool isConnected: TailscaleService.connected
|
||||||
color: isConnected ? (connButtonArea.containsMouse ? Theme.errorHover : Theme.surfaceLight) : (connButtonArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceLight)
|
color: {
|
||||||
|
if (!connButtonArea.containsMouse)
|
||||||
|
return Theme.surfaceLight;
|
||||||
|
return isConnected ? Theme.errorHover : Theme.primaryHoverLight;
|
||||||
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: connButtonRow
|
id: connButtonRow
|
||||||
@@ -330,13 +336,15 @@ PluginComponent {
|
|||||||
required property var modelData
|
required property var modelData
|
||||||
required property int index
|
required property int index
|
||||||
|
|
||||||
|
readonly property bool isSelf: modelData.hostname === (TailscaleService.selfNode ? TailscaleService.selfNode.hostname : "")
|
||||||
|
readonly property bool isExpanded: detailRoot.expandedHostname === modelData.hostname
|
||||||
|
|
||||||
width: peerListColumn.width
|
width: peerListColumn.width
|
||||||
height: peerCardColumn.implicitHeight + Theme.spacingS * 2
|
height: peerCardColumn.implicitHeight + Theme.spacingS * 2
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: modelData.hostname === (TailscaleService.selfNode ? TailscaleService.selfNode.hostname : "") ? Theme.primaryHoverLight : Theme.surfaceContainerHighest
|
color: peerMouseArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceLight
|
||||||
|
border.color: isSelf ? Theme.primary : Theme.outlineLight
|
||||||
property bool isSelf: modelData.hostname === (TailscaleService.selfNode ? TailscaleService.selfNode.hostname : "")
|
border.width: isSelf ? 2 : 1
|
||||||
property bool isExpanded: detailRoot.expandedHostname === modelData.hostname
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: peerCardColumn
|
id: peerCardColumn
|
||||||
@@ -354,14 +362,14 @@ PluginComponent {
|
|||||||
width: 8
|
width: 8
|
||||||
height: 8
|
height: 8
|
||||||
radius: 4
|
radius: 4
|
||||||
color: modelData.online ? "#4caf50" : Theme.surfaceVariantText
|
color: modelData.online ? Theme.success : Theme.surfaceVariantText
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: modelData.hostname || ""
|
text: modelData.hostname || ""
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
font.weight: Font.Bold
|
font.weight: isSelf ? Font.Medium : Font.Normal
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
@@ -370,7 +378,7 @@ PluginComponent {
|
|||||||
StyledText {
|
StyledText {
|
||||||
visible: isSelf
|
visible: isSelf
|
||||||
text: I18n.tr("This device", "Label for the user's own device in Tailscale")
|
text: I18n.tr("This device", "Label for the user's own device in Tailscale")
|
||||||
font.pixelSize: 10
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.primary
|
color: Theme.primary
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
}
|
}
|
||||||
@@ -409,7 +417,7 @@ PluginComponent {
|
|||||||
}
|
}
|
||||||
return parts.join(" \u2022 ");
|
return parts.join(" \u2022 ");
|
||||||
}
|
}
|
||||||
font.pixelSize: 10
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
width: parent.width
|
width: parent.width
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
@@ -429,7 +437,7 @@ PluginComponent {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: modelData.dnsName || ""
|
text: modelData.dnsName || ""
|
||||||
font.pixelSize: 10
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
@@ -447,14 +455,14 @@ PluginComponent {
|
|||||||
StyledText {
|
StyledText {
|
||||||
visible: (modelData.tags || []).length > 0
|
visible: (modelData.tags || []).length > 0
|
||||||
text: I18n.tr("Tags: %1", "Tailscale device tags").arg((modelData.tags || []).join(", "))
|
text: I18n.tr("Tags: %1", "Tailscale device tags").arg((modelData.tags || []).join(", "))
|
||||||
font.pixelSize: 10
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
visible: (modelData.owner || "").length > 0
|
visible: (modelData.owner || "").length > 0
|
||||||
text: I18n.tr("Owner: %1", "Tailscale device owner").arg(modelData.owner || "")
|
text: I18n.tr("Owner: %1", "Tailscale device owner").arg(modelData.owner || "")
|
||||||
font.pixelSize: 10
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user