mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-26 23:57:22 -08:00
Wi-Fi icon improvements
Don't update it if it isn't necessary.
This commit is contained in:
parent
cfdace7dab
commit
e4a21f5c85
2 changed files with 17 additions and 6 deletions
|
@ -66,6 +66,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
global::mainwindow::tabSwitcher::repaint = true;
|
||||
resetFullWindowException = false;
|
||||
wifiIconClickedWhileReconnecting = false;
|
||||
lastWifiState = 0;
|
||||
|
||||
// Getting the screen's size
|
||||
sW = QGuiApplication::screens()[0]->size().width();
|
||||
|
@ -954,19 +955,28 @@ void MainWindow::setWifiIcon() {
|
|||
global::device::isWifiAble = true;
|
||||
if(checkWifiState() == true) {
|
||||
if(testPing() == 0) {
|
||||
if(lastWifiState != 3) {
|
||||
lastWifiState = 3;
|
||||
ui->wifiBtn->setIcon(QIcon(":/resources/wifi-connected.png"));
|
||||
ui->wifiBtn->setIconSize(QSize(wifiIconWidth, wifiIconHeight));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(lastWifiState != 2) {
|
||||
lastWifiState = 2;
|
||||
ui->wifiBtn->setIcon(QIcon(":/resources/wifi-standby.png"));
|
||||
ui->wifiBtn->setIconSize(QSize(wifiIconWidth, wifiIconHeight));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(lastWifiState != 1) {
|
||||
lastWifiState = 1;
|
||||
ui->wifiBtn->setIcon(QIcon(":/resources/wifi-off.png"));
|
||||
ui->wifiBtn->setIconSize(QSize(wifiIconWidth, wifiIconHeight));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
global::device::isWifiAble = false;
|
||||
ui->wifiBtn->hide();
|
||||
|
|
|
@ -49,6 +49,7 @@ public:
|
|||
bool reboot_after_update = false;
|
||||
bool resetFullWindowException;
|
||||
bool wifiIconClickedWhileReconnecting;
|
||||
int lastWifiState;
|
||||
int timerTime = 0;
|
||||
QString relative_path;
|
||||
QString usbmsStatus;
|
||||
|
|
Loading…
Reference in a new issue