Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezestyle.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 1283 Lines • ▼ Show 20 Line(s) | 1266 | { | |||
---|---|---|---|---|---|
1284 | 1284 | | |||
1285 | // frame | 1285 | // frame | ||
1286 | drawControl(QStyle::CE_PushButton, &option, &painter, button ); | 1286 | drawControl(QStyle::CE_PushButton, &option, &painter, button ); | ||
1287 | 1287 | | |||
1288 | // offset | 1288 | // offset | ||
1289 | const int margin( Metrics::Button_MarginWidth + Metrics::Frame_FrameWidth ); | 1289 | const int margin( Metrics::Button_MarginWidth + Metrics::Frame_FrameWidth ); | ||
1290 | QPoint offset( margin, margin ); | 1290 | QPoint offset( margin, margin ); | ||
1291 | 1291 | | |||
1292 | if( button->isDown() && !isFlat ) painter.translate( 1, 1 ); | | |||
1293 | { offset += QPoint( 1, 1 ); } | | |||
1294 | | ||||
1295 | // state | 1292 | // state | ||
1296 | const State& state( option.state ); | 1293 | const State& state( option.state ); | ||
1297 | const bool enabled( state & State_Enabled ); | 1294 | const bool enabled( state & State_Enabled ); | ||
1298 | bool mouseOver( enabled && ( state & State_MouseOver ) ); | 1295 | bool mouseOver( enabled && ( state & State_MouseOver ) ); | ||
1299 | bool hasFocus( enabled && ( state & State_HasFocus ) ); | 1296 | bool hasFocus( enabled && ( state & State_HasFocus ) ); | ||
1300 | 1297 | | |||
1301 | // icon | 1298 | // icon | ||
1302 | if( !button->icon().isNull() ) | 1299 | if( !button->icon().isNull() ) | ||
▲ Show 20 Lines • Show All 2242 Lines • ▼ Show 20 Line(s) | 3539 | { | |||
3545 | palette.setColor( QPalette::Button, KColorUtils::mix( button, base, 0.7 ) ); | 3542 | palette.setColor( QPalette::Button, KColorUtils::mix( button, base, 0.7 ) ); | ||
3546 | } | 3543 | } | ||
3547 | 3544 | | |||
3548 | const auto shadow( _helper->shadowColor( palette ) ); | 3545 | const auto shadow( _helper->shadowColor( palette ) ); | ||
3549 | const auto outline( _helper->buttonOutlineColor( palette, mouseOver, hasFocus, opacity, mode ) ); | 3546 | const auto outline( _helper->buttonOutlineColor( palette, mouseOver, hasFocus, opacity, mode ) ); | ||
3550 | const auto background( _helper->buttonBackgroundColor( palette, mouseOver, hasFocus, sunken, opacity, mode ) ); | 3547 | const auto background( _helper->buttonBackgroundColor( palette, mouseOver, hasFocus, sunken, opacity, mode ) ); | ||
3551 | 3548 | | |||
3552 | // render | 3549 | // render | ||
3553 | _helper->renderButtonFrame( painter, rect, background, outline, shadow, hasFocus, sunken ); | 3550 | _helper->renderButton( painter, rect, background, outline, shadow, hasFocus, sunken ); | ||
3554 | 3551 | | |||
3555 | } | 3552 | } | ||
3556 | 3553 | | |||
3557 | return true; | 3554 | return true; | ||
3558 | 3555 | | |||
3559 | } | 3556 | } | ||
3560 | 3557 | | |||
3561 | //______________________________________________________________ | 3558 | //______________________________________________________________ | ||
Show All 35 Lines | 3582 | { | |||
3597 | if( hasPopupMenu ) | 3594 | if( hasPopupMenu ) | ||
3598 | { | 3595 | { | ||
3599 | painter->setClipRect( rect ); | 3596 | painter->setClipRect( rect ); | ||
3600 | rect.adjust( 0, 0, Metrics::Frame_FrameRadius + 2, 0 ); | 3597 | rect.adjust( 0, 0, Metrics::Frame_FrameRadius + 2, 0 ); | ||
3601 | rect = visualRect( option, rect ); | 3598 | rect = visualRect( option, rect ); | ||
3602 | } | 3599 | } | ||
3603 | 3600 | | |||
3604 | // render | 3601 | // render | ||
3605 | _helper->renderButtonFrame( painter, rect, background, outline, shadow, hasFocus, sunken ); | 3602 | _helper->renderButton( painter, rect, background, outline, shadow, hasFocus, sunken ); | ||
3606 | 3603 | | |||
3607 | } else { | 3604 | } else { | ||
3608 | 3605 | | |||
3609 | const auto color( _helper->toolButtonColor( palette, mouseOver, hasFocus, sunken, opacity, mode ) ); | 3606 | const auto color( _helper->toolButtonColor( palette, mouseOver, hasFocus, sunken, opacity, mode ) ); | ||
3610 | _helper->renderToolButtonFrame( painter, rect, color, sunken ); | 3607 | _helper->renderToolButtonFrame( painter, rect, color, sunken ); | ||
3611 | 3608 | | |||
3612 | } | 3609 | } | ||
3613 | 3610 | | |||
▲ Show 20 Lines • Show All 350 Lines • ▼ Show 20 Line(s) | 3927 | { | |||
3964 | const auto background( _helper->buttonBackgroundColor( palette, mouseOver, hasFocus, false, opacity, mode ) ); | 3961 | const auto background( _helper->buttonBackgroundColor( palette, mouseOver, hasFocus, false, opacity, mode ) ); | ||
3965 | 3962 | | |||
3966 | auto frameRect( rect ); | 3963 | auto frameRect( rect ); | ||
3967 | painter->setClipRect( rect ); | 3964 | painter->setClipRect( rect ); | ||
3968 | frameRect.adjust( -Metrics::Frame_FrameRadius - 1, 0, 0, 0 ); | 3965 | frameRect.adjust( -Metrics::Frame_FrameRadius - 1, 0, 0, 0 ); | ||
3969 | frameRect = visualRect( option, frameRect ); | 3966 | frameRect = visualRect( option, frameRect ); | ||
3970 | 3967 | | |||
3971 | // render | 3968 | // render | ||
3972 | _helper->renderButtonFrame( painter, frameRect, background, outline, shadow, hasFocus, sunken ); | 3969 | _helper->renderButton( painter, frameRect, background, outline, shadow, hasFocus, sunken ); | ||
3973 | 3970 | | |||
3974 | // also render separator | 3971 | // also render separator | ||
3975 | auto separatorRect( rect.adjusted( 0, 2, -2, -2 ) ); | 3972 | auto separatorRect( rect.adjusted( 0, 2, -2, -2 ) ); | ||
3976 | separatorRect.setWidth( 1 ); | 3973 | separatorRect.setWidth( 1 ); | ||
3977 | separatorRect = visualRect( option, separatorRect ); | 3974 | separatorRect = visualRect( option, separatorRect ); | ||
3978 | if( sunken ) separatorRect.translate( 1, 1 ); | | |||
3979 | _helper->renderSeparator( painter, separatorRect, outline, true ); | 3975 | _helper->renderSeparator( painter, separatorRect, outline, true ); | ||
3980 | 3976 | | |||
3981 | return true; | 3977 | return true; | ||
3982 | 3978 | | |||
3983 | } | 3979 | } | ||
3984 | 3980 | | |||
3985 | //___________________________________________________________________________________ | 3981 | //___________________________________________________________________________________ | ||
3986 | bool Style::drawIndicatorTabClosePrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const | 3982 | bool Style::drawIndicatorTabClosePrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const | ||
▲ Show 20 Lines • Show All 259 Lines • ▼ Show 20 Line(s) | 4226 | { | |||
4246 | const bool flat( buttonOption->features & QStyleOptionButton::Flat ); | 4242 | const bool flat( buttonOption->features & QStyleOptionButton::Flat ); | ||
4247 | 4243 | | |||
4248 | // content | 4244 | // content | ||
4249 | const bool hasText( !buttonOption->text.isEmpty() ); | 4245 | const bool hasText( !buttonOption->text.isEmpty() ); | ||
4250 | const bool hasIcon( (showIconsOnPushButtons() || flat || !hasText ) && !buttonOption->icon.isNull() ); | 4246 | const bool hasIcon( (showIconsOnPushButtons() || flat || !hasText ) && !buttonOption->icon.isNull() ); | ||
4251 | 4247 | | |||
4252 | // contents | 4248 | // contents | ||
4253 | auto contentsRect( rect ); | 4249 | auto contentsRect( rect ); | ||
4254 | if( sunken && !flat ) contentsRect.translate( 1, 1 ); | | |||
4255 | 4250 | | |||
4256 | // color role | 4251 | // color role | ||
4257 | QPalette::ColorRole textRole; | 4252 | QPalette::ColorRole textRole; | ||
4258 | if( flat ) | 4253 | if( flat ) { | ||
4259 | { | | |||
4260 | 4254 | | |||
4261 | if( hasFocus && sunken ) textRole = QPalette::HighlightedText; | 4255 | if( hasFocus && sunken ) textRole = QPalette::HighlightedText; | ||
4262 | else textRole = QPalette::WindowText; | 4256 | else textRole = QPalette::WindowText; | ||
4263 | 4257 | | |||
4264 | } else if( hasFocus ) textRole = QPalette::HighlightedText; | 4258 | } else textRole = QPalette::ButtonText; | ||
4265 | else textRole = QPalette::ButtonText; | | |||
4266 | 4259 | | |||
4267 | // menu arrow | 4260 | // menu arrow | ||
4268 | if( buttonOption->features & QStyleOptionButton::HasMenu ) | 4261 | if( buttonOption->features & QStyleOptionButton::HasMenu ) | ||
4269 | { | 4262 | { | ||
4270 | 4263 | | |||
4271 | // define rect | 4264 | // define rect | ||
4272 | auto arrowRect( contentsRect ); | 4265 | auto arrowRect( contentsRect ); | ||
4273 | arrowRect.setLeft( contentsRect.right() - Metrics::MenuButton_IndicatorWidth + 1 ); | 4266 | arrowRect.setLeft( contentsRect.right() - Metrics::MenuButton_IndicatorWidth + 1 ); | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | |||||
4323 | 4316 | | |||
4324 | // render icon | 4317 | // render icon | ||
4325 | if( hasIcon && iconRect.isValid() ) { | 4318 | if( hasIcon && iconRect.isValid() ) { | ||
4326 | 4319 | | |||
4327 | // icon state and mode | 4320 | // icon state and mode | ||
4328 | const QIcon::State iconState( sunken ? QIcon::On : QIcon::Off ); | 4321 | const QIcon::State iconState( sunken ? QIcon::On : QIcon::Off ); | ||
4329 | QIcon::Mode iconMode; | 4322 | QIcon::Mode iconMode; | ||
4330 | if( !enabled ) iconMode = QIcon::Disabled; | 4323 | if( !enabled ) iconMode = QIcon::Disabled; | ||
4331 | else if( !flat && hasFocus ) iconMode = QIcon::Selected; | 4324 | // else if( !flat && hasFocus ) iconMode = QIcon::Selected; | ||
4332 | else if( mouseOver && flat ) iconMode = QIcon::Active; | 4325 | else if( mouseOver && flat ) iconMode = QIcon::Active; | ||
4333 | else iconMode = QIcon::Normal; | 4326 | else iconMode = QIcon::Normal; | ||
4334 | 4327 | | |||
4335 | const auto pixmap = buttonOption->icon.pixmap( iconSize, iconMode, iconState ); | 4328 | const auto pixmap = buttonOption->icon.pixmap( iconSize, iconMode, iconState ); | ||
4336 | drawItemPixmap( painter, iconRect, Qt::AlignCenter, pixmap ); | 4329 | drawItemPixmap( painter, iconRect, Qt::AlignCenter, pixmap ); | ||
4337 | 4330 | | |||
4338 | } | 4331 | } | ||
4339 | 4332 | | |||
Show All 29 Lines | 4343 | { | |||
4369 | else hasFocus = enabled && !mouseOver && (option->state & (State_HasFocus|State_Sunken) ); | 4362 | else hasFocus = enabled && !mouseOver && (option->state & (State_HasFocus|State_Sunken) ); | ||
4370 | 4363 | | |||
4371 | const bool hasArrow( toolButtonOption->features & QStyleOptionToolButton::Arrow ); | 4364 | const bool hasArrow( toolButtonOption->features & QStyleOptionToolButton::Arrow ); | ||
4372 | const bool hasIcon( !( hasArrow || toolButtonOption->icon.isNull() ) ); | 4365 | const bool hasIcon( !( hasArrow || toolButtonOption->icon.isNull() ) ); | ||
4373 | const bool hasText( !toolButtonOption->text.isEmpty() ); | 4366 | const bool hasText( !toolButtonOption->text.isEmpty() ); | ||
4374 | 4367 | | |||
4375 | // contents | 4368 | // contents | ||
4376 | auto contentsRect( rect ); | 4369 | auto contentsRect( rect ); | ||
4377 | if( sunken && !flat ) contentsRect.translate( 1, 1 ); | | |||
4378 | 4370 | | |||
4379 | // icon size | 4371 | // icon size | ||
4380 | const QSize iconSize( toolButtonOption->iconSize ); | 4372 | const QSize iconSize( toolButtonOption->iconSize ); | ||
4381 | 4373 | | |||
4382 | // text size | 4374 | // text size | ||
4383 | int textFlags( _mnemonics->textFlags() ); | 4375 | int textFlags( _mnemonics->textFlags() ); | ||
4384 | const QSize textSize( option->fontMetrics.size( textFlags, toolButtonOption->text ) ); | 4376 | const QSize textSize( option->fontMetrics.size( textFlags, toolButtonOption->text ) ); | ||
4385 | 4377 | | |||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 4430 | { | |||
4449 | } | 4441 | } | ||
4450 | 4442 | | |||
4451 | } else if( hasIcon && iconRect.isValid() ) { | 4443 | } else if( hasIcon && iconRect.isValid() ) { | ||
4452 | 4444 | | |||
4453 | // icon state and mode | 4445 | // icon state and mode | ||
4454 | const QIcon::State iconState( sunken ? QIcon::On : QIcon::Off ); | 4446 | const QIcon::State iconState( sunken ? QIcon::On : QIcon::Off ); | ||
4455 | QIcon::Mode iconMode; | 4447 | QIcon::Mode iconMode; | ||
4456 | if( !enabled ) iconMode = QIcon::Disabled; | 4448 | if( !enabled ) iconMode = QIcon::Disabled; | ||
4457 | else if( (!flat && hasFocus) || (flat && (state & State_Sunken) && !mouseOver) ) iconMode = QIcon::Selected; | 4449 | // else if( (!flat && hasFocus) || (flat && (state & State_Sunken) && !mouseOver) ) iconMode = QIcon::Selected; | ||
4458 | else if( mouseOver && flat ) iconMode = QIcon::Active; | 4450 | else if( mouseOver && flat ) iconMode = QIcon::Active; | ||
4459 | else iconMode = QIcon::Normal; | 4451 | else iconMode = QIcon::Normal; | ||
4460 | 4452 | | |||
4461 | const QPixmap pixmap = toolButtonOption->icon.pixmap( iconSize, iconMode, iconState ); | 4453 | const QPixmap pixmap = toolButtonOption->icon.pixmap( iconSize, iconMode, iconState ); | ||
4462 | drawItemPixmap( painter, iconRect, Qt::AlignCenter, pixmap ); | 4454 | drawItemPixmap( painter, iconRect, Qt::AlignCenter, pixmap ); | ||
4463 | 4455 | | |||
4464 | } | 4456 | } | ||
4465 | 4457 | | |||
4466 | // render text | 4458 | // render text | ||
4467 | if( hasText && textRect.isValid() ) | 4459 | if( hasText && textRect.isValid() ) | ||
4468 | { | 4460 | { | ||
4469 | 4461 | | |||
4470 | QPalette::ColorRole textRole( QPalette::ButtonText ); | 4462 | QPalette::ColorRole textRole( QPalette::ButtonText ); | ||
4471 | if( flat ) textRole = ( ((hasFocus&&sunken) || (state & State_Sunken))&&!mouseOver) ? QPalette::HighlightedText: QPalette::WindowText; | 4463 | if( flat ) textRole = ( ((hasFocus&&sunken) || (state & State_Sunken))&&!mouseOver) ? | ||
4472 | else if( hasFocus&&!mouseOver ) textRole = QPalette::HighlightedText; | 4464 | QPalette::HighlightedText : QPalette::WindowText; | ||
4473 | 4465 | | |||
4474 | painter->setFont(toolButtonOption->font); | 4466 | painter->setFont(toolButtonOption->font); | ||
4475 | drawItemText( painter, textRect, textFlags, palette, enabled, toolButtonOption->text, textRole ); | 4467 | drawItemText( painter, textRect, textFlags, palette, enabled, toolButtonOption->text, textRole ); | ||
4476 | 4468 | | |||
4477 | } | 4469 | } | ||
4478 | 4470 | | |||
4479 | return true; | 4471 | return true; | ||
4480 | 4472 | | |||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Line(s) | 4542 | { | |||
4561 | const bool flat( !comboBoxOption->frame ); | 4553 | const bool flat( !comboBoxOption->frame ); | ||
4562 | 4554 | | |||
4563 | QPalette::ColorRole textRole; | 4555 | QPalette::ColorRole textRole; | ||
4564 | if( flat ) { | 4556 | if( flat ) { | ||
4565 | 4557 | | |||
4566 | if( hasFocus && sunken ) textRole = QPalette::HighlightedText; | 4558 | if( hasFocus && sunken ) textRole = QPalette::HighlightedText; | ||
4567 | else textRole = QPalette::WindowText; | 4559 | else textRole = QPalette::WindowText; | ||
4568 | 4560 | | |||
4569 | } else if( hasFocus ) textRole = QPalette::HighlightedText; | 4561 | } else textRole = QPalette::ButtonText; | ||
4570 | else textRole = QPalette::ButtonText; | | |||
4571 | 4562 | | |||
4572 | // change pen color directly | 4563 | // change pen color directly | ||
4573 | painter->setPen( QPen( option->palette.color( textRole ), 1 ) ); | 4564 | painter->setPen( QPen( option->palette.color( textRole ), 1 ) ); | ||
4574 | 4565 | | |||
4575 | // translate painter for pressed down comboboxes | | |||
4576 | if( sunken && !flat ) | | |||
4577 | { painter->translate( 1, 1 ); } | | |||
4578 | | ||||
4579 | #if QT_VERSION >= 0x050000 | 4566 | #if QT_VERSION >= 0x050000 | ||
4580 | if (const auto cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) | 4567 | if (const auto cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) | ||
4581 | { | 4568 | { | ||
4582 | auto editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); | 4569 | auto editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); | ||
4583 | painter->save(); | 4570 | painter->save(); | ||
4584 | painter->setClipRect(editRect); | 4571 | painter->setClipRect(editRect); | ||
4585 | if (!cb->currentIcon.isNull()) { | 4572 | if (!cb->currentIcon.isNull()) { | ||
4586 | QIcon::Mode mode; | 4573 | QIcon::Mode mode; | ||
4587 | 4574 | | |||
4588 | if ((cb->state & QStyle::State_Selected) && (cb->state & QStyle::State_Active)) { | 4575 | /*if ((cb->state & QStyle::State_Selected) && (cb->state & QStyle::State_Active)) { | ||
4589 | mode = QIcon::Selected; | 4576 | mode = QIcon::Selected; | ||
4590 | } else if (cb->state & QStyle::State_Enabled) { | 4577 | } else */if (cb->state & QStyle::State_Enabled) { | ||
4591 | mode = QIcon::Normal; | 4578 | mode = QIcon::Normal; | ||
4592 | } else { | 4579 | } else { | ||
4593 | mode = QIcon::Disabled; | 4580 | mode = QIcon::Disabled; | ||
4594 | } | 4581 | } | ||
4595 | 4582 | | |||
4596 | QWindow *window = nullptr; | 4583 | QWindow *window = nullptr; | ||
4597 | if (widget && widget->window()) { | 4584 | if (widget && widget->window()) { | ||
4598 | window = widget->window()->windowHandle(); | 4585 | window = widget->window()->windowHandle(); | ||
▲ Show 20 Lines • Show All 1507 Lines • ▼ Show 20 Line(s) | 6040 | { | |||
6106 | 6093 | | |||
6107 | // arrow | 6094 | // arrow | ||
6108 | if( hasPopupMenu ) | 6095 | if( hasPopupMenu ) | ||
6109 | { | 6096 | { | ||
6110 | 6097 | | |||
6111 | copy.rect = menuRect; | 6098 | copy.rect = menuRect; | ||
6112 | if( !flat ) drawPrimitive( PE_IndicatorButtonDropDown, ©, painter, widget ); | 6099 | if( !flat ) drawPrimitive( PE_IndicatorButtonDropDown, ©, painter, widget ); | ||
6113 | 6100 | | |||
6114 | if( sunken && !flat ) copy.rect.translate( 1, 1 ); | | |||
6115 | drawPrimitive( PE_IndicatorArrowDown, ©, painter, widget ); | 6101 | drawPrimitive( PE_IndicatorArrowDown, ©, painter, widget ); | ||
6116 | 6102 | | |||
6117 | } else if( hasInlineIndicator ) { | 6103 | } else if( hasInlineIndicator ) { | ||
6118 | 6104 | | |||
6119 | copy.rect = menuRect; | 6105 | copy.rect = menuRect; | ||
6120 | 6106 | | |||
6121 | if( sunken && !flat ) copy.rect.translate( 1, 1 ); | | |||
6122 | drawPrimitive( PE_IndicatorArrowDown, ©, painter, widget ); | 6107 | drawPrimitive( PE_IndicatorArrowDown, ©, painter, widget ); | ||
6123 | 6108 | | |||
6124 | } | 6109 | } | ||
6125 | 6110 | | |||
6126 | // contents | 6111 | // contents | ||
6127 | { | 6112 | { | ||
6128 | 6113 | | |||
6129 | // restore state | 6114 | // restore state | ||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Line(s) | 6194 | } else { | |||
6224 | } else { | 6209 | } else { | ||
6225 | 6210 | | |||
6226 | // define colors | 6211 | // define colors | ||
6227 | const auto shadow( _helper->shadowColor( palette ) ); | 6212 | const auto shadow( _helper->shadowColor( palette ) ); | ||
6228 | const auto outline( _helper->buttonOutlineColor( palette, mouseOver, hasFocus, opacity, mode ) ); | 6213 | const auto outline( _helper->buttonOutlineColor( palette, mouseOver, hasFocus, opacity, mode ) ); | ||
6229 | const auto background( _helper->buttonBackgroundColor( palette, mouseOver, hasFocus, false, opacity, mode ) ); | 6214 | const auto background( _helper->buttonBackgroundColor( palette, mouseOver, hasFocus, false, opacity, mode ) ); | ||
6230 | 6215 | | |||
6231 | // render | 6216 | // render | ||
6232 | _helper->renderButtonFrame( painter, rect, background, outline, shadow, hasFocus, sunken ); | 6217 | _helper->renderButton( painter, rect, background, outline, shadow, hasFocus, sunken ); | ||
6233 | 6218 | | |||
6234 | } | 6219 | } | ||
6235 | 6220 | | |||
6236 | } | 6221 | } | ||
6237 | 6222 | | |||
6238 | } | 6223 | } | ||
6239 | 6224 | | |||
6240 | // arrow | 6225 | // arrow | ||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 6227 | { | |||
6284 | 6269 | | |||
6285 | } else if( empty || !enabled ) arrowColor = _helper->arrowColor( palette, QPalette::Disabled, QPalette::ButtonText ); | 6270 | } else if( empty || !enabled ) arrowColor = _helper->arrowColor( palette, QPalette::Disabled, QPalette::ButtonText ); | ||
6286 | else if( hasFocus && !mouseOver ) arrowColor = palette.color( QPalette::HighlightedText ); | 6271 | else if( hasFocus && !mouseOver ) arrowColor = palette.color( QPalette::HighlightedText ); | ||
6287 | else arrowColor = _helper->arrowColor( palette, QPalette::ButtonText ); | 6272 | else arrowColor = _helper->arrowColor( palette, QPalette::ButtonText ); | ||
6288 | 6273 | | |||
6289 | // arrow rect | 6274 | // arrow rect | ||
6290 | auto arrowRect( subControlRect( CC_ComboBox, option, SC_ComboBoxArrow, widget ) ); | 6275 | auto arrowRect( subControlRect( CC_ComboBox, option, SC_ComboBoxArrow, widget ) ); | ||
6291 | 6276 | | |||
6292 | // translate for non editable, non flat, sunken comboboxes | | |||
6293 | if( sunken && !flat && !editable ) arrowRect.translate( 1, 1 ); | | |||
6294 | | ||||
6295 | // render | 6277 | // render | ||
6296 | _helper->renderArrow( painter, arrowRect, arrowColor, ArrowDown ); | 6278 | _helper->renderArrow( painter, arrowRect, arrowColor, ArrowDown ); | ||
6297 | 6279 | | |||
6298 | } | 6280 | } | ||
6299 | 6281 | | |||
6300 | return true; | 6282 | return true; | ||
6301 | 6283 | | |||
6302 | } | 6284 | } | ||
▲ Show 20 Lines • Show All 977 Lines • Show Last 20 Lines |