mirror of
https://github.com/quickshell-mirror/quickshell.git
synced 2026-10-27 02:54:36 +00:00
core: add hasThemeIcon mapping
This commit is contained in:
1 parent
1e4d804e7f
commit
395a1301a8
3 files changed
+5
No files matched your search
@@ -24,6 +24,7 @@ set shell id.
|
||||
- Added support for grabbing focus from popup windows.
|
||||
- Added support for IPC signal listeners.
|
||||
- Added Quickshell version checking and version gated preprocessing.
|
||||
- Added a way to detect if an icon is from the system icon theme or not.
|
||||
|
||||
## Other Changes
|
||||
|
||||
|
||||
@@ -314,6 +314,8 @@ QString QuickshellGlobal::iconPath(const QString& icon, const QString& fallback)
|
||||
return IconImageProvider::requestString(icon, "", fallback);
|
||||
}
|
||||
|
||||
bool QuickshellGlobal::hasThemeIcon(const QString& icon) { return QIcon::hasThemeIcon(icon); }
|
||||
|
||||
bool QuickshellGlobal::hasVersion(qint32 major, qint32 minor, const QStringList& features) {
|
||||
return qs::scan::env::PreprocEnv::hasVersion(major, minor, features);
|
||||
}
|
||||
|
||||
@@ -202,6 +202,8 @@ public:
|
||||
/// Setting the `fallback` parameter of `iconPath` will attempt to load the fallback
|
||||
/// icon if the requested one could not be loaded.
|
||||
Q_INVOKABLE static QString iconPath(const QString& icon, const QString& fallback);
|
||||
/// Check if specified icon has an available icon in your icon theme
|
||||
Q_INVOKABLE static bool hasThemeIcon(const QString& icon);
|
||||
/// Equivalent to `${Quickshell.configDir}/${path}`
|
||||
Q_INVOKABLE [[nodiscard]] QString shellPath(const QString& path) const;
|
||||
/// > [!WARNING] Deprecated: Renamed to @@shellPath() for clarity.
|
||||
|
||||
Reference in new issue
Block a user