Skip to content

Commit

Permalink
chore: config dtk animations
Browse files Browse the repository at this point in the history
set/unset `D_DTK_DISABLE_ANIMATIONS` according to the dconfig
  • Loading branch information
kegechen committed Oct 25, 2024
1 parent 316a3e7 commit 8d6ee16
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/kernel/dguiapplicationhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ Q_GLOBAL_STATIC(DFontManager, _globalFM)
#define WINDOW_THEME_KEY "_d_platform_theme"

#define APP_THEME_TYPE "themeType"
#define DTK_ENABLE_ANIMATIONS "enableDtkAnimations"
Q_GLOBAL_STATIC_WITH_ARGS(DTK_CORE_NAMESPACE::DConfig, _d_dconfig, ("org.deepin.dtk.preference"));

/*!
Expand Down Expand Up @@ -529,7 +530,14 @@ DGuiApplicationHelper::DGuiApplicationHelper()
: QObject(nullptr)
, DObject(*new DGuiApplicationHelperPrivate(this))
{
if (_d_dconfig.exists())
return;

if (_d_dconfig->value(DTK_ENABLE_ANIMATIONS, false).toBool()) {
qunsetenv("D_DTK_DISABLE_ANIMATIONS");
} else {
qputenv("D_DTK_DISABLE_ANIMATIONS", "1");
}
}

void DGuiApplicationHelper::initialize()
Expand Down

0 comments on commit 8d6ee16

Please sign in to comment.