refactor: force mac os to use the larger security icon in the status area

This commit is contained in:
sithlord48 2025-01-26 22:44:47 -05:00 committed by Nick Bolton
parent 30a37a8a50
commit 59ebb6fde4

View file

@ -983,13 +983,18 @@ void MainWindow::showConfigureServer(const QString &message)
void MainWindow::secureSocket(bool secureSocket) void MainWindow::secureSocket(bool secureSocket)
{ {
m_SecureSocket = secureSocket; m_SecureSocket = secureSocket;
if (secureSocket) { const auto txt = secureSocket ? tr("Secure Connection") : tr("Insecure Connection");
ui->lblConnectionSecurityStatus->setToolTip(tr("Secure Connection")); ui->lblConnectionSecurityStatus->setToolTip(txt);
ui->lblConnectionSecurityStatus->setPixmap(QIcon::fromTheme(QIcon::ThemeIcon::SecurityHigh).pixmap(QSize(32, 32)));
} else { // mac os will try to use the 16x16 low detail icon when we use the theme name
ui->lblConnectionSecurityStatus->setToolTip(tr("Insecure Connection")); // because of this we manually select the 64x64 icon from our packed in set
ui->lblConnectionSecurityStatus->setPixmap(QIcon::fromTheme(QIcon::ThemeIcon::SecurityLow).pixmap(QSize(32, 32))); #ifdef Q_OS_MAC
} const auto icon = QIcon(QStringLiteral(":/icons/deskflow-%1/status/64/security-%2")
.arg(iconMode(), secureSocket ? QStringLiteral("high") : QStringLiteral("low")));
#else
const auto icon = QIcon::fromTheme(secureSocket ? QIcon::ThemeIcon::SecurityHigh : QIcon::ThemeIcon::SecurityLow);
#endif
ui->lblConnectionSecurityStatus->setPixmap(icon.pixmap(QSize(32, 32)));
} }
void MainWindow::updateScreenName() void MainWindow::updateScreenName()