diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 778fcb98c..8f144b508 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -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() 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) } } -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); diff --git a/src/widget/widget.h b/src/widget/widget.h index d1451e796..b212ad215 100644 --- a/src/widget/widget.h +++ b/src/widget/widget.h @@ -102,7 +102,6 @@ public: void reloadTheme(); static QString getStatusIconPath(Status status); - static inline QIcon prepareIcon(QString path, int w = 0, int h = 0); static QPixmap getStatusIconPixmap(QString path, uint32_t w, uint32_t h); static QString getStatusTitle(Status status); static Status getStatusFromString(QString status);