mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
This merge request expands upon the folio and halcyon background blur effects, making the folio background blur include the backgrounds of folder icons, the favorites bar, and wallpaper selector, and for halcyon, it now includes the folder icons, app library, search, and wallpaper selector. To accomplish this, a mask layer plugin was created to easily attach to these elements. This way, we can use a `OpacityMask` to cut out from the existing blur layer, thus hopefully keeping the performance cost low. And with my limited testing, it does at least seems to run about the same on my oneplus 6t, though it is not really a low end device, so I can not fairly judge the impact for something slower (eg. PinePhone). To be on the safe side, a third option was also added to the folio settings, allowing for the ability to toggle back to the old functionality if needed.    
59 lines
1.6 KiB
C++
59 lines
1.6 KiB
C++
// SPDX-FileCopyrightText: 2025 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "halcyonsettings.h"
|
|
|
|
const QString CFG_KEY_SHOW_WALLPAPER_BLUR = QStringLiteral("wallpaperBlurEffect");
|
|
const QString CFG_KEY_DOUBLE_TAP_TO_LOCK = QStringLiteral("doubleTapToLock");
|
|
|
|
HalcyonSettings::HalcyonSettings(QObject *parent, KConfigGroup config)
|
|
: QObject{parent}
|
|
, m_config{config}
|
|
{
|
|
load();
|
|
}
|
|
|
|
HalcyonSettings::WallpaperBlurEffect HalcyonSettings::wallpaperBlurEffect() const
|
|
{
|
|
return m_wallpaperBlurEffect;
|
|
}
|
|
|
|
void HalcyonSettings::setWallpaperBlurEffect(WallpaperBlurEffect wallpaperBlurEffect)
|
|
{
|
|
if (m_wallpaperBlurEffect != wallpaperBlurEffect) {
|
|
m_wallpaperBlurEffect = wallpaperBlurEffect;
|
|
Q_EMIT wallpaperBlurEffectChanged();
|
|
save();
|
|
}
|
|
}
|
|
|
|
bool HalcyonSettings::doubleTapToLock() const
|
|
{
|
|
return m_doubleTapToLock;
|
|
}
|
|
|
|
void HalcyonSettings::setDoubleTapToLock(bool doubleTapToLock)
|
|
{
|
|
if (m_doubleTapToLock != doubleTapToLock) {
|
|
m_doubleTapToLock = doubleTapToLock;
|
|
Q_EMIT doubleTapToLockChanged();
|
|
save();
|
|
}
|
|
}
|
|
|
|
void HalcyonSettings::save()
|
|
{
|
|
m_config.writeEntry(CFG_KEY_SHOW_WALLPAPER_BLUR, (int)m_wallpaperBlurEffect);
|
|
m_config.writeEntry(CFG_KEY_DOUBLE_TAP_TO_LOCK, m_doubleTapToLock);
|
|
|
|
m_config.sync();
|
|
}
|
|
|
|
void HalcyonSettings::load()
|
|
{
|
|
m_wallpaperBlurEffect = static_cast<WallpaperBlurEffect>(m_config.readEntry(CFG_KEY_SHOW_WALLPAPER_BLUR, (int)Full));
|
|
m_doubleTapToLock = m_config.readEntry(CFG_KEY_DOUBLE_TAP_TO_LOCK, true);
|
|
|
|
Q_EMIT doubleTapToLockChanged();
|
|
Q_EMIT wallpaperBlurEffectChanged();
|
|
}
|