2018-06-06 13:35:06 +02:00
|
|
|
#pragma once
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2018-06-26 14:09:39 +02:00
|
|
|
#include "widgets/BaseWidget.hpp"
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2018-06-06 13:35:06 +02:00
|
|
|
#include <QPainter>
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2018-06-06 13:35:06 +02:00
|
|
|
namespace chatterino {
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2018-06-06 13:35:06 +02:00
|
|
|
class Line : public BaseWidget
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Line(bool vertical)
|
|
|
|
: BaseWidget(nullptr)
|
|
|
|
, vertical_(vertical)
|
|
|
|
{
|
|
|
|
if (this->vertical_)
|
|
|
|
{
|
|
|
|
this->setScaleIndependantWidth(8);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
this->setScaleIndependantHeight(8);
|
|
|
|
}
|
|
|
|
}
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2018-06-06 13:35:06 +02:00
|
|
|
virtual void paintEvent(QPaintEvent *)
|
|
|
|
{
|
|
|
|
QPainter painter(this);
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2021-03-13 12:33:54 +01:00
|
|
|
painter.setPen(QColor(153, 153, 153, 153));
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2018-06-06 13:35:06 +02:00
|
|
|
if (this->vertical_)
|
|
|
|
{
|
|
|
|
painter.drawLine(this->width() / 2, 0, this->width() / 2,
|
|
|
|
this->height());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
painter.drawLine(0, this->height() / 2, this->width(),
|
|
|
|
this->height() / 2);
|
|
|
|
}
|
|
|
|
}
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2018-06-06 13:35:06 +02:00
|
|
|
private:
|
|
|
|
bool vertical_;
|
|
|
|
};
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2018-06-06 13:35:06 +02:00
|
|
|
} // namespace chatterino
|