Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezehelper.cpp
Show First 20 Lines • Show All 1431 Lines • ▼ Show 20 Line(s) | 1430 | { | |||
---|---|---|---|---|---|
1432 | static const bool s_isWayland = KWindowSystem::isPlatformWayland(); | 1432 | static const bool s_isWayland = KWindowSystem::isPlatformWayland(); | ||
1433 | return s_isWayland; | 1433 | return s_isWayland; | ||
1434 | #else | 1434 | #else | ||
1435 | return false; | 1435 | return false; | ||
1436 | #endif | 1436 | #endif | ||
1437 | } | 1437 | } | ||
1438 | 1438 | | |||
1439 | //______________________________________________________________________________ | 1439 | //______________________________________________________________________________ | ||
1440 | QRectF Helper::strokedRect( const QRect &rect, const int penWidth ) const | ||||
1441 | { | ||||
1442 | /* With a pen stroke width of 1, the rectangle should have each of its | ||||
1443 | * sides moved inwards by half a pixel. This allows the stroke to be | ||||
1444 | * pixel perfect instead of blurry from sitting between pixels and | ||||
1445 | * prevents the rectangle with a stroke from becoming larger than the | ||||
1446 | * original size of the rectangle. | ||||
1447 | */ | ||||
1448 | qreal adjustment = 0.5 * penWidth; | ||||
1449 | return QRectF( rect ).adjusted( adjustment, adjustment, -adjustment, -adjustment ); | ||||
1450 | } | ||||
1451 | | ||||
1452 | QRectF Helper::strokedRect( const QRectF &rect, const int penWidth ) const | ||||
1453 | { | ||||
1454 | qreal adjustment = 0.5 * penWidth; | ||||
1455 | return rect.adjusted( adjustment, adjustment, -adjustment, -adjustment ); | ||||
1456 | } | ||||
1457 | | ||||
1458 | //______________________________________________________________________________ | ||||
1440 | QRectF Helper::shadowRect( const QRectF& rect ) const | 1459 | QRectF Helper::shadowRect( const QRectF& rect ) const | ||
1441 | { return rect.adjusted( 0.5, 0.5, -0.5, -0.5 ).translated( 0.5, 0.5 ); } | 1460 | { return rect.adjusted( 0.5, 0.5, -0.5, -0.5 ).translated( 0.5, 0.5 ); } | ||
1442 | 1461 | | |||
1443 | //______________________________________________________________________________ | 1462 | //______________________________________________________________________________ | ||
1444 | QPainterPath Helper::roundedPath( const QRectF& rect, Corners corners, qreal radius ) const | 1463 | QPainterPath Helper::roundedPath( const QRectF& rect, Corners corners, qreal radius ) const | ||
1445 | { | 1464 | { | ||
1446 | 1465 | | |||
1447 | QPainterPath path; | 1466 | QPainterPath path; | ||
▲ Show 20 Lines • Show All 162 Lines • Show Last 20 Lines |