|
|
|
@ -119,26 +119,26 @@ void Widget::init()
@@ -119,26 +119,26 @@ void Widget::init()
|
|
|
|
|
connect(actionShow, &QAction::triggered, this, &Widget::forceShow); |
|
|
|
|
|
|
|
|
|
statusOnline = new QAction(this); |
|
|
|
|
statusOnline->setIcon(prepareIcon(getStatusIconPath(Status::Online), icon_size, icon_size)); |
|
|
|
|
statusOnline->setIcon(QIcon(getStatusIconPath(Status::Online))); |
|
|
|
|
connect(statusOnline, &QAction::triggered, this, &Widget::setStatusOnline); |
|
|
|
|
|
|
|
|
|
statusAway = new QAction(this); |
|
|
|
|
statusAway->setIcon(prepareIcon(getStatusIconPath(Status::Away), icon_size, icon_size)); |
|
|
|
|
statusAway->setIcon(QIcon(getStatusIconPath(Status::Away))); |
|
|
|
|
connect(statusAway, &QAction::triggered, this, &Widget::setStatusAway); |
|
|
|
|
|
|
|
|
|
statusBusy = new QAction(this); |
|
|
|
|
statusBusy->setIcon(prepareIcon(getStatusIconPath(Status::Busy), icon_size, icon_size)); |
|
|
|
|
statusBusy->setIcon(QIcon(getStatusIconPath(Status::Busy))); |
|
|
|
|
connect(statusBusy, &QAction::triggered, this, &Widget::setStatusBusy); |
|
|
|
|
|
|
|
|
|
actionLogout = new QAction(this); |
|
|
|
|
actionLogout->setIcon(prepareIcon(":/img/others/logout-icon.svg", icon_size, icon_size)); |
|
|
|
|
actionLogout->setIcon(QIcon(":/img/others/logout-icon.svg")); |
|
|
|
|
|
|
|
|
|
actionQuit = new QAction(this); |
|
|
|
|
#ifndef Q_OS_OSX |
|
|
|
|
actionQuit->setMenuRole(QAction::QuitRole); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
actionQuit->setIcon(prepareIcon(":/ui/rejectCall/rejectCall.svg", icon_size, icon_size)); |
|
|
|
|
actionQuit->setIcon(QIcon(":/ui/rejectCall/rejectCall.svg")); |
|
|
|
|
connect(actionQuit, &QAction::triggered, qApp, &QApplication::quit); |
|
|
|
|
|
|
|
|
|
layout()->setContentsMargins(0, 0, 0, 0); |
|
|
|
@ -669,7 +669,7 @@ void Widget::onBadProxyCore()
@@ -669,7 +669,7 @@ void Widget::onBadProxyCore()
|
|
|
|
|
void Widget::onStatusSet(Status status) |
|
|
|
|
{ |
|
|
|
|
ui->statusButton->setProperty("status", getStatusTitle(status)); |
|
|
|
|
ui->statusButton->setIcon(prepareIcon(getStatusIconPath(status), icon_size, icon_size)); |
|
|
|
|
ui->statusButton->setIcon(QIcon(getStatusIconPath(status))); |
|
|
|
|
updateIcons(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2287,35 +2287,6 @@ QString Widget::getStatusIconPath(Status status)
@@ -2287,35 +2287,6 @@ QString Widget::getStatusIconPath(Status status)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inline QIcon Widget::prepareIcon(QString path, int w, int h) |
|
|
|
|
{ |
|
|
|
|
#ifdef Q_OS_LINUX |
|
|
|
|
|
|
|
|
|
QString desktop = getenv("XDG_CURRENT_DESKTOP"); |
|
|
|
|
if (desktop.isEmpty()) |
|
|
|
|
{ |
|
|
|
|
desktop = getenv("DESKTOP_SESSION"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
desktop = desktop.toLower(); |
|
|
|
|
if (desktop == "xfce" || desktop.contains("gnome") || desktop == "mate" || desktop == "x-cinnamon") |
|
|
|
|
{ |
|
|
|
|
if (w > 0 && h > 0) |
|
|
|
|
{ |
|
|
|
|
QSvgRenderer renderer(path); |
|
|
|
|
|
|
|
|
|
QPixmap pm(w, h); |
|
|
|
|
pm.fill(Qt::transparent); |
|
|
|
|
QPainter painter(&pm); |
|
|
|
|
renderer.render(&painter, pm.rect()); |
|
|
|
|
|
|
|
|
|
return QIcon(pm); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
return QIcon(path); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QPixmap Widget::getStatusIconPixmap(QString path, uint32_t w, uint32_t h) |
|
|
|
|
{ |
|
|
|
|
QPixmap pix(w, h); |
|
|
|
|