mirror of
https://github.com/KDE/krfb
synced 2026-07-01 07:31:16 -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: {width=510 height=600} ## After: {width=485 height=600}
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user