mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 18:24:55 +00:00
Start renaming project to Metaforce
This commit is contained in:
17
metaforce-gui/ErrorLabel.hpp
Normal file
17
metaforce-gui/ErrorLabel.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
class ErrorLabel : public QLabel {
|
||||
public:
|
||||
ErrorLabel(QWidget* parent = Q_NULLPTR) : QLabel(parent) {}
|
||||
void setText(const QString& str, bool success = false) {
|
||||
QPalette pal = QLabel::palette();
|
||||
if (success)
|
||||
pal.setColor(QPalette::WindowText, QColor(0, 255, 0));
|
||||
else
|
||||
pal.setColor(QPalette::WindowText, QColor(255, 47, 0));
|
||||
QLabel::setPalette(pal);
|
||||
QLabel::setText(str);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user