mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Add a method to check if gtk integration is forced
This commit is contained in:
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user