controlcenter: merged wireless/ethernet panes
This commit is contained in:
parent
540cebdbbd
commit
6043adf666
2 changed files with 84 additions and 122 deletions
|
|
@ -158,13 +158,8 @@ Item {
|
|||
|
||||
NavItem {
|
||||
Layout.topMargin: Appearance.spacing.large * 2
|
||||
icon: "cable"
|
||||
label: "ethernet"
|
||||
}
|
||||
|
||||
NavItem {
|
||||
icon: "wifi"
|
||||
label: "wireless"
|
||||
icon: "router"
|
||||
label: "networking"
|
||||
}
|
||||
|
||||
NavItem {
|
||||
|
|
@ -191,11 +186,6 @@ Item {
|
|||
icon: "apps"
|
||||
label: "launcher"
|
||||
}
|
||||
|
||||
NavItem {
|
||||
icon: "router"
|
||||
label: "networking"
|
||||
}
|
||||
}
|
||||
|
||||
component NavItem: Item {
|
||||
|
|
|
|||
|
|
@ -90,9 +90,9 @@ RowLayout {
|
|||
} else {
|
||||
// Toggle to show settings - prefer ethernet if available, otherwise wireless
|
||||
if (Nmcli.ethernetDevices.length > 0) {
|
||||
root.session.ethernet.active = ethernetListView.model.get(0)?.modelData ?? null;
|
||||
root.session.ethernet.active = Nmcli.ethernetDevices[0];
|
||||
} else if (Nmcli.networks.length > 0) {
|
||||
root.session.network.active = wirelessListView.model.get(0)?.modelData ?? null;
|
||||
root.session.network.active = Nmcli.networks[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -127,29 +127,16 @@ RowLayout {
|
|||
color: Colours.palette.m3outline
|
||||
}
|
||||
|
||||
Item {
|
||||
Repeater {
|
||||
id: ethernetRepeater
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Nmcli.ethernetDevices.length > 0 ? Math.min(400, Math.max(200, Nmcli.ethernetDevices.length * 80)) : 200
|
||||
|
||||
StyledListView {
|
||||
id: ethernetListView
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
model: Nmcli.ethernetDevices
|
||||
|
||||
spacing: Appearance.spacing.small / 2
|
||||
clip: true
|
||||
|
||||
StyledScrollBar.vertical: StyledScrollBar {
|
||||
flickable: ethernetListView
|
||||
}
|
||||
|
||||
delegate: StyledRect {
|
||||
required property var modelData
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
Layout.fillWidth: true
|
||||
|
||||
color: Qt.alpha(Colours.tPalette.m3surfaceContainer, root.session.ethernet.active === modelData ? Colours.tPalette.m3surfaceContainer.a : 0)
|
||||
radius: Appearance.rounding.normal
|
||||
|
|
@ -237,7 +224,6 @@ RowLayout {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CollapsibleSection {
|
||||
id: wirelessListSection
|
||||
|
|
@ -274,29 +260,16 @@ RowLayout {
|
|||
color: Colours.palette.m3outline
|
||||
}
|
||||
|
||||
Item {
|
||||
Repeater {
|
||||
id: wirelessRepeater
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Nmcli.networks.length > 0 ? Math.min(400, Math.max(200, Nmcli.networks.length * 80)) : 200
|
||||
|
||||
StyledListView {
|
||||
id: wirelessListView
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
model: Nmcli.networks
|
||||
|
||||
spacing: Appearance.spacing.small / 2
|
||||
clip: true
|
||||
|
||||
StyledScrollBar.vertical: StyledScrollBar {
|
||||
flickable: wirelessListView
|
||||
}
|
||||
|
||||
delegate: StyledRect {
|
||||
required property var modelData
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
Layout.fillWidth: true
|
||||
|
||||
color: Qt.alpha(Colours.tPalette.m3surfaceContainer, root.session.network.active === modelData ? Colours.tPalette.m3surfaceContainer.a : 0)
|
||||
radius: Appearance.rounding.normal
|
||||
|
|
@ -396,7 +369,6 @@ RowLayout {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InnerBorder {
|
||||
leftThickness: 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue