Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezehelper.cpp
Show First 20 Lines • Show All 1291 Lines • ▼ Show 20 Line(s) | 1268 | { | |||
---|---|---|---|---|---|
1292 | QPainterPath path( roundedPath( frameRect, corners, radius ) ); | 1292 | QPainterPath path( roundedPath( frameRect, corners, radius ) ); | ||
1293 | painter->drawPath( path ); | 1293 | painter->drawPath( path ); | ||
1294 | 1294 | | |||
1295 | } | 1295 | } | ||
1296 | 1296 | | |||
1297 | //______________________________________________________________________________ | 1297 | //______________________________________________________________________________ | ||
1298 | void Helper::renderArrow( QPainter* painter, const QRect& rect, const QColor& color, ArrowOrientation orientation ) const | 1298 | void Helper::renderArrow( QPainter* painter, const QRect& rect, const QColor& color, ArrowOrientation orientation ) const | ||
1299 | { | 1299 | { | ||
1300 | | ||||
1301 | // define polygon | 1300 | // define polygon | ||
1302 | QPolygonF arrow; | 1301 | QPolygonF arrow; | ||
1303 | switch( orientation ) | 1302 | switch( orientation ) | ||
1304 | { | 1303 | { | ||
1305 | case ArrowUp: arrow << QPointF( -4, 2 ) << QPointF( 0, -2 ) << QPointF( 4, 2 ); break; | 1304 | case ArrowUp: arrow = QVector<QPointF>{QPointF( -4, 2 ), QPointF( 0, -2 ), QPointF( 4, 2 )}; break; | ||
1306 | case ArrowDown: arrow << QPointF( -4, -2 ) << QPointF( 0, 2 ) << QPointF( 4, -2 ); break; | 1305 | case ArrowDown: arrow = QVector<QPointF>{QPointF( -4, -2 ), QPointF( 0, 2 ), QPointF( 4, -2 )}; break; | ||
1307 | case ArrowLeft: arrow << QPointF( 2, -4 ) << QPointF( -2, 0 ) << QPointF( 2, 4 ); break; | 1306 | case ArrowLeft: arrow = QVector<QPointF>{QPointF( 2, -4 ), QPointF( -2, 0 ), QPointF( 2, 4 )}; break; | ||
1308 | case ArrowRight: arrow << QPointF( -2, -4 ) << QPointF( 2, 0 ) << QPointF( -2, 4 ); break; | 1307 | case ArrowRight: arrow = QVector<QPointF>{QPointF( -2, -4 ), QPointF( 2, 0 ), QPointF( -2, 4 )}; break; | ||
1309 | default: break; | 1308 | default: break; | ||
1310 | } | 1309 | } | ||
1311 | 1310 | | |||
1312 | painter->save(); | 1311 | painter->save(); | ||
1313 | painter->setRenderHints( QPainter::Antialiasing ); | 1312 | painter->setRenderHints( QPainter::Antialiasing ); | ||
1314 | painter->translate( QRectF( rect ).center() ); | 1313 | painter->translate( QRectF( rect ).center() ); | ||
1315 | painter->setBrush( Qt::NoBrush ); | 1314 | painter->setBrush( Qt::NoBrush ); | ||
1316 | painter->setPen( QPen( color, 1.1 ) ); | 1315 | painter->setPen( QPen( color, 1.1 ) ); | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 1359 | { | |||
1362 | { | 1361 | { | ||
1363 | painter->drawLine( QPointF( 5, 5 ), QPointF( 13, 13 ) ); | 1362 | painter->drawLine( QPointF( 5, 5 ), QPointF( 13, 13 ) ); | ||
1364 | painter->drawLine( 13, 5, 5, 13 ); | 1363 | painter->drawLine( 13, 5, 5, 13 ); | ||
1365 | break; | 1364 | break; | ||
1366 | } | 1365 | } | ||
1367 | 1366 | | |||
1368 | case ButtonMaximize: | 1367 | case ButtonMaximize: | ||
1369 | { | 1368 | { | ||
1370 | painter->drawPolyline( QPolygonF() | 1369 | painter->drawPolyline( QVector<QPointF>{ | ||
1371 | << QPointF( 4, 11 ) | 1370 | QPointF( 4, 11 ), | ||
1372 | << QPointF( 9, 6 ) | 1371 | QPointF( 9, 6 ), | ||
1373 | << QPointF( 14, 11 ) ); | 1372 | QPointF( 14, 11 )}); | ||
1374 | break; | 1373 | break; | ||
1375 | } | 1374 | } | ||
1376 | 1375 | | |||
1377 | case ButtonMinimize: | 1376 | case ButtonMinimize: | ||
1378 | { | 1377 | { | ||
1379 | 1378 | | |||
1380 | painter->drawPolyline( QPolygonF() | 1379 | painter->drawPolyline(QVector<QPointF>{ | ||
1381 | << QPointF( 4, 7 ) | 1380 | QPointF( 4, 7 ), | ||
1382 | << QPointF( 9, 12 ) | 1381 | QPointF( 9, 12 ), | ||
1383 | << QPointF( 14, 7 ) ); | 1382 | QPointF( 14, 7 )} ); | ||
1384 | break; | 1383 | break; | ||
1385 | } | 1384 | } | ||
1386 | 1385 | | |||
1387 | case ButtonRestore: | 1386 | case ButtonRestore: | ||
1388 | { | 1387 | { | ||
1389 | pen.setJoinStyle( Qt::RoundJoin ); | 1388 | pen.setJoinStyle( Qt::RoundJoin ); | ||
1390 | painter->setPen( pen ); | 1389 | painter->setPen( pen ); | ||
1391 | painter->drawPolygon( QPolygonF() | 1390 | painter->drawPolygon( QVector<QPointF>{ | ||
1392 | << QPointF( 4.5, 9 ) | 1391 | QPointF( 4.5, 9 ), | ||
1393 | << QPointF( 9, 4.5 ) | 1392 | QPointF( 9, 4.5 ), | ||
1394 | << QPointF( 13.5, 9 ) | 1393 | QPointF( 13.5, 9 ), | ||
1395 | << QPointF( 9, 13.5 ) ); | 1394 | QPointF( 9, 13.5 )}); | ||
1396 | break; | 1395 | break; | ||
1397 | } | 1396 | } | ||
1398 | 1397 | | |||
1399 | default: break; | 1398 | default: break; | ||
1400 | } | 1399 | } | ||
1401 | 1400 | | |||
1402 | painter->restore(); | 1401 | painter->restore(); | ||
1403 | 1402 | | |||
▲ Show 20 Lines • Show All 200 Lines • Show Last 20 Lines |