Skip to content

Commit

Permalink
FancyMenu: use XdgIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgit committed Jan 7, 2024
1 parent 192b005 commit 82a9a39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions plugin-fancymenu/lxqtfancymenuappmap.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "lxqtfancymenuappmap.h"

#include <XdgMenu>
#include <XdgIcon>

LXQtFancyMenuAppMap::LXQtFancyMenuAppMap()
{
Expand All @@ -10,7 +11,7 @@ LXQtFancyMenuAppMap::LXQtFancyMenuAppMap()
//Add Favorites category
Category favorites;
favorites.menuTitle = QLatin1String("Favorites"); //TODO: translate
favorites.icon = QIcon::fromTheme(QLatin1String("bookmarks"));
favorites.icon = XdgIcon::fromTheme(QLatin1String("bookmarks"));
mCategories.append(favorites);
}

Expand Down Expand Up @@ -49,7 +50,7 @@ bool LXQtFancyMenuAppMap::rebuildModel(const XdgMenu &menu)
//Add All Apps category
Category allAppsCategory;
allAppsCategory.menuTitle = QLatin1String("All Applications");
allAppsCategory.icon = QIcon::fromTheme(QLatin1String("folder"));
allAppsCategory.icon = XdgIcon::fromTheme(QLatin1String("folder"));
mCategories.append(allAppsCategory);

//TODO: add separator
Expand Down Expand Up @@ -200,7 +201,7 @@ void LXQtFancyMenuAppMap::parseMenu(const QDomElement &menu, const QString& topL
item.menuName = e.attribute(QLatin1String("name"));
item.menuTitle = e.attribute(QLatin1Literal("title"), item.menuName);
QString iconName = e.attribute(QLatin1String("icon"));
item.icon = QIcon::fromTheme(iconName);
item.icon = XdgIcon::fromTheme(iconName);
mCategories.append(item);

//Merge sub menu to parent
Expand Down
4 changes: 2 additions & 2 deletions plugin-fancymenu/lxqtfancymenuwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ LXQtFancyMenuWindow::LXQtFancyMenuWindow(QWidget *parent)
//connect(mSearchEdit, &QLineEdit::returnPressed, mSearchView, &ActionView::activateCurrent);

mSettingsButton = new QToolButton;
mSettingsButton->setIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop"))); //TODO: preferences-system?
mSettingsButton->setIcon(XdgIcon::fromTheme(QStringLiteral("preferences-desktop"))); //TODO: preferences-system?
mSettingsButton->setText(tr("Settings"));
mSettingsButton->setToolTip(mSettingsButton->text());
connect(mSettingsButton, &QToolButton::clicked, this, &LXQtFancyMenuWindow::runSystemConfigDialog);

mPowerButton = new QToolButton;
mPowerButton->setIcon(QIcon::fromTheme(QStringLiteral("system-shutdown")));
mPowerButton->setIcon(XdgIcon::fromTheme(QStringLiteral("system-shutdown")));
mPowerButton->setText(tr("Shutdown"));
mPowerButton->setToolTip(mPowerButton->text());
connect(mPowerButton, &QToolButton::clicked, this, &LXQtFancyMenuWindow::runPowerDialog);
Expand Down

0 comments on commit 82a9a39

Please sign in to comment.