2019-07-23 22:18:36 +02:00
|
|
|
#include "widgets/helper/SignalLabel.hpp"
|
|
|
|
|
2019-10-07 15:46:08 +02:00
|
|
|
namespace chatterino {
|
2019-07-23 22:18:36 +02:00
|
|
|
|
|
|
|
SignalLabel::SignalLabel(QWidget *parent, Qt::WindowFlags f)
|
|
|
|
: QLabel(parent, f)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void SignalLabel::mouseDoubleClickEvent(QMouseEvent *ev)
|
|
|
|
{
|
|
|
|
emit this->mouseDoubleClick(ev);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SignalLabel::mousePressEvent(QMouseEvent *event)
|
|
|
|
{
|
|
|
|
if (event->button() == Qt::LeftButton)
|
|
|
|
{
|
2020-10-22 23:17:31 +02:00
|
|
|
emit leftMouseDown();
|
2019-07-23 22:18:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
event->ignore();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SignalLabel::mouseReleaseEvent(QMouseEvent *event)
|
|
|
|
{
|
|
|
|
if (event->button() == Qt::LeftButton)
|
|
|
|
{
|
2020-10-22 23:17:31 +02:00
|
|
|
emit leftMouseUp();
|
2019-07-23 22:18:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
event->ignore();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SignalLabel::mouseMoveEvent(QMouseEvent *event)
|
|
|
|
{
|
|
|
|
emit this->mouseMove(event);
|
|
|
|
event->ignore();
|
|
|
|
}
|
|
|
|
|
2019-10-07 15:46:08 +02:00
|
|
|
} // namespace chatterino
|