mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 05:07:43 +00:00
Various GUI logic fixes and improvements
This commit is contained in:
22
hecl-gui/ErrorLabel.hpp
Normal file
22
hecl-gui/ErrorLabel.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef GUI_ERRORLABEL_HPP
|
||||
#define GUI_ERRORLABEL_HPP
|
||||
|
||||
#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);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // GUI_ERRORLABEL_HPP
|
||||
Reference in New Issue
Block a user