change some names etc.

This commit is contained in:
laserpants 2016-06-24 08:06:14 +03:00
parent 03f2571f34
commit ba81f09252
4 changed files with 8 additions and 9 deletions

View File

@ -40,7 +40,7 @@ void Drawer::setDrawerWidth(int width)
Q_D(Drawer);
d->width = width;
d->stateMachine->assignProperties();
d->stateMachine->updatePropertyAssignments();
setFixedWidth(width+16);
}
@ -84,8 +84,9 @@ bool Drawer::eventFilter(QObject *obj, QEvent *event)
const QEvent::Type type = event->type();
if (QEvent::Move == type || QEvent::Resize == type) {
if (layout() && 16 != layout()->contentsMargins().right()) {
layout()->setContentsMargins(0, 0, 16, 0);
QLayout *t = layout();
if (t && 16 != t->contentsMargins().right()) {
t->setContentsMargins(0, 0, 16, 0);
}
}
return OverlayWidget::eventFilter(obj, event);

View File

@ -28,15 +28,13 @@ protected:
bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
QRect overlayGeometry() const;
QRect overlayGeometry() const Q_DECL_OVERRIDE;
const QScopedPointer<DrawerPrivate> d_ptr;
private:
Q_DISABLE_COPY(Drawer)
Q_DECLARE_PRIVATE(Drawer)
// friend class DrawerStateMachine;
};
#endif // DRAWER_H

View File

@ -37,7 +37,7 @@ DrawerStateMachine::DrawerStateMachine(Drawer *drawer)
animation->setEasingCurve(QEasingCurve::InCirc);
transition->addAnimation(animation);
assignProperties();
updatePropertyAssignments();
}
DrawerStateMachine::~DrawerStateMachine()
@ -54,7 +54,7 @@ void DrawerStateMachine::setOffset(int offset)
}
}
void DrawerStateMachine::assignProperties()
void DrawerStateMachine::updatePropertyAssignments()
{
m_closedState->assignProperty(this, "offset", -(m_drawer->width()+32));
m_openState->assignProperty(this, "offset", 0);

View File

@ -18,7 +18,7 @@ public:
void setOffset(int offset);
inline int offset() const { return m_offset; }
void assignProperties();
void updatePropertyAssignments();
signals:
void enterOpenedState();