#include <QDebug>
+#include "panelcommon.h"
+
#include "listitemcontextbuttonbar.h"
ListItemContextButtonBar::ListItemContextButtonBar(QWidget *parent) :
m_contextButtons = contextButtons;
m_contextButtons->setParent(this);
-// m_contextButtons->setVisible(true);
-// setFixedHeight(m_contextButtons->height());
+ // widget must be temporarily visible so we can get the size, doesn't work with invisible widget
+ m_contextButtons->setVisible(true);
+ setFixedSize(m_contextButtons->size());
+ m_contextButtons->setVisible(false);
-// emit positionChangeRequested();
+ // center this widget horizontally to middle of the panel contents area
+ const int FROM_PANEL_CONTENTS_LEFT = PANEL_WIDTH / 2 - m_contextButtons->width() / 2;
+ const int Y = 0;
+ move(PANEL_TAB_BAR_WIDTH + PANEL_BAR_WIDTH + FROM_PANEL_CONTENTS_LEFT, Y);
}