2013-09-28 11:06:56 +02:00
|
|
|
|
|
|
|
#include "scenetool.hpp"
|
|
|
|
|
2014-09-07 13:35:30 +02:00
|
|
|
#include <QMouseEvent>
|
|
|
|
|
2013-10-07 11:14:11 +02:00
|
|
|
#include "scenetoolbar.hpp"
|
|
|
|
|
2014-09-06 16:11:06 +02:00
|
|
|
CSVWidget::SceneTool::SceneTool (SceneToolbar *parent, Type type)
|
|
|
|
: PushButton (type, "", parent)
|
2013-09-28 11:06:56 +02:00
|
|
|
{
|
|
|
|
setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed));
|
2014-04-03 13:00:19 +02:00
|
|
|
setIconSize (QSize (parent->getIconSize(), parent->getIconSize()));
|
2013-10-07 11:14:11 +02:00
|
|
|
setFixedSize (parent->getButtonSize(), parent->getButtonSize());
|
2013-09-28 13:10:42 +02:00
|
|
|
|
|
|
|
connect (this, SIGNAL (clicked()), this, SLOT (openRequest()));
|
|
|
|
}
|
|
|
|
|
2014-09-07 13:35:30 +02:00
|
|
|
void CSVWidget::SceneTool::activate() {}
|
|
|
|
|
|
|
|
void CSVWidget::SceneTool::mouseReleaseEvent (QMouseEvent *event)
|
|
|
|
{
|
|
|
|
if (getType()==Type_TopAction && event->button()==Qt::RightButton)
|
|
|
|
showPanel (parentWidget()->mapToGlobal (pos()));
|
|
|
|
else
|
|
|
|
PushButton::mouseReleaseEvent (event);
|
|
|
|
}
|
|
|
|
|
2014-07-08 12:39:12 +02:00
|
|
|
void CSVWidget::SceneTool::openRequest()
|
2013-09-28 13:10:42 +02:00
|
|
|
{
|
2014-09-07 13:35:30 +02:00
|
|
|
if (getType()==Type_TopAction)
|
|
|
|
activate();
|
|
|
|
else
|
|
|
|
showPanel (parentWidget()->mapToGlobal (pos()));
|
2013-09-28 13:10:42 +02:00
|
|
|
}
|