Optimize wired UI

pull/11/head
cutefishd 5 years ago
parent 60147cfd0b
commit dd1b845110

@ -15,6 +15,7 @@ Item {
Label { Label {
id: wlanLabel id: wlanLabel
text: qsTr("WLAN") text: qsTr("WLAN")
color: FishUI.Theme.disabledTextColor
} }
FishUI.BusyIndicator { FishUI.BusyIndicator {
@ -60,8 +61,6 @@ Item {
spacing: FishUI.Units.smallSpacing spacing: FishUI.Units.smallSpacing
interactive: false interactive: false
visible: enabledConnections.wirelessEnabled
property var itemHeight: 45 property var itemHeight: 45
delegate: WifiItem { delegate: WifiItem {

@ -9,6 +9,17 @@ import Cutefish.NetworkManagement 1.0 as NM
Item { Item {
id: control 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 { RowLayout {
anchors.fill: parent anchors.fill: parent
spacing: FishUI.Units.largeSpacing spacing: FishUI.Units.largeSpacing

@ -57,30 +57,52 @@ ItemPage {
ColumnLayout { ColumnLayout {
id: mainLayout id: mainLayout
anchors.fill: parent anchors.fill: parent
spacing: FishUI.Units.largeSpacing * 2
// Wired connection // Wired connection
ColumnLayout { RoundedItem {
id: wiredLayout visible: enabledConnections.wwanHwEnabled
visible: enabledConnections.wwanEnabled && wiredView.count > 0
RowLayout { RowLayout {
spacing: FishUI.Units.largeSpacing
Label { Label {
text: qsTr("Wired") text: qsTr("Wired")
color: FishUI.Theme.disabledTextColor color: FishUI.Theme.disabledTextColor
Layout.fillWidth: true 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 { ListView {
id: wiredView id: wiredView
visible: enabledConnections.wwanEnabled
Layout.fillWidth: true Layout.fillWidth: true
implicitHeight: wiredView.count * control.itemHeight Layout.preferredHeight: wiredView.count * control.itemHeight
interactive: false
clip: true clip: true
model: NM.TechnologyProxyModel { model: NM.TechnologyProxyModel {
type: NM.TechnologyProxyModel.WiredType type: NM.TechnologyProxyModel.WiredType
showInactiveConnections: true
sourceModel: networkModel sourceModel: networkModel
} }
@ -93,10 +115,6 @@ ItemPage {
} }
} }
HorizontalDivider {
visible: wiredView.visible && enabledConnections.wirelessHwEnabled
}
RoundedItem { RoundedItem {
WifiView { WifiView {
Layout.fillWidth: true Layout.fillWidth: true

Loading…
Cancel
Save