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 1082 Lines • ▼ Show 20 Line(s) | 1041 | { | |||
---|---|---|---|---|---|
1083 | case QEvent::MouseButtonRelease: | 1083 | case QEvent::MouseButtonRelease: | ||
1084 | case QEvent::MouseMove: | 1084 | case QEvent::MouseMove: | ||
1085 | { | 1085 | { | ||
1086 | 1086 | | |||
1087 | // case event | 1087 | // case event | ||
1088 | QMouseEvent* mouseEvent( static_cast<QMouseEvent*>( event ) ); | 1088 | QMouseEvent* mouseEvent( static_cast<QMouseEvent*>( event ) ); | ||
1089 | 1089 | | |||
1090 | // get frame framewidth | 1090 | // get frame framewidth | ||
1091 | const int frameWidth( pixelMetric( PM_DefaultFrameWidth, 0, widget ) ); | 1091 | const int frameWidth( pixelMetric( PM_DefaultFrameWidth, nullptr, widget ) ); | ||
1092 | 1092 | | |||
1093 | // find list of scrollbars | 1093 | // find list of scrollbars | ||
1094 | QList<QScrollBar*> scrollBars; | 1094 | QList<QScrollBar*> scrollBars; | ||
1095 | if( auto scrollArea = qobject_cast<QAbstractScrollArea*>( widget ) ) | 1095 | if( auto scrollArea = qobject_cast<QAbstractScrollArea*>( widget ) ) | ||
1096 | { | 1096 | { | ||
1097 | 1097 | | |||
1098 | if( scrollArea->horizontalScrollBarPolicy() != Qt::ScrollBarAlwaysOff ) scrollBars.append( scrollArea->horizontalScrollBar() ); | 1098 | if( scrollArea->horizontalScrollBarPolicy() != Qt::ScrollBarAlwaysOff ) scrollBars.append( scrollArea->horizontalScrollBar() ); | ||
1099 | if( scrollArea->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff )scrollBars.append( scrollArea->verticalScrollBar() ); | 1099 | if( scrollArea->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff )scrollBars.append( scrollArea->verticalScrollBar() ); | ||
▲ Show 20 Lines • Show All 2504 Lines • ▼ Show 20 Line(s) | |||||
3604 | { | 3604 | { | ||
3605 | 3605 | | |||
3606 | // make sure background role matches viewport | 3606 | // make sure background role matches viewport | ||
3607 | const QAbstractScrollArea* scrollArea; | 3607 | const QAbstractScrollArea* scrollArea; | ||
3608 | if( ( scrollArea = qobject_cast<const QAbstractScrollArea*>( widget ) ) && scrollArea->viewport() ) | 3608 | if( ( scrollArea = qobject_cast<const QAbstractScrollArea*>( widget ) ) && scrollArea->viewport() ) | ||
3609 | { | 3609 | { | ||
3610 | 3610 | | |||
3611 | // need to adjust clipRect in order not to render outside of frame | 3611 | // need to adjust clipRect in order not to render outside of frame | ||
3612 | const int frameWidth( pixelMetric( PM_DefaultFrameWidth, 0, scrollArea ) ); | 3612 | const int frameWidth( pixelMetric( PM_DefaultFrameWidth, nullptr, scrollArea ) ); | ||
3613 | painter->setClipRect( insideMargin( scrollArea->rect(), frameWidth ) ); | 3613 | painter->setClipRect( insideMargin( scrollArea->rect(), frameWidth ) ); | ||
3614 | painter->setBrush( scrollArea->viewport()->palette().color( scrollArea->viewport()->backgroundRole() ) ); | 3614 | painter->setBrush( scrollArea->viewport()->palette().color( scrollArea->viewport()->backgroundRole() ) ); | ||
3615 | painter->setPen( Qt::NoPen ); | 3615 | painter->setPen( Qt::NoPen ); | ||
3616 | painter->drawRect( option->rect ); | 3616 | painter->drawRect( option->rect ); | ||
3617 | return true; | 3617 | return true; | ||
3618 | 3618 | | |||
3619 | } else { | 3619 | } else { | ||
3620 | 3620 | | |||
▲ Show 20 Lines • Show All 1075 Lines • ▼ Show 20 Line(s) | 4651 | { | |||
4696 | 4696 | | |||
4697 | // render hover and focus | 4697 | // render hover and focus | ||
4698 | if( useStrongFocus && ( selected || sunken ) ) | 4698 | if( useStrongFocus && ( selected || sunken ) ) | ||
4699 | { | 4699 | { | ||
4700 | 4700 | | |||
4701 | const auto color = _helper->focusColor( palette ); | 4701 | const auto color = _helper->focusColor( palette ); | ||
4702 | const auto outlineColor = _helper->focusOutlineColor( palette ); | 4702 | const auto outlineColor = _helper->focusOutlineColor( palette ); | ||
4703 | 4703 | | |||
4704 | Sides sides = 0; | 4704 | Sides sides = nullptr; | ||
4705 | if( !menuItemOption->menuRect.isNull() ) | 4705 | if( !menuItemOption->menuRect.isNull() ) | ||
4706 | { | 4706 | { | ||
4707 | if( rect.top() <= menuItemOption->menuRect.top() ) sides |= SideTop; | 4707 | if( rect.top() <= menuItemOption->menuRect.top() ) sides |= SideTop; | ||
4708 | if( rect.bottom() >= menuItemOption->menuRect.bottom() ) sides |= SideBottom; | 4708 | if( rect.bottom() >= menuItemOption->menuRect.bottom() ) sides |= SideBottom; | ||
4709 | if( rect.left() <= menuItemOption->menuRect.left() ) sides |= SideLeft; | 4709 | if( rect.left() <= menuItemOption->menuRect.left() ) sides |= SideLeft; | ||
4710 | if( rect.right() >= menuItemOption->menuRect.right() ) sides |= SideRight; | 4710 | if( rect.right() >= menuItemOption->menuRect.right() ) sides |= SideRight; | ||
4711 | } | 4711 | } | ||
4712 | 4712 | | |||
▲ Show 20 Lines • Show All 2455 Lines • Show Last 20 Lines |