Skip to content

Commit b4d0665

Browse files
committed
Merge branch 'marcus/wlan_manager_0414' into 'main'
[WLAN Manager] Implemented: WLAN manager See merge request MarcusPy827/husky-panel!34
2 parents 42587e9 + 956d5b0 commit b4d0665

27 files changed

Lines changed: 4650 additions & 24 deletions

‎.github/workflows/build-rpm.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ jobs:
3939
libdbusmenu-lxqt-devel \
4040
kf6-kservice-devel \
4141
extra-cmake-modules \
42-
pulseaudio-libs-devel
42+
pulseaudio-libs-devel \
43+
libxcb-devel
4344
4445
- name: Checkout repository
4546
uses: actions/checkout@v4

‎.gitlab-ci.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ build:rpm:fedora:
3838
kf6-kservice-devel
3939
extra-cmake-modules
4040
pulseaudio-libs-devel
41+
libxcb-devel
4142

4243
script:
4344
# ---- Create source tarball using git archive ----

‎CHANGELOG‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog | 更新信息
22
## VERSION 0.9.5 (UNSTABLE/WIP)
3+
* marcus/vlan_manager_0414
4+
* Implemented a network manager
5+
* 新增了网络管理器
6+
37
* marcus/bluetooth_0412
48
* Implemented a bluetooth control panel.
59
* 新增了蓝牙控制面板

‎CMakeLists.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ set(BACKEND_SOURCES
181181
src/info_server/volume_control/volume_control.cc
182182
src/info_server/bluetooth/bluetooth_info.h
183183
src/info_server/bluetooth/bluetooth_info.cc
184+
src/info_server/network_control/network_control.h
185+
src/info_server/network_control/network_control.cc
184186
)
185187

186188
set(FRONTEND_SOURCES
@@ -211,6 +213,8 @@ set(FRONTEND_SOURCES
211213
src/components/volume_control/volume_control_handler.cc
212214
src/components/bluetooth/bluetooth_handler.h
213215
src/components/bluetooth/bluetooth_handler.cc
216+
src/components/network_control/network_control_handler.h
217+
src/components/network_control/network_control_handler.cc
214218
)
215219

216220
set(CONFIG_LOADER_SOURCES

‎packages/PKGBUILD‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ makedepends=(
2020
'cmake'
2121
'extra-cmake-modules'
2222
'qt6-tools'
23+
'wayland'
2324
'wayland-protocols'
2425
'libxkbcommon'
2526
'git'
2627
)
28+
optdepends=(
29+
'libxcb: X11/Xorg session support'
30+
)
2731
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz")
2832
sha256sums=('SKIP')
2933

‎packages/husky-panel.spec‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ BuildRequires: kf6-kservice-devel
2525
BuildRequires: extra-cmake-modules
2626
BuildRequires: pkgconfig(libpulse)
2727

28+
# Optional: enables XCB/X11 session support
29+
# BuildRequires: libxcb-devel
30+
2831
Requires: qt6-qtbase
2932
Requires: qt6-qtdeclarative
3033
Requires: qt6-qtwayland

‎res/interfaces/MainWindow.qml‎

Lines changed: 67 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import "wlan_indicator"
3131
import "system_tray"
3232
import "volume_control"
3333
import "bluetooth"
34+
import "network_control"
3435

3536
Window {
3637
id: root
@@ -55,6 +56,8 @@ Window {
5556
property bool volumeFlyoutExpanded: false
5657
property bool bluetoothFlyoutOpen: false
5758
property bool bluetoothFlyoutExpanded: false
59+
property bool networkFlyoutOpen: false
60+
property bool networkFlyoutExpanded: false
5861

5962
// Restrict input to the bar on startup; the window is always drawerH taller
6063
// than the visible bar, so without this the transparent area eats clicks.
@@ -120,6 +123,7 @@ Window {
120123
calendarFlyoutOpen = false
121124
trayOverflowOpen = false
122125
volumeFlyoutOpen = false
126+
networkFlyoutOpen = false
123127
bluetoothFlyoutExpanded = true
124128
LayerShellHelper.setFullMask(root)
125129
bluetoothFlyout.open()
@@ -129,33 +133,61 @@ Window {
129133
}
130134
}
131135

136+
onNetworkFlyoutOpenChanged: {
137+
if (networkFlyoutOpen) {
138+
appDrawerOpen = false
139+
calendarFlyoutOpen = false
140+
trayOverflowOpen = false
141+
volumeFlyoutOpen = false
142+
bluetoothFlyoutOpen = false
143+
networkFlyoutExpanded = true
144+
LayerShellHelper.setFullMask(root)
145+
networkFlyout.open()
146+
} else {
147+
networkFlyout.close()
148+
// networkFlyoutExpanded → false is set by onCloseAnimationFinished below
149+
}
150+
}
151+
132152
onDrawerExpandedChanged: {
133153
if (!drawerExpanded && !calendarFlyoutExpanded && !trayOverflowExpanded
134-
&& !volumeFlyoutExpanded && !bluetoothFlyoutExpanded)
154+
&& !volumeFlyoutExpanded && !bluetoothFlyoutExpanded
155+
&& !networkFlyoutExpanded)
135156
LayerShellHelper.setBarOnlyMask(root, barHeight)
136157
}
137158

138159
onCalendarFlyoutExpandedChanged: {
139160
if (!calendarFlyoutExpanded && !drawerExpanded && !trayOverflowExpanded
140-
&& !volumeFlyoutExpanded && !bluetoothFlyoutExpanded)
161+
&& !volumeFlyoutExpanded && !bluetoothFlyoutExpanded
162+
&& !networkFlyoutExpanded)
141163
LayerShellHelper.setBarOnlyMask(root, barHeight)
142164
}
143165

144166
onTrayOverflowExpandedChanged: {
145167
if (!trayOverflowExpanded && !drawerExpanded && !calendarFlyoutExpanded
146-
&& !volumeFlyoutExpanded && !bluetoothFlyoutExpanded)
168+
&& !volumeFlyoutExpanded && !bluetoothFlyoutExpanded
169+
&& !networkFlyoutExpanded)
147170
LayerShellHelper.setBarOnlyMask(root, barHeight)
148171
}
149172

150173
onVolumeFlyoutExpandedChanged: {
151174
if (!volumeFlyoutExpanded && !drawerExpanded && !calendarFlyoutExpanded
152-
&& !trayOverflowExpanded && !bluetoothFlyoutExpanded)
175+
&& !trayOverflowExpanded && !bluetoothFlyoutExpanded
176+
&& !networkFlyoutExpanded)
153177
LayerShellHelper.setBarOnlyMask(root, barHeight)
154178
}
155179

156180
onBluetoothFlyoutExpandedChanged: {
157181
if (!bluetoothFlyoutExpanded && !drawerExpanded && !calendarFlyoutExpanded
158-
&& !trayOverflowExpanded && !volumeFlyoutExpanded)
182+
&& !trayOverflowExpanded && !volumeFlyoutExpanded
183+
&& !networkFlyoutExpanded)
184+
LayerShellHelper.setBarOnlyMask(root, barHeight)
185+
}
186+
187+
onNetworkFlyoutExpandedChanged: {
188+
if (!networkFlyoutExpanded && !drawerExpanded && !calendarFlyoutExpanded
189+
&& !trayOverflowExpanded && !volumeFlyoutExpanded
190+
&& !bluetoothFlyoutExpanded)
159191
LayerShellHelper.setBarOnlyMask(root, barHeight)
160192
}
161193

@@ -164,13 +196,15 @@ Window {
164196
anchors.fill: parent
165197
visible: (root.appDrawerOpen || root.calendarFlyoutOpen
166198
|| root.trayOverflowOpen || root.volumeFlyoutOpen
167-
|| root.bluetoothFlyoutOpen) && !confirmDialog.visible
199+
|| root.bluetoothFlyoutOpen || root.networkFlyoutOpen)
200+
&& !confirmDialog.visible
168201
onClicked: {
169202
root.appDrawerOpen = false
170203
root.calendarFlyoutOpen = false
171204
root.trayOverflowOpen = false
172205
root.volumeFlyoutOpen = false
173206
root.bluetoothFlyoutOpen = false
207+
root.networkFlyoutOpen = false
174208
}
175209
}
176210

@@ -542,8 +576,11 @@ Window {
542576
onClicked: root.volumeFlyoutOpen = !root.volumeFlyoutOpen
543577
}
544578

545-
// WLAN indicator
546-
WLANIndicator {}
579+
// WLAN / network indicator
580+
WLANIndicator {
581+
id: networkIndicatorBtn
582+
onClicked: root.networkFlyoutOpen = !root.networkFlyoutOpen
583+
}
547584

548585
// Battery indicator
549586
BatteryIndicator {}
@@ -666,6 +703,28 @@ Window {
666703
}
667704
}
668705

706+
// Network flyout
707+
Item {
708+
readonly property int flyoutW: 320
709+
x: {
710+
var _track = rightBarGroup.x + networkIndicatorBtn.x + networkIndicatorBtn.width // qmllint disable missing-property
711+
var btnCenterX = networkIndicatorBtn.mapToItem( // qmllint disable missing-property
712+
baseLayer, networkIndicatorBtn.width / 2, 0).x // qmllint disable missing-property
713+
return Math.max(8, Math.min(root.width - flyoutW - 8,
714+
btnCenterX - flyoutW / 2))
715+
}
716+
y: root.barHeight + root.drawerTopMargin
717+
width: flyoutW
718+
height: networkFlyout.implicitHeight
719+
visible: root.networkFlyoutExpanded
720+
721+
NetworkFlyout {
722+
id: networkFlyout
723+
anchors.fill: parent
724+
onCloseAnimationFinished: root.networkFlyoutExpanded = false
725+
}
726+
}
727+
669728
// Config panel (standalone frameless window)
670729
ConfigPanelWindow {
671730
id: configPanelWindow

‎res/interfaces/bluetooth/BluetoothFlyout.qml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ Item {
102102
Rectangle {
103103
Layout.fillWidth: true
104104
Layout.preferredHeight: headerRow.implicitHeight + 24
105-
Layout.topMargin: 2
106-
Layout.leftMargin: 2
107-
Layout.rightMargin: 2
105+
Layout.topMargin: 3
106+
Layout.leftMargin: 3
107+
Layout.rightMargin: 3
108108
color: Theme.surface_container // qmllint disable unqualified
109109
topLeftRadius: 10
110110
topRightRadius: 10

‎res/interfaces/clock_btn/CalendarFlyout.qml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ Item {
126126
id: calendar_flyout_header
127127
Layout.fillWidth: true
128128
Layout.preferredHeight: root.headerH
129-
Layout.margins: 2
129+
Layout.topMargin: 3
130+
Layout.bottomMargin: 2
131+
Layout.leftMargin: 3
132+
Layout.rightMargin: 3
130133
color: Theme.surface_container
131134
topLeftRadius: 12
132135
topRightRadius: 12
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* Md3Switch.qml — Material 3 toggle switch for the network control flyout
3+
* Copyright (C) 2026 MarcusPy827
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
import QtQuick
20+
import QtQuick.Layouts
21+
22+
Item {
23+
id: root
24+
25+
implicitWidth: 52
26+
implicitHeight: 32
27+
Layout.alignment: Qt.AlignVCenter
28+
29+
property bool checked: false
30+
31+
signal toggled
32+
33+
property bool isHovered: false
34+
property bool isPressed: false
35+
36+
readonly property real handleSize:
37+
isPressed ? 28 : (checked ? 24 : 16)
38+
readonly property real handleCenterX: checked ? 36 : 16
39+
readonly property color handleColor:
40+
checked
41+
? ((isHovered || isPressed) ? Theme.primary_container // qmllint disable unqualified
42+
: Theme.surface_bg) // qmllint disable unqualified
43+
: Theme.surface_variant_fg // qmllint disable unqualified
44+
readonly property color stateLayerColor: {
45+
var c = checked ? Theme.primary : Theme.surface_fg // qmllint disable unqualified
46+
if (isPressed) return Qt.rgba(c.r, c.g, c.b, 0.10)
47+
if (isHovered) return Qt.rgba(c.r, c.g, c.b, 0.08)
48+
return "transparent"
49+
}
50+
51+
// Track
52+
Rectangle {
53+
anchors.fill: parent
54+
radius: 16
55+
color: root.checked
56+
? Theme.primary // qmllint disable unqualified
57+
: Theme.surface_container_high // qmllint disable unqualified
58+
border.width: root.checked ? 0 : 2
59+
border.color: Theme.surface_variant_fg // qmllint disable unqualified
60+
Behavior on color { ColorAnimation { duration: 200; easing.type: Easing.OutCubic } }
61+
Behavior on border.width { NumberAnimation { duration: 200; easing.type: Easing.OutCubic } }
62+
}
63+
64+
// State-layer
65+
Rectangle {
66+
width: 40; height: 40; radius: 20
67+
anchors.verticalCenter: parent.verticalCenter
68+
x: root.handleCenterX - 20
69+
color: root.stateLayerColor
70+
Behavior on x { NumberAnimation { duration: 200; easing.type: Easing.OutCubic } }
71+
Behavior on color { ColorAnimation { duration: 150; easing.type: Easing.OutCubic } }
72+
}
73+
74+
// Handle
75+
Rectangle {
76+
width: root.handleSize; height: width; radius: width / 2
77+
anchors.verticalCenter: parent.verticalCenter
78+
x: root.handleCenterX - root.handleSize / 2
79+
color: root.handleColor
80+
Behavior on width { NumberAnimation { duration: 200; easing.type: Easing.OutCubic } }
81+
Behavior on x { NumberAnimation { duration: 200; easing.type: Easing.OutCubic } }
82+
Behavior on color { ColorAnimation { duration: 200; easing.type: Easing.OutCubic } }
83+
}
84+
85+
MouseArea {
86+
anchors.fill: parent
87+
hoverEnabled: true
88+
onEntered: root.isHovered = true
89+
onExited: { root.isHovered = false; root.isPressed = false }
90+
onPressed: root.isPressed = true
91+
onReleased: root.isPressed = false
92+
onClicked: root.toggled()
93+
}
94+
}

0 commit comments

Comments
 (0)