mirror of
https://github.com/tnodir/fort
synced 2024-11-15 03:46:13 +00:00
UI: Tray: Update icons
This commit is contained in:
parent
adf095e831
commit
e72498be56
@ -662,15 +662,7 @@ void TrayIcon::removeAlertTimer()
|
||||
|
||||
void TrayIcon::updateTrayIconShape()
|
||||
{
|
||||
QString mainIconPath;
|
||||
|
||||
if (!conf()->filterEnabled() || !driverManager()->isDeviceOpened()) {
|
||||
mainIconPath = ":/icons/fort_gray.png";
|
||||
} else if (conf()->blockTraffic() || conf()->blockInetTraffic()) {
|
||||
mainIconPath = ":/icons/fort_red.png";
|
||||
} else {
|
||||
mainIconPath = ":/icons/fort.png";
|
||||
}
|
||||
const QString mainIconPath = trayIconPath();
|
||||
|
||||
const auto icon = m_alerted
|
||||
? (m_animatedAlert ? IconCache::icon(":/icons/error.png")
|
||||
@ -680,6 +672,20 @@ void TrayIcon::updateTrayIconShape()
|
||||
this->setIcon(icon);
|
||||
}
|
||||
|
||||
QString TrayIcon::trayIconPath() const
|
||||
{
|
||||
if (!conf()->filterEnabled() || !driverManager()->isDeviceOpened()) {
|
||||
return ":/icons/fort_gray.png";
|
||||
}
|
||||
if (conf()->blockTraffic()) {
|
||||
return ":/icons/fort_red.png";
|
||||
}
|
||||
if (conf()->blockInetTraffic()) {
|
||||
return ":/icons/fort_orange.png";
|
||||
}
|
||||
return ":/icons/fort.png";
|
||||
}
|
||||
|
||||
void TrayIcon::saveTrayFlags()
|
||||
{
|
||||
conf()->setFilterEnabled(m_filterEnabledAction->isChecked());
|
||||
|
@ -118,6 +118,8 @@ private:
|
||||
|
||||
void updateTrayIconShape();
|
||||
|
||||
QString trayIconPath() const;
|
||||
|
||||
void updateActionHotKeys();
|
||||
|
||||
void addHotKey(QAction *action, const char *iniKey);
|
||||
|
@ -32,6 +32,7 @@
|
||||
<file>icons/fort-96.png</file>
|
||||
<file>icons/fort.png</file>
|
||||
<file>icons/fort_gray.png</file>
|
||||
<file>icons/fort_orange.png</file>
|
||||
<file>icons/fort_red.png</file>
|
||||
<file>icons/github.png</file>
|
||||
<file>icons/global_telecom.png</file>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
src/ui/icons/fort_orange.png
Normal file
BIN
src/ui/icons/fort_orange.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Loading…
Reference in New Issue
Block a user