31 int nFactorGradient = 120;
34 QColor buttonBackgroundLight = pPref->getColorTheme()->m_widgetColor.lighter( nFactorGradient );
35 QColor buttonBackgroundDark = pPref->getColorTheme()->m_widgetColor.darker( nFactorGradient );
36 QColor buttonBackgroundLightHover = pPref->getColorTheme()->m_widgetColor.lighter( nFactorGradient + nHover );
37 QColor buttonBackgroundDarkHover = pPref->getColorTheme()->m_widgetColor.darker( nFactorGradient + nHover );
39 QColor buttonBackgroundCheckedLight = pPref->getColorTheme()->m_accentColor.lighter( nFactorGradient );
40 QColor buttonBackgroundCheckedDark = pPref->getColorTheme()->m_accentColor.darker( nFactorGradient );
41 QColor buttonBackgroundCheckedLightHover = pPref->getColorTheme()->m_accentColor.lighter( nFactorGradient + nHover );
42 QColor buttonBackgroundCheckedDarkHover = pPref->getColorTheme()->m_accentColor.darker( nFactorGradient + nHover );
43 QColor buttonTextChecked = pPref->getColorTheme()->m_accentTextColor;
44 QColor spinBoxSelection = pPref->getColorTheme()->m_spinBoxColor.darker( 120 );
49 border: 1px solid %1; \
50 background-color: %2; \
57 background-color: qlineargradient(x1: 0.1, y1: 0.1, x2: 1, y2: 1, \
58 stop: 0 %4, stop: 1 %5); \
61 background-color: qlineargradient(x1: 0.1, y1: 0.1, x2: 1, y2: 1, \
62 stop: 0 %6, stop: 1 %7); \
64QPushButton:checked { \
66 background-color: qlineargradient(x1: 0.1, y1: 0.1, x2: 1, y2: 1, \
67 stop: 0 %8, stop: 1 %9); \
69QPushButton:checked:hover { \
71 background-color: qlineargradient(x1: 0.1, y1: 0.1, x2: 1, y2: 1, \
72 stop: 0 %10, stop: 1 %11); \
76 background-color: %13; \
78QComboBox QAbstractItemView { \
79 background-color: #babfcf; \
81QLineEdit, QTextEdit { \
83 background-color: %13; \
85QDoubleSpinBox, QSpinBox { \
87 background-color: %15; \
88 selection-color: %14; \
89 selection-background-color: %16; \
92 .arg( pPref->getColorTheme()->m_toolTipTextColor.name() )
93 .arg( pPref->getColorTheme()->m_toolTipBaseColor.name() )
94 .arg( buttonTextChecked.name() )
95 .arg( buttonBackgroundLight.name() ).arg( buttonBackgroundDark.name() )
96 .arg( buttonBackgroundLightHover.name() ).arg( buttonBackgroundDarkHover.name() )
97 .arg( buttonBackgroundCheckedLight.name() ).arg( buttonBackgroundCheckedDark.name() )
98 .arg( buttonBackgroundCheckedLightHover.name() ).arg( buttonBackgroundCheckedDarkHover.name() )
99 .arg( pPref->getColorTheme()->m_widgetTextColor.name() )
100 .arg( pPref->getColorTheme()->m_widgetColor.name() )
101 .arg( pPref->getColorTheme()->m_spinBoxTextColor.name() )
102 .arg( pPref->getColorTheme()->m_spinBoxColor.name() )
103 .arg( spinBoxSelection.name() );
110 QPalette defaultPalette;
112 defaultPalette.setColor( QPalette::Window, pPref->getColorTheme()->m_windowColor );
113 defaultPalette.setColor( QPalette::WindowText, pPref->getColorTheme()->m_windowTextColor );
114 defaultPalette.setColor( QPalette::Base, pPref->getColorTheme()->m_baseColor );
115 defaultPalette.setColor( QPalette::AlternateBase, pPref->getColorTheme()->m_alternateBaseColor );
116 defaultPalette.setColor( QPalette::Text, pPref->getColorTheme()->m_textColor );
117 defaultPalette.setColor( QPalette::Button, pPref->getColorTheme()->m_buttonColor );
118 defaultPalette.setColor( QPalette::ButtonText, pPref->getColorTheme()->m_buttonTextColor );
119 defaultPalette.setColor( QPalette::Light, pPref->getColorTheme()->m_lightColor );
120 defaultPalette.setColor( QPalette::Midlight, pPref->getColorTheme()->m_midLightColor );
121 defaultPalette.setColor( QPalette::Dark, pPref->getColorTheme()->m_darkColor );
122 defaultPalette.setColor( QPalette::Mid, pPref->getColorTheme()->m_midColor );
123 defaultPalette.setColor( QPalette::Shadow, pPref->getColorTheme()->m_shadowTextColor );
124 defaultPalette.setColor( QPalette::Highlight, pPref->getColorTheme()->m_highlightColor );
125 defaultPalette.setColor( QPalette::HighlightedText, pPref->getColorTheme()->m_highlightedTextColor );
126 defaultPalette.setColor( QPalette::ToolTipBase, pPref->getColorTheme()->m_toolTipBaseColor );
127 defaultPalette.setColor( QPalette::ToolTipText, pPref->getColorTheme()->m_toolTipTextColor );
130 for ( QPalette::ColorRole role : { QPalette::Window, QPalette::Base, QPalette::AlternateBase, QPalette::Dark,
131 QPalette::Light, QPalette::Midlight, QPalette::Mid, QPalette::Shadow,
133 QColor normalColor = defaultPalette.color( QPalette::Normal, role );
134 QColor disabledColor = QColor( ( normalColor.red() + 138 ) / 2,
135 ( normalColor.green() + 144 ) / 2,
136 ( normalColor.blue() + 162 ) / 2);
137 defaultPalette.setColor( QPalette::Disabled, role, disabledColor );
140 pQApp->setPalette( defaultPalette );
148 background = background.lighter( 110 );
151 QColor backgroundLight = background.lighter( 150 );
152 QColor backgroundDark = background.darker( 220 );
154 p->fillRect( QRect( rect.x() + 1, rect.y() + 1,
155 rect.width() - 2, rect.height() - 2 ),
157 p->fillRect( QRect( rect.x(), rect.y(), rect.width(), 1 ),
159 p->fillRect( QRect( rect.x(), rect.y(), 1, rect.height() ),
161 p->fillRect( QRect( rect.x(), rect.y() + rect.height() - 1, rect.width(), 1 ),
163 p->fillRect( QRect( rect.x() + rect.width() - 1, rect.y(), 1, rect.height() ),
168 int nHue, nSaturation, nValue;
169 color.getHsv( &nHue, &nSaturation, &nValue );
170 nValue = std::max( 0, nValue - 40 );
171 color.setHsv( nHue, nSaturation, nValue );
227 const QPointF points[3] = {
229 QPointF( x + 8, y + 6 ),
233 QPen pen( Qt::black );
239 fillColor = QColor( 0, 0, 0 );
240 fillColor.setAlpha( 0 );
243 fillColor = pPref->getColorTheme()->m_songEditor_stackedModeOffNextColor;
246 fillColor = pPref->getColorTheme()->m_songEditor_stackedModeOnColor;
249 fillColor = pPref->getColorTheme()->m_songEditor_stackedModeOnNextColor;
254 p->setBrush( fillColor );
255 p->setRenderHint( QPainter::Antialiasing );
256 p->drawPolygon( points, 3 );
257 p->setBrush( Qt::NoBrush );
static void drawListBackground(QPainter *p, QRect rect, QColor background, bool bHovered)
Draws the background of a row in both the pattern list of the SongEditor and the instrument list in t...