mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-03 16:15:13 +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
|
#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() {
|
bool IsGtkFileDialogForced() {
|
||||||
#ifdef TDESKTOP_FORCE_GTK_FILE_DIALOG
|
#ifdef TDESKTOP_FORCE_GTK_FILE_DIALOG
|
||||||
return true;
|
return true;
|
||||||
|
@@ -24,6 +24,7 @@ bool InSandbox();
|
|||||||
bool InSnap();
|
bool InSnap();
|
||||||
bool InAppImage();
|
bool InAppImage();
|
||||||
bool IsStaticBinary();
|
bool IsStaticBinary();
|
||||||
|
bool IsGtkIntegrationForced();
|
||||||
bool IsGtkFileDialogForced();
|
bool IsGtkFileDialogForced();
|
||||||
bool IsQtPluginsBundled();
|
bool IsQtPluginsBundled();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user