Skip to content

Commit

Permalink
fix: updated network button label for Plasma 6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SadColourfulHues committed Jun 21, 2024
1 parent ca69edf commit 2698ced
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
11 changes: 7 additions & 4 deletions package/contents/ui/components/Network.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.kde.plasma.networkmanagement as PlasmaNM

Item {
property var appletProxyModel: appletProxyModel
property var networkStatus: networkStatus.networkStatus
property var netStatusText: netStatus.activeConnections
property var activeConnectionIcon: activeConnectionIcon.connectionIcon
property var enabledConnections: enabledConnections
property var availableDevices: availableDevices
Expand All @@ -13,13 +13,16 @@ Item {

PlasmaNM.ConnectionIcon {
id: activeConnectionIcon
connectivity: netStatus.connectivity
}

PlasmaNM.NetworkStatus {
id: netStatus
}

PlasmaNM.Handler {
id: handler
}
PlasmaNM.NetworkStatus {
id: networkStatus
}
PlasmaNM.AppletProxyModel {
id: appletProxyModel
sourceModel: PlasmaNM.NetworkModel{}
Expand Down
13 changes: 11 additions & 2 deletions package/contents/ui/components/SectionButtons.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import org.kde.plasma.core as PlasmaCore
import org.kde.bluezqt as BluezQt
import org.kde.kcmutils

import org.kde.kirigami as Kirigami
import org.kde.plasma.networkmanagement as PlasmaNM

import "../lib" as Lib
import "../js/funcs.js" as Funcs

Expand Down Expand Up @@ -33,10 +36,16 @@ Lib.Card {

Lib.LongButton {
title: i18n("Network")
subtitle: network.networkStatus
subtitle: network.netStatusText
source: network.activeConnectionIcon
sourceColor: network.networkStatus === "Connected" ?

// TODO:Better method?
// Replacement for previous implementation //
// I'm not too familiar with the KDE/Qt API, so maybe
// there's a better way of getting the connectivity state?
sourceColor: network.netStatusText.includes("Connected") ?
Kirigami.Theme.highlightColor : Kirigami.Theme.disabledTextColor

onClicked: {
sectionNetworks.toggleNetworkSection()
}
Expand Down

0 comments on commit 2698ced

Please sign in to comment.