Skip to content

Commit c53df71

Browse files
triggrummanz
andauthored
util: refactor network manager (#333)
util: use ModemManager to show mobile data connection, use carrier name util: access points have 'has password' concept to see previously used APs util: sort wifi widgets by signal strength util: wifi AP name is added to class list to allow custom rules for any name util: wifi classes for band, has password, has psk util: connecting to an unknown wifi now prompts for password panel: option to have icon-only for network locker: use central network manager util util: active vpns are highlighted util: added support for wireguard VPN util: allow enabling of more than one VPN at a time --------- Co-authored-by: altrgeek <altrgeek@gmail.com>
1 parent 1ebc4e0 commit c53df71

30 files changed

Lines changed: 3156 additions & 882 deletions

data/css/default.css

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,25 +132,33 @@ text-shadow: 1px 1px 0 var(--bcol),
132132
background-color: #00FFAA77;
133133
border: 1px solid #222;
134134
}
135-
.excellent {
135+
.excellent>label {
136136
color: #00ff00;
137137
}
138138

139-
.good {
139+
.good>label
140+
{
140141
color: #88ff00;
141142
}
142143

143-
.ok {
144+
.ok>label
145+
{
144146
color: #ffff00;
145147
}
146148

147-
.weak {
149+
.weak>label
150+
{
148151
color: #ff8800;
149152
}
150153

151-
.none {
154+
.none>label
155+
{
152156
color: #ff0000;
153157
}
158+
.bluetooth>label
159+
{
160+
color: #8888ff;
161+
}
154162

155163
.wf-dock,
156164
.wf-dock .out-box {
@@ -191,7 +199,7 @@ text-shadow: 1px 1px 0 var(--bcol),
191199
-gtk-icon-transform: scale(1.0);
192200
}
193201

194-
.wf-dock image {
202+
.wf-dock image.toplevel-icon {
195203
animation-name: embiggen;
196204
animation-duration: 1000ms;
197205
animation-timing-function: linear;
@@ -206,6 +214,35 @@ text-shadow: 1px 1px 0 var(--bcol),
206214
animation-fill-mode: forwards;
207215
}
208216

217+
.network-control-center image.access-point {
218+
-gtk-icon-size: 40px;
219+
}
220+
221+
.network-control-center .access-point.secure .security {
222+
-gtk-icon-size:20px;
223+
color:red;
224+
}
225+
226+
227+
.network-control-center .access-point.secure.has-password .security {
228+
color:green;
229+
}
230+
231+
.network-control-center .access-point.has-password{
232+
font-weight: bold;
233+
background: #8f83;
234+
}
235+
236+
.network-control-center .vpn.active{
237+
font-weight: bold;
238+
background: #8f83;
239+
}
240+
241+
.network-control-center .access-point .band {
242+
font-size: 1em;
243+
font-weight: bolder;
244+
}
245+
209246
.wf-locker .password{
210247
padding: 10px;
211248
border-radius: 10px;
@@ -220,7 +257,6 @@ text-shadow: 1px 1px 0 var(--bcol),
220257
.wf-locker .fingerprint-overlay-image.info {
221258
color: #88f;
222259
}
223-
224260
.wf-locker .user label {
225261
font-weight: bold;
226262
text-transform: capitalize;
@@ -230,6 +266,7 @@ text-shadow: 1px 1px 0 var(--bcol),
230266
padding-right: 25px;
231267
padding-bottom: 100px;
232268
}
269+
233270
.wf-locker label.weather {
234271
font-weight: bold;
235272
padding-left: 100px;

metadata/panel.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ If full_span is off, both sides of the panel will take the same amount of space,
229229
<_short>On Click Command</_short>
230230
<default>default</default>
231231
</option>
232+
<option name="network_no_label" type="bool">
233+
<_short>No text</_short>
234+
<default>false</default>
235+
</option>
232236
</group>
233237
<group>
234238
<_short>Menu</_short>

src/dock/dock.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
#include "dock.hpp"
1212
#include "../util/gtk-utils.hpp"
13+
#include "gtkmm/flowbox.h"
14+
#include "network/manager.hpp"
15+
#include "network/network-widget.hpp"
16+
#include "network/network.hpp"
1317
#include <css-config.hpp>
1418

1519

@@ -19,6 +23,9 @@ class WfDock::impl
1923
std::unique_ptr<WayfireAutohidingWindow> window;
2024
wl_surface *_wl_surface;
2125
Gtk::FlowBox box;
26+
std::unique_ptr<WayfireMenuButton> network_image;
27+
std::unique_ptr<NetworkControlWidget> network_control;
28+
std::shared_ptr<NetworkManager> network_manager;
2229

2330
WfOption<std::string> css_path{"dock/css_path"};
2431
WfOption<int> entries_per_line{"dock/max_per_line"};

0 commit comments

Comments
 (0)