1
0
mirror of https://github.com/KDE/krfb synced 2026-07-01 07:41:17 -07:00

Use symbolic icon in tray

A colorful icon is being used in the tray, which doesn't match the rest of the icons present on the tray. A newly provided icon will make them finally match.

This MR depends on [breeze_icons !527](https://invent.kde.org/frameworks/breeze-icons/-/merge_requests/527) request to make the symbolic icon it requires for correct icon integration.

## Before:

![Captura_de_pantalla_20260214_180254](/uploads/d63f137076bf5d7be1a769fa83bef691/Captura_de_pantalla_20260214_180254.png){width=510 height=600}

## After:

![Captura_de_pantalla_20260214_192905](/uploads/ac46eb55c67298cbb567ab8bfb254ceb/Captura_de_pantalla_20260214_192905.png){width=485 height=600}
This commit is contained in:
Lito Parra
2026-02-24 20:06:16 -07:00
committed by Nate Graham
parent 616c16d3c7
commit a620a6cb9f

View File

@@ -85,7 +85,7 @@ ClientActions::~ClientActions()
TrayIcon::TrayIcon(QWidget *mainWindow)
: KStatusNotifierItem(mainWindow)
{
setIconByPixmap(QIcon::fromTheme(QStringLiteral("krfb")).pixmap(22, 22, QIcon::Disabled));
setIconByPixmap(QIcon::fromTheme(QStringLiteral("krfb-symbolic")).pixmap(22, 22, QIcon::Disabled));
setToolTipTitle(i18n("Desktop Sharing - disconnected"));
setCategory(KStatusNotifierItem::ApplicationStatus);
@@ -102,7 +102,7 @@ TrayIcon::TrayIcon(QWidget *mainWindow)
void TrayIcon::onClientConnected(RfbClient* client)
{
if (m_clientActions.isEmpty()) { //first client connected
setIconByName(QStringLiteral("krfb"));
setIconByName(QStringLiteral("krfb-symbolic"));
setToolTipTitle(i18n("Desktop Sharing - connected with %1", client->name()));
setStatus(KStatusNotifierItem::Active);
} else { //Nth client connected, N != 1
@@ -118,7 +118,7 @@ void TrayIcon::onClientDisconnected(RfbClient* client)
delete actions;
if (m_clientActions.isEmpty()) {
setIconByPixmap(QIcon::fromTheme(QStringLiteral("krfb")).pixmap(22, 22, QIcon::Disabled));
setIconByPixmap(QIcon::fromTheme(QStringLiteral("krfb-symbolic")).pixmap(22, 22, QIcon::Disabled));
setToolTipTitle(i18n("Desktop Sharing - disconnected"));
setStatus(KStatusNotifierItem::Passive);
} else if (m_clientActions.size() == 1) { //clients number dropped back to 1