aerothemeplasma-kde6/KWin/decoration/breeze-v5.93.0/kstyle/animations/breezewidgetstatedata.cpp

33 lines
704 B
C++
Raw Normal View History

2024-06-13 14:59:18 +00:00
/*
* SPDX-FileCopyrightText: 2014 Hugo Pereira Da Costa <hugo.pereira@free.fr>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "breezewidgetstatedata.h"
namespace Breeze
{
//______________________________________________
bool WidgetStateData::updateState(bool value)
{
if (!_initialized) {
_state = value;
_initialized = true;
return false;
} else if (_state == value) {
return false;
} else {
_state = value;
animation().data()->setDirection(_state ? Animation::Forward : Animation::Backward);
if (!animation().data()->isRunning()) {
animation().data()->start();
}
return true;
}
}
}