Removed disabled button states, don't open panel without buttons
[situare] / src / ui / listitemcontextbuttonbar.cpp
index 3d5791e..d7b6551 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include <QDebug>
+#include <QLayout>
 #include <QPainter>
 #include <QPropertyAnimation>
 #include <QStateMachine>
@@ -178,7 +179,9 @@ void ListItemContextButtonBar::showContextButtonBar()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    m_state = StateOpening;
-    m_animation->setDirection(QAbstractAnimation::Forward);
-    m_animation->start();
+    if (m_contextButtons->layout()->count() > 0) {
+        m_state = StateOpening;
+        m_animation->setDirection(QAbstractAnimation::Forward);
+        m_animation->start();
+    }
 }