Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezestyle.cpp
Context not available. | |||||
403 | auto font( scrollArea->font() ); | 403 | auto font( scrollArea->font() ); | ||
---|---|---|---|---|---|
404 | font.setBold( false ); | 404 | font.setBold( false ); | ||
405 | scrollArea->setFont( font ); | 405 | scrollArea->setFont( font ); | ||
406 | | ||||
407 | // adjust background role | | |||
408 | if( !StyleConfigData::sidePanelDrawFrame() ) | | |||
409 | { | | |||
410 | scrollArea->setBackgroundRole( QPalette::Window ); | | |||
411 | scrollArea->setForegroundRole( QPalette::WindowText ); | | |||
412 | | ||||
413 | if( scrollArea->viewport() ) | | |||
414 | { | | |||
415 | scrollArea->viewport()->setBackgroundRole( QPalette::Window ); | | |||
416 | scrollArea->viewport()->setForegroundRole( QPalette::WindowText ); | | |||
417 | } | | |||
418 | | ||||
419 | // QTreeView animates expanding/collapsing branches. It paints them into a | | |||
420 | // temp pixmap whose background is unconditionally filled with the palette's | | |||
421 | // *base* color which is usually different from the window's color | | |||
422 | // cf. QTreeViewPrivate::renderTreeToPixmapForAnimation() | | |||
423 | if ( auto treeView = qobject_cast<QTreeView *>( scrollArea ) ) { | | |||
424 | if (treeView->isAnimated()) { | | |||
425 | QPalette pal( treeView->palette() ); | | |||
426 | pal.setColor( QPalette::Active, QPalette::Base, treeView->palette().color( treeView->backgroundRole() ) ); | | |||
427 | treeView->setPalette(pal); | | |||
428 | } | | |||
429 | } | | |||
430 | } | | |||
431 | | ||||
432 | } | 406 | } | ||
433 | 407 | | |||
434 | // disable autofill background for flat (== NoFrame) scrollareas, with QPalette::Window as a background | 408 | // disable autofill background for flat (== NoFrame) scrollareas, with QPalette::Window as a background | ||
Context not available. | |||||
450 | { child->setAutoFillBackground( false ); } | 424 | { child->setAutoFillBackground( false ); } | ||
451 | } | 425 | } | ||
452 | 426 | | |||
427 | /* | ||||
428 | QTreeView animates expanding/collapsing branches. It paints them into a | ||||
429 | temp pixmap whose background is unconditionally filled with the palette's | ||||
430 | *base* color which is usually different from the window's color | ||||
431 | cf. QTreeViewPrivate::renderTreeToPixmapForAnimation() | ||||
432 | */ | ||||
433 | if( auto treeView = qobject_cast<QTreeView *>( scrollArea ) ) | ||||
434 | { | ||||
435 | if (treeView->isAnimated()) | ||||
436 | { | ||||
437 | QPalette pal( treeView->palette() ); | ||||
438 | pal.setColor( QPalette::Active, QPalette::Base, treeView->palette().color( treeView->backgroundRole() ) ); | ||||
439 | treeView->setPalette(pal); | ||||
440 | } | ||||
441 | } | ||||
442 | | ||||
453 | } | 443 | } | ||
454 | 444 | | |||
455 | //_______________________________________________________________ | 445 | //_______________________________________________________________ | ||
Context not available. | |||||
723 | case SE_ProgressBarGroove: return progressBarGrooveRect( option, widget ); | 713 | case SE_ProgressBarGroove: return progressBarGrooveRect( option, widget ); | ||
724 | case SE_ProgressBarContents: return progressBarContentsRect( option, widget ); | 714 | case SE_ProgressBarContents: return progressBarContentsRect( option, widget ); | ||
725 | case SE_ProgressBarLabel: return progressBarLabelRect( option, widget ); | 715 | case SE_ProgressBarLabel: return progressBarLabelRect( option, widget ); | ||
716 | case SE_FrameContents: return frameContentsRect( option, widget ); | ||||
726 | case SE_HeaderArrow: return headerArrowRect( option, widget ); | 717 | case SE_HeaderArrow: return headerArrowRect( option, widget ); | ||
727 | case SE_HeaderLabel: return headerLabelRect( option, widget ); | 718 | case SE_HeaderLabel: return headerLabelRect( option, widget ); | ||
728 | case SE_TabBarTabLeftButton: return tabBarTabLeftButtonRect( option, widget ); | 719 | case SE_TabBarTabLeftButton: return tabBarTabLeftButtonRect( option, widget ); | ||
Context not available. | |||||
1601 | 1592 | | |||
1602 | } | 1593 | } | ||
1603 | 1594 | | |||
1595 | //___________________________________________________________________________________________________________________ | ||||
1596 | QRect Style::frameContentsRect( const QStyleOption* option, const QWidget* widget ) const | ||||
1597 | { | ||||
1598 | if( !StyleConfigData::sidePanelDrawFrame() && | ||||
1599 | qobject_cast<const QAbstractScrollArea*>( widget ) && | ||||
1600 | widget->property( PropertyNames::sidePanelView ).toBool() ) | ||||
1601 | { | ||||
1602 | | ||||
1603 | // adjust margins for sidepanel widgets | ||||
1604 | return option->rect.adjusted( 0, 0, -1, 0 ); | ||||
1605 | | ||||
1606 | } else { | ||||
1607 | | ||||
1608 | // base class implementation | ||||
1609 | return ParentStyleClass::subElementRect( SE_FrameContents, option, widget ); | ||||
1610 | | ||||
1611 | } | ||||
1612 | } | ||||
1613 | | ||||
1604 | //___________________________________________________________________________________________________________________ | 1614 | //___________________________________________________________________________________________________________________ | ||
1605 | QRect Style::progressBarLabelRect( const QStyleOption* option, const QWidget* ) const | 1615 | QRect Style::progressBarLabelRect( const QStyleOption* option, const QWidget* ) const | ||
1606 | { | 1616 | { | ||
Context not available. |