mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 23:24:01 +02:00
Add a method to check if gtk integration is forced
This commit is contained in:
parent
368eeaf754
commit
47d7bd95ae
2 changed files with 15 additions and 0 deletions
|
@ -263,6 +263,20 @@ bool IsStaticBinary() {
|
|||
#endif // !DESKTOP_APP_USE_PACKAGED
|
||||
}
|
||||
|
||||
bool IsGtkIntegrationForced() {
|
||||
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
|
||||
static const auto GtkIntegration = [&] {
|
||||
const auto platformThemes = QString::fromUtf8(qgetenv("QT_QPA_PLATFORMTHEME")).split(':');
|
||||
return platformThemes.contains(qstr("gtk3"), Qt::CaseInsensitive)
|
||||
|| platformThemes.contains(qstr("gtk2"), Qt::CaseInsensitive);
|
||||
}();
|
||||
|
||||
return GtkIntegration;
|
||||
#endif // !TDESKTOP_DISABLE_GTK_INTEGRATION
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsGtkFileDialogForced() {
|
||||
#ifdef TDESKTOP_FORCE_GTK_FILE_DIALOG
|
||||
return true;
|
||||
|
|
|
@ -24,6 +24,7 @@ bool InSandbox();
|
|||
bool InSnap();
|
||||
bool InAppImage();
|
||||
bool IsStaticBinary();
|
||||
bool IsGtkIntegrationForced();
|
||||
bool IsGtkFileDialogForced();
|
||||
bool IsQtPluginsBundled();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue