Reviewed context button bar classes and fixed a small bug that messed up the context...
[situare] / src / ui / panelcontextbuttonbar.cpp
index e6f544a..48a15b4 100644 (file)
@@ -64,10 +64,10 @@ PanelContextButtonBar::PanelContextButtonBar(QWidget *parent)
     connect(animation, SIGNAL(finished()),
             this, SLOT(contextButtonBarStateChanged()));
 
-    QPoint hiddenPosition(this->pos().x(), this->pos().y());
+    QPoint hiddenPosition(pos().x(), pos().y());
     m_stateHidden->assignProperty(this, "pos", hiddenPosition);
 
-    QPoint visiblePosition(this->pos().x(), this->pos().y() - height());
+    QPoint visiblePosition(pos().x(), pos().y() - height());
     m_stateVisible->assignProperty(this, "pos", visiblePosition);
 
     stateMachine->start();
@@ -137,16 +137,6 @@ void PanelContextButtonBar::move(int x, int y)
     m_stateVisible->assignProperty(this, "pos", visiblePosition);
 }
 
-void PanelContextButtonBar::resizeEvent(QResizeEvent *event)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    QWidget::resizeEvent(event);
-
-    QPoint visiblePosition(pos().x(), pos().y() - height());
-    m_stateVisible->assignProperty(this, "pos", visiblePosition);
-}
-
 void PanelContextButtonBar::setContextButtons(QWidget *contextButtons)
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -161,6 +151,8 @@ void PanelContextButtonBar::setContextButtons(QWidget *contextButtons)
     m_contextButtons->setVisible(true);
 
     setFixedHeight(m_contextButtons->height());
+
+    emit positionChangeRequested();
 }
 
 void PanelContextButtonBar::showContextButtonBar()