diff --git a/src/qml/NetworkPage/WifiView.qml b/src/qml/NetworkPage/WifiView.qml index 3f060c5..d7ab192 100644 --- a/src/qml/NetworkPage/WifiView.qml +++ b/src/qml/NetworkPage/WifiView.qml @@ -15,6 +15,7 @@ Item { Label { id: wlanLabel text: qsTr("WLAN") + color: FishUI.Theme.disabledTextColor } FishUI.BusyIndicator { @@ -60,8 +61,6 @@ Item { spacing: FishUI.Units.smallSpacing interactive: false - visible: enabledConnections.wirelessEnabled - property var itemHeight: 45 delegate: WifiItem { diff --git a/src/qml/NetworkPage/WiredItem.qml b/src/qml/NetworkPage/WiredItem.qml index 3a810a1..139a768 100644 --- a/src/qml/NetworkPage/WiredItem.qml +++ b/src/qml/NetworkPage/WiredItem.qml @@ -9,6 +9,17 @@ import Cutefish.NetworkManagement 1.0 as NM Item { id: control + MouseArea { + anchors.fill: parent + onClicked: { + if (model.connectionState === NM.Enums.Deactivated) { + handler.activateConnection(model.connectionPath, model.devicePath, model.specificPath) + } else { + handler.deactivateConnection(model.connectionPath, model.devicePath) + } + } + } + RowLayout { anchors.fill: parent spacing: FishUI.Units.largeSpacing diff --git a/src/qml/NetworkPage/main.qml b/src/qml/NetworkPage/main.qml index 45cd48d..335cb95 100644 --- a/src/qml/NetworkPage/main.qml +++ b/src/qml/NetworkPage/main.qml @@ -57,30 +57,52 @@ ItemPage { ColumnLayout { id: mainLayout anchors.fill: parent + spacing: FishUI.Units.largeSpacing * 2 // Wired connection - ColumnLayout { - id: wiredLayout - - visible: enabledConnections.wwanEnabled && wiredView.count > 0 + RoundedItem { + visible: enabledConnections.wwanHwEnabled RowLayout { + spacing: FishUI.Units.largeSpacing + Label { text: qsTr("Wired") color: FishUI.Theme.disabledTextColor Layout.fillWidth: true } + + Switch { + Layout.fillHeight: true + rightPadding: 0 + checked: enabledConnections.wwanEnabled + onCheckedChanged: { + if (checked) { + if (!enabledConnections.wwanEnabled) { + handler.enableWwan(checked) + } + } else { + if (enabledConnections.wwanEnabled) { + handler.enableWwan(checked) + } + } + } + } } ListView { id: wiredView + visible: enabledConnections.wwanEnabled + Layout.fillWidth: true - implicitHeight: wiredView.count * control.itemHeight + Layout.preferredHeight: wiredView.count * control.itemHeight + interactive: false clip: true model: NM.TechnologyProxyModel { type: NM.TechnologyProxyModel.WiredType + showInactiveConnections: true sourceModel: networkModel } @@ -93,10 +115,6 @@ ItemPage { } } - HorizontalDivider { - visible: wiredView.visible && enabledConnections.wirelessHwEnabled - } - RoundedItem { WifiView { Layout.fillWidth: true