mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-09 00:28:42 +12:00
Qt: Initial CPU debugger widget implementation
Co-Authored-By: liuk707 <62625900+liuk7071@users.noreply.github.com>
This commit is contained in:
parent
8e20bd6220
commit
9dc52577ea
8 changed files with 311 additions and 6 deletions
28
include/panda_qt/disabled_widget_overlay.hpp
Normal file
28
include/panda_qt/disabled_widget_overlay.hpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
class DisabledWidgetOverlay : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DisabledWidgetOverlay(QWidget *parent = nullptr, QString overlayText = tr("This widget is disabled")) : text(overlayText), QWidget(parent) {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
private:
|
||||
QString text;
|
||||
|
||||
void paintEvent(QPaintEvent *) override {
|
||||
QPainter painter = QPainter(this);
|
||||
painter.fillRect(rect(), QColor(60, 60, 60, 128));
|
||||
painter.setPen(Qt::gray);
|
||||
|
||||
QFont font = painter.font();
|
||||
font.setBold(true);
|
||||
font.setPointSize(18);
|
||||
|
||||
painter.setFont(font);
|
||||
painter.drawText(rect(), Qt::AlignCenter, text);
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue