mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:35:08 +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()
|
void TrayIcon::updateTrayIconShape()
|
||||||
{
|
{
|
||||||
QString mainIconPath;
|
const QString mainIconPath = trayIconPath();
|
||||||
|
|
||||||
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 auto icon = m_alerted
|
const auto icon = m_alerted
|
||||||
? (m_animatedAlert ? IconCache::icon(":/icons/error.png")
|
? (m_animatedAlert ? IconCache::icon(":/icons/error.png")
|
||||||
@ -680,6 +672,20 @@ void TrayIcon::updateTrayIconShape()
|
|||||||
this->setIcon(icon);
|
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()
|
void TrayIcon::saveTrayFlags()
|
||||||
{
|
{
|
||||||
conf()->setFilterEnabled(m_filterEnabledAction->isChecked());
|
conf()->setFilterEnabled(m_filterEnabledAction->isChecked());
|
||||||
|
@ -118,6 +118,8 @@ private:
|
|||||||
|
|
||||||
void updateTrayIconShape();
|
void updateTrayIconShape();
|
||||||
|
|
||||||
|
QString trayIconPath() const;
|
||||||
|
|
||||||
void updateActionHotKeys();
|
void updateActionHotKeys();
|
||||||
|
|
||||||
void addHotKey(QAction *action, const char *iniKey);
|
void addHotKey(QAction *action, const char *iniKey);
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
<file>icons/fort-96.png</file>
|
<file>icons/fort-96.png</file>
|
||||||
<file>icons/fort.png</file>
|
<file>icons/fort.png</file>
|
||||||
<file>icons/fort_gray.png</file>
|
<file>icons/fort_gray.png</file>
|
||||||
|
<file>icons/fort_orange.png</file>
|
||||||
<file>icons/fort_red.png</file>
|
<file>icons/fort_red.png</file>
|
||||||
<file>icons/github.png</file>
|
<file>icons/github.png</file>
|
||||||
<file>icons/global_telecom.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