forked from quickshell/quickshell
core/global: add Quickshell.iconPath
Replaces "image://icon/" in user facing code.
This commit is contained in:
parent
24f54f579f
commit
bb33c9a0c4
2 changed files with 10 additions and 0 deletions
|
@ -19,6 +19,7 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#include "generation.hpp"
|
||||
#include "iconimageprovider.hpp"
|
||||
#include "qmlscreen.hpp"
|
||||
#include "rootwrapper.hpp"
|
||||
|
||||
|
@ -188,6 +189,10 @@ QVariant QuickshellGlobal::env(const QString& variable) { // NOLINT
|
|||
return qEnvironmentVariable(vstr.data());
|
||||
}
|
||||
|
||||
QString QuickshellGlobal::iconPath(const QString& icon) {
|
||||
return IconImageProvider::requestString(icon, "");
|
||||
}
|
||||
|
||||
QuickshellGlobal* QuickshellGlobal::create(QQmlEngine* engine, QJSEngine* /*unused*/) {
|
||||
auto* qsg = new QuickshellGlobal();
|
||||
auto* generation = EngineGeneration::findEngineGeneration(engine);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue