Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezehelper.cpp
| Context not available. | |||||
| 21 | 21 | | |||
|---|---|---|---|---|---|
| 22 | #include "breeze.h" | 22 | #include "breeze.h" | ||
| 23 | #include "breezestyleconfigdata.h" | 23 | #include "breezestyleconfigdata.h" | ||
| 24 | #include "breezerenderdecorationbuttonicon.h" | ||||
| 24 | 25 | | |||
| 25 | #include <KColorUtils> | 26 | #include <KColorUtils> | ||
| 26 | #include <KWindowSystem> | 27 | #include <KWindowSystem> | ||
| Context not available. | |||||
| 1359 | 1360 | | |||
| 1360 | } | 1361 | } | ||
| 1361 | 1362 | | |||
| 1362 | pen.setCapStyle( Qt::RoundCap ); | | |||
| 1363 | pen.setJoinStyle( Qt::MiterJoin ); | | |||
| 1364 | pen.setWidthF( PenWidth::Symbol*qMax(1.0, 18.0/rect.width() ) ); | 1363 | pen.setWidthF( PenWidth::Symbol*qMax(1.0, 18.0/rect.width() ) ); | ||
| 1365 | painter->setPen( pen ); | 1364 | | ||
| 1366 | 1365 | std::unique_ptr<RenderDecorationButtonIcon18By18> iconRenderer; | |||
| 1366 | iconRenderer = RenderDecorationButtonIcon18By18::factory( painter, pen, StyleConfigData::buttonIconStyle(), true ); | ||||
| 1367 | | ||||
| 1367 | switch( buttonType ) | 1368 | switch( buttonType ) | ||
| 1368 | { | 1369 | { | ||
| 1369 | case ButtonClose: | 1370 | case ButtonClose: | ||
| 1370 | { | 1371 | { | ||
| 1371 | painter->drawLine( QPointF( 5, 5 ), QPointF( 13, 13 ) ); | 1372 | iconRenderer->renderCloseIcon(); | ||
| 1372 | painter->drawLine( 13, 5, 5, 13 ); | | |||
| 1373 | break; | 1373 | break; | ||
| 1374 | } | 1374 | } | ||
| 1375 | 1375 | | |||
| 1376 | case ButtonMaximize: | 1376 | case ButtonMaximize: | ||
| 1377 | { | 1377 | { | ||
| 1378 | painter->drawPolyline( QVector<QPointF>{ | 1378 | iconRenderer->renderMaximizeIcon(); | ||
| 1379 | QPointF( 4, 11 ), | | |||
| 1380 | QPointF( 9, 6 ), | | |||
| 1381 | QPointF( 14, 11 )}); | | |||
| 1382 | break; | 1379 | break; | ||
| 1383 | } | 1380 | } | ||
| 1384 | 1381 | | |||
| 1385 | case ButtonMinimize: | 1382 | case ButtonMinimize: | ||
| 1386 | { | 1383 | { | ||
| 1387 | 1384 | iconRenderer->renderMinimizeIcon(); | |||
| 1388 | painter->drawPolyline(QVector<QPointF>{ | | |||
| 1389 | QPointF( 4, 7 ), | | |||
| 1390 | QPointF( 9, 12 ), | | |||
| 1391 | QPointF( 14, 7 )} ); | | |||
| 1392 | break; | 1385 | break; | ||
| 1393 | } | 1386 | } | ||
| 1394 | 1387 | | |||
| 1395 | case ButtonRestore: | 1388 | case ButtonRestore: | ||
| 1396 | { | 1389 | { | ||
| 1397 | pen.setJoinStyle( Qt::RoundJoin ); | 1390 | iconRenderer->renderRestoreIcon(); | ||
| 1398 | painter->setPen( pen ); | | |||
| 1399 | painter->drawPolygon( QVector<QPointF>{ | | |||
| 1400 | QPointF( 4.5, 9 ), | | |||
| 1401 | QPointF( 9, 4.5 ), | | |||
| 1402 | QPointF( 13.5, 9 ), | | |||
| 1403 | QPointF( 9, 13.5 )}); | | |||
| 1404 | break; | 1391 | break; | ||
| 1405 | } | 1392 | } | ||
| 1406 | 1393 | | |||
| Context not available. | |||||