Optimize wired UI

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

@ -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 {

@ -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

@ -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

Loading…
Cancel
Save