Update wifi setup design (#21604)

* wifi design draft

* ui draft 2

* draft

* updates

* fix spacing

* strength indicator

* font weight

* fix lock icon aspect ratio

* fix font weights

* new checkmark

* fix spacing

* was being applied to everything

* network handles its own padding

* fix spacing

* cleanup

* looks pretty good

* little more

* revert that

* scroll bar

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
pull/21622/head
sshane 2021-07-15 17:41:01 -07:00 committed by GitHub
parent ddd1342fc5
commit 0076dd3588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 139 additions and 70 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -0,0 +1,3 @@
<svg width="112" height="80" viewBox="0 0 56 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M52.3 4L19.8 35.7L4 19.9" stroke="white" stroke-width="7" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 243 B

View File

@ -1,4 +1,4 @@
<svg width="246" height="342" viewBox="0 0 41 57" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M36.106 22.9503L35.488 22.9378L35.4817 15.2271C35.4755 6.82748 28.665 -0.00625943 20.294 4.30252e-06C11.923 0.00626804 5.11253 6.84 5.11877 15.2397L5.13125 22.9503H4.58192C1.70419 22.9566 -0.00622535 25.2992 1.7028e-05 28.1868V51.7698C1.7028e-05 54.6574 1.71667 57 4.59441 57L37.0423 56.9812C39.92 56.9812 41.0062 54.6386 41 51.751V28.1618C41 24.7418 39.327 22.9378 36.106 22.9503ZM10.7244 22.9503L10.7119 15.2397C10.7119 9.93429 15.0067 5.61858 20.294 5.61231C25.5813 5.61231 29.8823 9.92803 29.8823 15.2271L29.8948 22.9378L10.7244 22.9503Z" fill="#FFFFFF"/>
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="211 182 40 49" width="40" height="49" xmlns="http://www.w3.org/2000/svg">
<path d="M 246.225 201.73 L 245.622 201.719 L 245.616 195.091 C 245.61 187.87 238.966 181.995 230.799 182 C 222.632 182.006 215.988 187.88 215.994 195.101 L 216.006 201.73 L 215.47 201.73 C 212.662 201.735 210.994 203.749 211 206.231 L 211 226.504 C 211 228.987 212.675 231 215.482 231 L 247.139 230.985 C 249.946 230.985 251.006 228.97 251 226.488 L 251 206.209 C 251 203.269 249.368 201.719 246.225 201.73 Z M 221.463 201.73 L 221.45 195.101 C 221.45 190.541 225.64 186.83 230.799 186.825 C 235.957 186.825 240.153 190.535 240.153 195.091 L 240.165 201.719 L 221.463 201.73 Z" fill="#696969"/>
</svg>

Before

Width:  |  Height:  |  Size: 675 B

After

Width:  |  Height:  |  Size: 732 B

View File

@ -0,0 +1,6 @@
<svg width="68" height="68" viewBox="0 0 68 68" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M34.0004 8.63599C21.8284 8.63599 10.7444 13.26 2.31243 20.808C1.56443 21.488 1.4964 22.644 2.1084 23.392L4.76041 26.452C5.44041 27.2 6.59641 27.268 7.34441 26.588C14.4164 20.196 23.7324 16.32 33.9324 16.32C44.1324 16.32 53.4484 20.196 60.5204 26.588C61.2684 27.268 62.4244 27.2 63.1044 26.452L65.7564 23.392C66.4364 22.644 66.3004 21.488 65.5524 20.808C57.2564 13.26 46.1724 8.63599 34.0004 8.63599Z" fill="white"/>
<path d="M34.0004 22.032C25.1604 22.032 17.0684 25.432 11.0164 30.94C10.2684 31.62 10.2004 32.708 10.8804 33.456L13.3964 36.38C14.0764 37.196 15.2324 37.196 16.0484 36.516C20.8084 32.164 27.1324 29.512 34.0684 29.512C41.0044 29.512 47.3284 32.164 52.0884 36.516C52.8364 37.196 54.0604 37.196 54.7404 36.38L57.2564 33.456C57.8684 32.708 57.8684 31.552 57.1204 30.94C50.9324 25.364 42.8404 22.032 34.0004 22.032Z" fill="white"/>
<path d="M34.0007 35.36C28.4247 35.36 23.3927 37.536 19.6527 41.14C18.9727 41.82 18.9047 42.908 19.5847 43.656L21.9647 46.444C22.6447 47.26 23.8687 47.26 24.6167 46.58C27.0647 44.2 30.3287 42.772 34.0007 42.772C37.6727 42.772 40.9367 44.2 43.3847 46.58C44.1327 47.328 45.3567 47.26 46.0367 46.444L48.4167 43.656C49.0287 42.908 49.0287 41.82 48.3487 41.14C44.6087 37.536 39.5767 35.36 34.0007 35.36Z" fill="white"/>
<path d="M34.0005 48.688C31.7565 48.688 29.7165 49.708 28.3565 51.34C27.7445 52.02 27.7445 53.04 28.3565 53.72L32.6405 58.684C33.3885 59.5 34.6804 59.5 35.4284 58.684L39.7125 53.72C40.3245 53.04 40.3245 52.02 39.7125 51.34C38.2845 49.708 36.2445 48.688 34.0005 48.688Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,6 @@
<svg width="68" height="68" viewBox="0 0 68 68" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M34.0004 8.63599C21.8284 8.63599 10.7444 13.26 2.31243 20.808C1.56443 21.488 1.4964 22.644 2.1084 23.392L4.76041 26.452C5.44041 27.2 6.59641 27.268 7.34441 26.588C14.4164 20.196 23.7324 16.32 33.9324 16.32C44.1324 16.32 53.4484 20.196 60.5204 26.588C61.2684 27.268 62.4244 27.2 63.1044 26.452L65.7564 23.392C66.4364 22.644 66.3004 21.488 65.5524 20.808C57.2564 13.26 46.1724 8.63599 34.0004 8.63599Z" fill="#3D3D3D"/>
<path d="M34.0004 22.032C25.1604 22.032 17.0684 25.432 11.0164 30.94C10.2684 31.62 10.2004 32.708 10.8804 33.456L13.3964 36.38C14.0764 37.196 15.2324 37.196 16.0484 36.516C20.8084 32.164 27.1324 29.512 34.0684 29.512C41.0044 29.512 47.3284 32.164 52.0884 36.516C52.8364 37.196 54.0604 37.196 54.7404 36.38L57.2564 33.456C57.8684 32.708 57.8684 31.552 57.1204 30.94C50.9324 25.364 42.8404 22.032 34.0004 22.032Z" fill="white"/>
<path d="M34.0007 35.36C28.4247 35.36 23.3927 37.536 19.6527 41.14C18.9727 41.82 18.9047 42.908 19.5847 43.656L21.9647 46.444C22.6447 47.26 23.8687 47.26 24.6167 46.58C27.0647 44.2 30.3287 42.772 34.0007 42.772C37.6727 42.772 40.9367 44.2 43.3847 46.58C44.1327 47.328 45.3567 47.26 46.0367 46.444L48.4167 43.656C49.0287 42.908 49.0287 41.82 48.3487 41.14C44.6087 37.536 39.5767 35.36 34.0007 35.36Z" fill="white"/>
<path d="M34.0005 48.688C31.7565 48.688 29.7165 49.708 28.3565 51.34C27.7445 52.02 27.7445 53.04 28.3565 53.72L32.6405 58.684C33.3885 59.5 34.6804 59.5 35.4284 58.684L39.7125 53.72C40.3245 53.04 40.3245 52.02 39.7125 51.34C38.2845 49.708 36.2445 48.688 34.0005 48.688Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,6 @@
<svg width="68" height="68" viewBox="0 0 68 68" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M34.0004 8.63599C21.8284 8.63599 10.7444 13.26 2.31243 20.808C1.56443 21.488 1.4964 22.644 2.1084 23.392L4.76041 26.452C5.44041 27.2 6.59641 27.268 7.34441 26.588C14.4164 20.196 23.7324 16.32 33.9324 16.32C44.1324 16.32 53.4484 20.196 60.5204 26.588C61.2684 27.268 62.4244 27.2 63.1044 26.452L65.7564 23.392C66.4364 22.644 66.3004 21.488 65.5524 20.808C57.2564 13.26 46.1724 8.63599 34.0004 8.63599Z" fill="#3D3D3D"/>
<path d="M34.0004 22.032C25.1604 22.032 17.0684 25.432 11.0164 30.94C10.2684 31.62 10.2004 32.708 10.8804 33.456L13.3964 36.38C14.0764 37.196 15.2324 37.196 16.0484 36.516C20.8084 32.164 27.1324 29.512 34.0684 29.512C41.0044 29.512 47.3284 32.164 52.0884 36.516C52.8364 37.196 54.0604 37.196 54.7404 36.38L57.2564 33.456C57.8684 32.708 57.8684 31.552 57.1204 30.94C50.9324 25.364 42.8404 22.032 34.0004 22.032Z" fill="#3D3D3D"/>
<path d="M34.0007 35.36C28.4247 35.36 23.3927 37.536 19.6527 41.14C18.9727 41.82 18.9047 42.908 19.5847 43.656L21.9647 46.444C22.6447 47.26 23.8687 47.26 24.6167 46.58C27.0647 44.2 30.3287 42.772 34.0007 42.772C37.6727 42.772 40.9367 44.2 43.3847 46.58C44.1327 47.328 45.3567 47.26 46.0367 46.444L48.4167 43.656C49.0287 42.908 49.0287 41.82 48.3487 41.14C44.6087 37.536 39.5767 35.36 34.0007 35.36Z" fill="#3D3D3D"/>
<path d="M34.0005 48.688C31.7565 48.688 29.7165 49.708 28.3565 51.34C27.7445 52.02 27.7445 53.04 28.3565 53.72L32.6405 58.684C33.3885 59.5 34.6804 59.5 35.4284 58.684L39.7125 53.72C40.3245 53.04 40.3245 52.02 39.7125 51.34C38.2845 49.708 36.2445 48.688 34.0005 48.688Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,6 @@
<svg width="68" height="68" viewBox="0 0 68 68" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M34.0004 8.63599C21.8284 8.63599 10.7444 13.26 2.31243 20.808C1.56443 21.488 1.4964 22.644 2.1084 23.392L4.76041 26.452C5.44041 27.2 6.59641 27.268 7.34441 26.588C14.4164 20.196 23.7324 16.32 33.9324 16.32C44.1324 16.32 53.4484 20.196 60.5204 26.588C61.2684 27.268 62.4244 27.2 63.1044 26.452L65.7564 23.392C66.4364 22.644 66.3004 21.488 65.5524 20.808C57.2564 13.26 46.1724 8.63599 34.0004 8.63599Z" fill="#3D3D3D"/>
<path d="M34.0004 22.032C25.1604 22.032 17.0684 25.432 11.0164 30.94C10.2684 31.62 10.2004 32.708 10.8804 33.456L13.3964 36.38C14.0764 37.196 15.2324 37.196 16.0484 36.516C20.8084 32.164 27.1324 29.512 34.0684 29.512C41.0044 29.512 47.3284 32.164 52.0884 36.516C52.8364 37.196 54.0604 37.196 54.7404 36.38L57.2564 33.456C57.8684 32.708 57.8684 31.552 57.1204 30.94C50.9324 25.364 42.8404 22.032 34.0004 22.032Z" fill="#3D3D3D"/>
<path d="M34.0007 35.36C28.4247 35.36 23.3927 37.536 19.6527 41.14C18.9727 41.82 18.9047 42.908 19.5847 43.656L21.9647 46.444C22.6447 47.26 23.8687 47.26 24.6167 46.58C27.0647 44.2 30.3287 42.772 34.0007 42.772C37.6727 42.772 40.9367 44.2 43.3847 46.58C44.1327 47.328 45.3567 47.26 46.0367 46.444L48.4167 43.656C49.0287 42.908 49.0287 41.82 48.3487 41.14C44.6087 37.536 39.5767 35.36 34.0007 35.36Z" fill="white"/>
<path d="M34.0005 48.688C31.7565 48.688 29.7165 49.708 28.3565 51.34C27.7445 52.02 27.7445 53.04 28.3565 53.72L32.6405 58.684C33.3885 59.5 34.6804 59.5 35.4284 58.684L39.7125 53.72C40.3245 53.04 40.3245 52.02 39.7125 51.34C38.2845 49.708 36.2445 48.688 34.0005 48.688Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -4,34 +4,34 @@
#include <QHBoxLayout>
#include <QLabel>
#include <QPainter>
#include <QScrollBar>
#include "selfdrive/ui/qt/widgets/scrollview.h"
#include "selfdrive/ui/qt/util.h"
void NetworkStrengthWidget::paintEvent(QPaintEvent* event) {
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing);
p.setPen(Qt::NoPen);
const QColor gray(0x54, 0x54, 0x54);
for (int i = 0, x = 0; i < 5; ++i) {
p.setBrush(i < strength_ ? Qt::white : gray);
p.drawEllipse(x, 0, 15, 15);
x += 20;
}
QLabel *networkStrengthWidget(const unsigned int strength_) {
QLabel *strength = new QLabel();
QVector<QString> imgs({"low", "medium", "high", "full"});
QPixmap pix("../assets/offroad/icon_wifi_strength_" + imgs.at(strength_) + ".svg");
strength->setPixmap(pix.scaledToHeight(68, Qt::SmoothTransformation));
strength->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
strength->setStyleSheet("padding: 0px; margin-left: 50px; margin-right: 80px ");
return strength;
}
// Networking functions
Networking::Networking(QWidget* parent, bool show_advanced) : QWidget(parent), show_advanced(show_advanced) {
Networking::Networking(QWidget* parent, bool show_advanced) : QFrame(parent) {
main_layout = new QStackedLayout(this);
wifi = new WifiManager(this);
connect(wifi, &WifiManager::wrongPassword, this, &Networking::wrongPassword);
connect(wifi, &WifiManager::refreshSignal, this, &Networking::refresh);
connect(wifi, &WifiManager::wrongPassword, this, &Networking::wrongPassword);
QWidget* wifiScreen = new QWidget(this);
QVBoxLayout* vlayout = new QVBoxLayout(wifiScreen);
vlayout->setContentsMargins(20, 20, 20, 20);
if (show_advanced) {
QPushButton* advancedSettings = new QPushButton("Advanced");
advancedSettings->setObjectName("advancedBtn");
@ -46,14 +46,22 @@ Networking::Networking(QWidget* parent, bool show_advanced) : QWidget(parent), s
wifiWidget = new WifiUI(this, wifi);
wifiWidget->setObjectName("wifiWidget");
connect(wifiWidget, &WifiUI::connectToNetwork, this, &Networking::connectToNetwork);
vlayout->addWidget(new ScrollView(wifiWidget, this), 1);
ScrollView *wifiScroller = new ScrollView(wifiWidget, this);
wifiScroller->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
vlayout->addWidget(wifiScroller, 1);
main_layout->addWidget(wifiScreen);
an = new AdvancedNetworking(this, wifi);
connect(an, &AdvancedNetworking::backPress, [=]() { main_layout->setCurrentWidget(wifiScreen); });
main_layout->addWidget(an);
// TODO: revisit pressed colors
setStyleSheet(R"(
Networking {
border-radius: 13px;
background-color: #292929;
}
#wifiWidget > QPushButton, #back_btn, #advancedBtn {
font-size: 50px;
margin: 0px;
@ -63,10 +71,6 @@ Networking::Networking(QWidget* parent, bool show_advanced) : QWidget(parent), s
color: #dddddd;
background-color: #444444;
}
#wifiWidget > QPushButton:disabled {
color: #777777;
background-color: #222222;
}
)");
main_layout->setCurrentWidget(wifiScreen);
}
@ -169,74 +173,119 @@ void AdvancedNetworking::toggleTethering(bool enabled) {
WifiUI::WifiUI(QWidget *parent, WifiManager* wifi) : QWidget(parent), wifi(wifi) {
main_layout = new QVBoxLayout(this);
main_layout->setContentsMargins(0, 0, 0, 0);
main_layout->setSpacing(0);
// Scan on startup
QLabel *scanning = new QLabel("Scanning for networks");
scanning->setStyleSheet(R"(font-size: 65px;)");
QLabel *scanning = new QLabel("Scanning for networks...");
scanning->setStyleSheet("font-size: 65px;");
main_layout->addWidget(scanning, 0, Qt::AlignCenter);
main_layout->setSpacing(25);
setStyleSheet(R"(
QScrollBar::handle:vertical {
min-height: 0px;
border-radius: 4px;
background-color: #8A8A8A;
}
#forgetBtn {
font-size: 32px;
font-weight: 600;
color: #292929;
background-color: #BDBDBD;
border-width: 1px solid #828282;
border-radius: 5px;
padding: 40px;
padding-bottom: 16px;
padding-top: 16px;
}
)");
}
void WifiUI::refresh() {
// TODO: don't rebuild this every time
clearLayout(main_layout);
if (wifi->seen_networks.size() == 0) {
QLabel *scanning = new QLabel("No networks found. Scanning...");
scanning->setStyleSheet(R"(font-size: 65px;)");
scanning->setStyleSheet("font-size: 65px;");
main_layout->addWidget(scanning, 0, Qt::AlignCenter);
return;
}
// add networks
int i = 0;
for (Network &network : wifi->seen_networks) {
QHBoxLayout *hlayout = new QHBoxLayout;
hlayout->setContentsMargins(44, 0, 0, 0);
hlayout->setSpacing(0);
ElidedLabel *ssid_label = new ElidedLabel(network.ssid);
ssid_label->setStyleSheet("font-size: 55px;");
hlayout->addWidget(ssid_label, 1, Qt::AlignLeft);
// Clickable SSID label
QPushButton *ssid_label = new QPushButton(network.ssid);
ssid_label->setEnabled(network.connected != ConnectedType::CONNECTED &&
network.connected != ConnectedType::CONNECTING &&
network.security_type != SecurityType::UNSUPPORTED);
int weight = network.connected == ConnectedType::DISCONNECTED ? 300 : 500;
ssid_label->setStyleSheet(QString(R"(
font-size: 55px;
font-weight: %1;
text-align: left;
border: none;
padding-top: 50px;
padding-bottom: 50px;
background-color: transparent;
)").arg(weight));
QObject::connect(ssid_label, &QPushButton::clicked, this, [=]() { emit connectToNetwork(network); });
hlayout->addWidget(ssid_label, 1);
// Forget button
if (wifi->isKnownConnection(network.ssid) && !wifi->isTetheringEnabled()) {
QPushButton *forgetBtn = new QPushButton();
QPixmap pix("../assets/offroad/icon_close.svg");
forgetBtn->setIcon(QIcon(pix));
forgetBtn->setIconSize(QSize(35, 35));
forgetBtn->setStyleSheet("QPushButton { background-color: #E22C2C; }");
forgetBtn->setFixedSize(100, 90);
QPushButton *forgetBtn = new QPushButton("FORGET");
forgetBtn->setObjectName("forgetBtn");
QObject::connect(forgetBtn, &QPushButton::released, [=]() {
if (ConfirmationDialog::confirm("Are you sure you want to forget " + QString::fromUtf8(network.ssid) + "?", this)) {
wifi->forgetConnection(network.ssid);
}
});
hlayout->addWidget(forgetBtn, 0, Qt::AlignRight);
}
// Status icon
if (network.connected == ConnectedType::CONNECTED) {
QLabel *connectIcon = new QLabel();
QPixmap pix("../assets/offroad/icon_checkmark.svg");
connectIcon->setPixmap(pix.scaledToWidth(49, Qt::SmoothTransformation));
connectIcon->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
connectIcon->setStyleSheet("margin: 0px; padding-left: 51px; padding-right: 0px ");
hlayout->addWidget(connectIcon, 0, Qt::AlignRight);
} else if (network.connected == ConnectedType::CONNECTING) {
QLabel *connectIcon = new QLabel();
// TODO replace connecting icon with proper widget/icon
QPixmap pix(network.connected == ConnectedType::CONNECTED ? "../assets/offroad/icon_checkmark.svg" : "../assets/navigation/direction_rotary.png");
connectIcon->setPixmap(pix.scaledToWidth(49, Qt::SmoothTransformation));
connectIcon->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
connectIcon->setStyleSheet("margin: 0px; padding-left: 51px; padding-right: 0px ");
hlayout->addWidget(connectIcon, 0, Qt::AlignRight);
} else if (network.security_type == SecurityType::WPA) {
QLabel *lockIcon = new QLabel();
QPixmap pix("../assets/offroad/icon_lock_closed.svg");
lockIcon->setPixmap(pix.scaledToWidth(35, Qt::SmoothTransformation));
lockIcon->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
lockIcon->setStyleSheet("QLabel { margin: 0px; padding-left: 15px; padding-right: 15px; }");
lockIcon->setPixmap(pix.scaledToHeight(49, Qt::SmoothTransformation));
lockIcon->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
lockIcon->setStyleSheet("padding: 0px; margin-left: 62px; margin-right: 0px ");
hlayout->addWidget(lockIcon, 0, Qt::AlignRight);
}
// strength indicator
unsigned int strength_scale = network.strength / 17;
hlayout->addWidget(new NetworkStrengthWidget(strength_scale), 0, Qt::AlignRight);
// Strength indicator
hlayout->addWidget(networkStrengthWidget(network.strength / 26), 0, Qt::AlignRight);
// connect button
QPushButton* btn = new QPushButton(network.security_type == SecurityType::UNSUPPORTED ? "Unsupported" : (network.connected == ConnectedType::CONNECTED ? "Connected" : (network.connected == ConnectedType::CONNECTING ? "Connecting" : "Connect")));
btn->setDisabled(network.connected == ConnectedType::CONNECTED || network.connected == ConnectedType::CONNECTING || network.security_type == SecurityType::UNSUPPORTED);
btn->setFixedWidth(350);
QObject::connect(btn, &QPushButton::clicked, this, [=]() { emit connectToNetwork(network); });
hlayout->addWidget(btn, 0, Qt::AlignRight);
main_layout->addLayout(hlayout, 1);
// Don't add the last horizontal line
if (i+1 < wifi->seen_networks.size()) {
main_layout->addWidget(horizontal_line(), 0);
}
i++;
}
main_layout->addStretch(3);
main_layout->addStretch(1);
}

View File

@ -9,17 +9,6 @@
#include "selfdrive/ui/qt/widgets/ssh_keys.h"
#include "selfdrive/ui/qt/widgets/toggle.h"
class NetworkStrengthWidget : public QWidget {
Q_OBJECT
public:
explicit NetworkStrengthWidget(int strength, QWidget* parent = nullptr) : strength_(strength), QWidget(parent) { setFixedSize(100, 15); }
private:
void paintEvent(QPaintEvent* event) override;
int strength_ = 0;
};
class WifiUI : public QWidget {
Q_OBJECT
@ -54,17 +43,16 @@ public slots:
void refresh();
};
class Networking : public QWidget {
class Networking : public QFrame {
Q_OBJECT
public:
explicit Networking(QWidget* parent = 0, bool show_advanced = true);
private:
QStackedLayout* main_layout = nullptr; // nm_warning, wifiScreen, advanced
QStackedLayout* main_layout = nullptr;
QWidget* wifiScreen = nullptr;
AdvancedNetworking* an = nullptr;
bool show_advanced;
WifiUI* wifiWidget;
WifiManager* wifi = nullptr;

View File

@ -366,7 +366,8 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
nav_btns->addButton(btn);
sidebar_layout->addWidget(btn, 0, Qt::AlignRight);
panel->setContentsMargins(50, 25, 50, 25);
const int lr_margin = name != "Network" ? 50 : 0; // Network panel handles its own margins
panel->setContentsMargins(lr_margin, 25, lr_margin, 25);
ScrollView *panel_frame = new ScrollView(panel, this);
panel_widget->addWidget(panel_frame);

View File

@ -29,6 +29,7 @@ struct Network {
class WifiManager : public QWidget {
Q_OBJECT
public:
explicit WifiManager(QWidget* parent);

View File

@ -93,10 +93,14 @@ QWidget * Setup::network_setup() {
title->setStyleSheet("font-size: 90px; font-weight: 500;");
main_layout->addWidget(title, 0, Qt::AlignLeft | Qt::AlignTop);
main_layout->addSpacing(25);
// wifi widget
Networking *wifi = new Networking(this, false);
main_layout->addWidget(wifi, 1);
main_layout->addSpacing(35);
// back + continue buttons
QHBoxLayout *blayout = new QHBoxLayout;
main_layout->addLayout(blayout);

View File

@ -8,18 +8,18 @@ ScrollView::ScrollView(QWidget *w, QWidget *parent) : QScrollArea(parent) {
setWidgetResizable(true);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setStyleSheet("ScrollView { background-color:transparent; }");
setStyleSheet("background-color: transparent;");
QString style = R"(
QScrollBar:vertical {
border: none;
background: transparent;
width:10px;
width: 10px;
margin: 0;
}
QScrollBar::handle:vertical {
min-height: 0px;
border-radius: 4px;
border-radius: 5px;
background-color: white;
}
QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {
@ -29,7 +29,6 @@ ScrollView::ScrollView(QWidget *w, QWidget *parent) : QScrollArea(parent) {
background: none;
}
)";
verticalScrollBar()->setStyleSheet(style);
horizontalScrollBar()->setStyleSheet(style);