refactor:blockAnimations moved to View::Effects

--rename blockAnimations to animationsBlocked
pull/3/head
Michail Vourlakos 6 years ago
parent 44006f2fe6
commit 0794c0e84f

@ -675,21 +675,6 @@ void DockView::setAlignment(int alignment)
emit alignmentChanged();
}
bool DockView::blockAnimations() const
{
return m_blockAnimations;
}
void DockView::setBlockAnimations(bool block)
{
if (m_blockAnimations == block) {
return;
}
m_blockAnimations = block;
emit blockAnimationsChanged();
}
bool DockView::themeHasShadow() const
{
return PanelShadows::self()->enabled();

@ -66,7 +66,6 @@ class DockView : public PlasmaQuick::ContainmentView
Q_OBJECT
Q_PROPERTY(bool alternativesIsShown READ alternativesIsShown NOTIFY alternativesIsShownChanged)
Q_PROPERTY(bool behaveAsPlasmaPanel READ behaveAsPlasmaPanel WRITE setBehaveAsPlasmaPanel NOTIFY behaveAsPlasmaPanelChanged)
Q_PROPERTY(bool blockAnimations READ blockAnimations WRITE setBlockAnimations NOTIFY blockAnimationsChanged)
Q_PROPERTY(bool contextMenuIsShown READ contextMenuIsShown NOTIFY contextMenuIsShownChanged)
Q_PROPERTY(bool dockWinBehavior READ dockWinBehavior WRITE setDockWinBehavior NOTIFY dockWinBehaviorChanged)
//! Because Latte uses animations, changing to edit mode it may be different than
@ -125,9 +124,6 @@ public:
bool behaveAsPlasmaPanel() const;
void setBehaveAsPlasmaPanel(bool behavior);
bool blockAnimations() const;
void setBlockAnimations(bool block);
bool contextMenuIsShown() const;
bool dockWinBehavior() const;
@ -231,7 +227,6 @@ signals:
void alternativesIsShownChanged();
void alignmentChanged();
void behaveAsPlasmaPanelChanged();
void blockAnimationsChanged();
void contextMenuIsShownChanged();
void currentScreenChanged();
void dockLocationChanged();
@ -281,7 +276,6 @@ private:
bool m_alternativesIsShown{false};
bool m_behaveAsPlasmaPanel{false};
bool m_blockAnimations{false};
bool m_dockWinBehavior{true};
bool m_inDelete{false};
bool m_inEditMode{false};

@ -59,6 +59,21 @@ void Effects::init()
connect(this, SIGNAL(innerShadowChanged()), m_view->corona(), SIGNAL(availableScreenRectChanged()));
}
bool Effects::animationsBlocked() const
{
return m_animationsBlocked;
}
void Effects::setAnimationsBlocked(bool blocked)
{
if (m_animationsBlocked == blocked) {
return;
}
m_animationsBlocked = blocked;
emit animationsBlockedChanged();
}
bool Effects::colorizerEnabled() const
{
return m_colorizerEnabled;

@ -37,12 +37,13 @@ namespace View {
class Effects: public QObject
{
Q_OBJECT
Q_PROPERTY(bool backgroundOpacity READ backgroundOpacity WRITE setBackgroundOpacity NOTIFY backgroundOpacityChanged)
Q_PROPERTY(bool animationsBlocked READ animationsBlocked NOTIFY animationsBlockedChanged)
Q_PROPERTY(bool colorizerEnabled READ colorizerEnabled WRITE setColorizerEnabled NOTIFY colorizerEnabledChanged)
Q_PROPERTY(bool drawShadows READ drawShadows WRITE setDrawShadows NOTIFY drawShadowsChanged)
Q_PROPERTY(bool drawEffects READ drawEffects WRITE setDrawEffects NOTIFY drawEffectsChanged)
//! thickness shadow size when is drawn inside the window from qml
Q_PROPERTY(int backgroundOpacity READ backgroundOpacity WRITE setBackgroundOpacity NOTIFY backgroundOpacityChanged)
Q_PROPERTY(int innerShadow READ innerShadow WRITE setInnerShadow NOTIFY innerShadowChanged)
Q_PROPERTY(QRect mask READ mask WRITE setMask NOTIFY maskChanged)
@ -54,6 +55,9 @@ public:
Effects(DockView *parent);
virtual ~Effects();
bool animationsBlocked() const;
void setAnimationsBlocked(bool blocked);
bool colorizerEnabled() const;
void setColorizerEnabled(bool enabled);
@ -85,6 +89,7 @@ public slots:
void updateEnabledBorders();
signals:
void animationsBlockedChanged();
void backgroundOpacityChanged();
void colorizerEnabledChanged();
void drawShadowsChanged();
@ -98,6 +103,7 @@ private slots:
void init();
private:
bool m_animationsBlocked{false};
bool m_colorizerEnabled{false};
bool m_drawShadows{true};
bool m_drawEffects{false};

@ -572,7 +572,7 @@ void Positioner::initSignalingForLocationChangeSliding()
if (m_goToLocation != Plasma::Types::Floating) {
m_goToLocation = Plasma::Types::Floating;
QTimer::singleShot(100, [this]() {
m_view->setBlockAnimations(false);
m_view->effects()->setAnimationsBlocked(false);
emit showDockAfterLocationChangeFinished();
m_view->showSettingsWindow();
@ -590,7 +590,7 @@ void Positioner::initSignalingForLocationChangeSliding()
if (m_goToScreen) {
m_goToScreen = nullptr;
QTimer::singleShot(100, [this]() {
m_view->setBlockAnimations(false);
m_view->effects()->setAnimationsBlocked(false);
emit showDockAfterScreenChangeFinished();
m_view->showSettingsWindow();
@ -608,7 +608,7 @@ void Positioner::initSignalingForLocationChangeSliding()
if (!m_moveToLayout.isEmpty() && m_view->managedLayout()) {
m_moveToLayout = "";
QTimer::singleShot(100, [this]() {
m_view->setBlockAnimations(false);
m_view->effects()->setAnimationsBlocked(false);
emit showDockAfterMovingToLayoutFinished();
m_view->showSettingsWindow();
});
@ -619,7 +619,7 @@ void Positioner::initSignalingForLocationChangeSliding()
//! this is used for both location and screen change cases, this signal
//! is send when the sliding-out animation has finished
connect(this, &Positioner::hideDockDuringLocationChangeFinished, this, [&]() {
m_view->setBlockAnimations(true);
m_view->effects()->setAnimationsBlocked(true);
if (m_goToLocation != Plasma::Types::Floating) {
m_view->setLocation(m_goToLocation);

@ -397,7 +397,7 @@ DragDrop.DropArea {
property int tasksCount: latteApplet ? latteApplet.tasksCount : 0
property real durationTime: {
if ((dock && dock.blockAnimations) || !Latte.WindowSystem.compositingActive) {
if ((dock && dock.effects && dock.effects.animationsBlocked) || !Latte.WindowSystem.compositingActive) {
return 0;
}

Loading…
Cancel
Save