feeble attempt at things

This commit is contained in:
Arisotura 2022-04-15 10:58:17 +02:00
parent 529a690089
commit 243d3475ae
2 changed files with 40 additions and 0 deletions

View File

@ -808,6 +808,17 @@ QSize ScreenHandler::screenGetMinSize(int factor = 1)
void ScreenHandler::screenOnMousePress(QMouseEvent* event)
{
event->accept();
if (event->button() == Qt::RightButton)
{
// FAZIL
if (numTouch < 10)
{printf("ADDING A FUCKING FAZIL %d\n", numTouch);
touchPos[numTouch] = event->pos();
numTouch++;
}
}
if (event->button() != Qt::LeftButton) return;
int x = event->pos().x();
@ -933,6 +944,7 @@ ScreenPanelNative::ScreenPanelNative(QWidget* parent) : QWidget(parent)
screenTrans[1].reset();
touching = false;
numTouch = 0;
setAttribute(Qt::WA_AcceptTouchEvents);
@ -993,6 +1005,17 @@ void ScreenPanelNative::paintEvent(QPaintEvent* event)
}
}
for (int i = 0; i < numTouch; i++)
{
QPoint pos = touchPos[i];
QColor col = numberColors[i];
painter.setPen(col);
painter.drawLine(pos.x()-2, pos.y(), pos.x()+2, pos.y());
painter.drawLine(pos.x(), pos.y()-2, pos.x(), pos.y()+2);
painter.drawLine(0, 0, 100, 100);
}
OSD::Update(nullptr);
OSD::DrawNative(painter);
}
@ -1044,6 +1067,7 @@ void ScreenPanelNative::onScreenLayoutChanged()
ScreenPanelGL::ScreenPanelGL(QWidget* parent) : QOpenGLWidget(parent)
{
touching = false;
numTouch = 0;
setAttribute(Qt::WA_AcceptTouchEvents);
}

View File

@ -122,6 +122,22 @@ protected:
int numScreens;
bool touching;
QPoint touchPos[10];
int numTouch;
const QColor numberColors[10] =
{
QColor(0xFF, 0xFF, 0xFF),
QColor(0x00, 0x00, 0x00),
QColor(0x00, 0x96, 0x27),
QColor(0x5D, 0x26, 0xFF),
QColor(0xFF, 0xF8, 0x00),
QColor(0xFF, 0x37, 0x00),
QColor(0x00, 0xDD, 0xFF),
QColor(0xFF, 0x90, 0x47),
QColor(0xFF, 0xCC, 0xCC),
QColor(0x4F, 0x1A, 0x00)
};
void showCursor();
};