78 QColor textColor = pPref->getColorTheme()->m_windowTextColor;
79 QColor backgroundColor = pPref->getColorTheme()->m_windowColor;
81 QString sStyleSheet = QString(
"\
84 background-color: %2; \
86 .arg( textColor.name() )
87 .arg( backgroundColor.name() );
89 setStyleSheet( sStyleSheet );
99 QPainter painter(
this);
101 QColor colorHighlightActive = pPref->getColorTheme()->m_highlightColor;
106 if ( ! hasFocus() ) {
107 colorHighlightActive.setAlpha( 150 );
111 pen.setColor( colorHighlightActive );
113 painter.setPen( pen );
114 painter.drawRoundedRect( QRect( 0, 0,
m_size.width() - 1,
m_size.height() - 1 ), 3, 3 );
118#ifdef H2CORE_HAVE_QT6
123 LCDDisplay::enterEvent( ev );
129 LCDDisplay::leaveEvent( ev );
135 QMenu* messageMenu =
new QMenu(
this );
138 messageMenu->addAction( sMessage );
143 messageMenu->popup( pEv->globalPosition().toPoint() );
178 if ( sMessage.length() >= maxLength() ) {
216 QString sLongString(
"ThisIsALongOneThatShouldNotFitInTheLCDDisplayEvenWithVeryNarrowFonts" );
219 while ( fontMetrics().size( Qt::TextSingleLine, sLongString ).width() >
220 width() && ! sLongString.isEmpty() ) {
221 sLongString.chop( 1 );
224 setMaxLength( sLongString.length() );
static Preferences * get_instance()
Returns a pointer to the current Preferences singleton stored in __instance.
Changes
Bitwise or-able options showing which part of the Preferences were altered using the PreferencesDialo...
@ Font
Either the font size or font family have changed.
static HydrogenApp * get_instance()
Returns the instance of HydrogenApp class.
void preferencesChanged(H2Core::Preferences::Changes changes)
Propagates a change in the Preferences through the GUI.
void onPreferencesChanged(H2Core::Preferences::Changes changes)
virtual void paintEvent(QPaintEvent *ev) override
LCDDisplay(QWidget *pParent, QSize size=QSize(0, 0), bool bFixedFont=false, bool bIsActive=true)
Compatibility class to support QMouseEvent more esily in Qt5 and Qt6.
virtual void mousePressEvent(QMouseEvent *ev) override
void onScrollTimerEvent()
void onPreferencesChanged(H2Core::Preferences::Changes changes)
virtual void leaveEvent(QEvent *ev) override
void onStatusTimerEvent()
int m_nScrollTimeout
Amount of time in milliseconds that pass between chopping characters for messages to long to display ...
QStringList m_statusMessages
int m_nPreScrollTimeout
Amount of time in milliseconds that pass before a message is being scrolled.
virtual void paintEvent(QPaintEvent *ev) override
void showMessage(const QString &sMessage, const QString &sCaller="")
StatusMessageDisplay(QWidget *pParent, QSize size)
virtual void enterEvent(QEvent *ev) override
void displayMessage(const QString &sMessage)
int m_nShowTimeout
Amount of time in milliseconds for which the status message will be displayed.