32 : QComboBox( pParent )
35 , m_bModifyOnChange( bModifyOnChange )
39 setFocusPolicy( Qt::ClickFocus );
41 if ( ! size.isNull() ) {
51 connect(
this, SIGNAL( activated(
int) ),
this, SLOT(
handleIsModified(
int) ) );
65 fontMetrics().size( Qt::TextSingleLine, sText ).width() *
67 view()->autoScrollMargin();
73 QComboBox::addItem( sText, userData );
81 setEnabled( bIsActive );
89 QComboBox::showPopup();
97 QColor widgetColor = pPref->getColorTheme()->m_widgetColor;
98 QColor widgetTextColor = pPref->getColorTheme()->m_widgetTextColor;
99 QColor widgetInactiveColor =
101 QColor widgetTextInactiveColor =
104 setStyleSheet( QString(
"\
107 background-color: %2; \
111QComboBox:disabled { \
113 background-color: %6; \
117QComboBox QAbstractItemView { \
119 background-color: #babfcf; \
121 .arg( widgetTextColor.name() )
122 .arg( widgetColor.name() )
123 .arg( pPref->getLevel3FontFamily() )
125 .arg( widgetTextInactiveColor.name() )
126 .arg( widgetInactiveColor.name() ) );
141 QComboBox::paintEvent( ev );
144 QPainter painter(
this);
146 QColor colorHighlightActive;
148 colorHighlightActive = pPref->getColorTheme()->m_highlightColor;
150 colorHighlightActive = pPref->getColorTheme()->m_lightColor;
156 if ( ! hasFocus() ) {
157 colorHighlightActive.setAlpha( 150 );
160 painter.fillRect( 0,
m_size.height() - 2,
m_size.width(), 2, colorHighlightActive );
165 QComboBox::enterEvent( ev );
170 QComboBox::leaveEvent( ev );
177 setFixedSize( size );
static Hydrogen * get_instance()
Returns the current Hydrogen instance __instance.
void setIsModified(bool bIsModified)
Wrapper around Song::setIsModified() that checks whether a song is set.
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.
@ Colors
At least one of the colors has 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.
virtual void showPopup() override
LCDCombo(QWidget *pParent, QSize size=QSize(0, 0), bool bModifyOnChange=false)
int m_nMaxWidth
Keep track of the text width of the items added.
void onPreferencesChanged(H2Core::Preferences::Changes changes)
bool m_bModifyOnChange
Whether Hydrogen::setIsModified() is invoked with true as soon as the value of the widget does change...
virtual void leaveEvent(QEvent *ev) override
void handleIsModified(int)
virtual void paintEvent(QPaintEvent *ev) override
void setIsActive(bool bIsActive)
void addItem(const QString &text, const QVariant &userData=QVariant())
virtual void enterEvent(QEvent *ev) override
static QColor makeTextColorInactive(QColor color)
If a widget is marked inactive the value of its text color are reduced by this factor.
static QColor makeWidgetColorInactive(QColor color)
If a widget is marked inactive the value of its background color are reduced by this factor.