Changeset View
Changeset View
Standalone View
Standalone View
src/kiconloader.cpp
Show First 20 Lines • Show All 515 Lines • ▼ Show 20 Line(s) | 499 | foreach (const QString &overlay, overlays) { | |||
---|---|---|---|---|---|
516 | 516 | | |||
517 | // match the emblem's devicePixelRatio to the original pixmap's | 517 | // match the emblem's devicePixelRatio to the original pixmap's | ||
518 | pixmap.setDevicePixelRatio(pix.devicePixelRatio()); | 518 | pixmap.setDevicePixelRatio(pix.devicePixelRatio()); | ||
519 | const int margin = 2 * pixmap.devicePixelRatio(); | 519 | const int margin = 2 * pixmap.devicePixelRatio(); | ||
520 | 520 | | |||
521 | QPoint startPoint; | 521 | QPoint startPoint; | ||
522 | switch (count) { | 522 | switch (count) { | ||
523 | case 0: | 523 | case 0: | ||
524 | // bottom left corner | | |||
525 | startPoint = QPoint(margin, height - overlaySize - margin); | | |||
526 | break; | | |||
527 | case 1: | | |||
528 | // bottom right corner | 524 | // bottom right corner | ||
529 | startPoint = QPoint(width - overlaySize - margin, | 525 | startPoint = QPoint(width - overlaySize - margin, | ||
530 | height - overlaySize - margin); | 526 | height - overlaySize - margin); | ||
531 | break; | 527 | break; | ||
532 | case 2: | 528 | case 1: | ||
533 | // top right corner | 529 | // bottom left corner | ||
534 | startPoint = QPoint(width - overlaySize - margin, margin); | 530 | startPoint = QPoint(margin, height - overlaySize - margin); | ||
535 | break; | 531 | break; | ||
536 | case 3: | 532 | case 2: | ||
537 | // top left corner | 533 | // top left corner | ||
538 | startPoint = QPoint(margin, margin); | 534 | startPoint = QPoint(margin, margin); | ||
539 | break; | 535 | break; | ||
536 | case 3: | ||||
537 | // top right corner | ||||
538 | startPoint = QPoint(width - overlaySize - margin, margin); | ||||
539 | break; | ||||
540 | } | 540 | } | ||
541 | 541 | | |||
542 | startPoint /= pix.devicePixelRatio(); | 542 | startPoint /= pix.devicePixelRatio(); | ||
543 | 543 | | |||
544 | painter.drawPixmap(startPoint, pixmap); | 544 | painter.drawPixmap(startPoint, pixmap); | ||
545 | 545 | | |||
546 | ++count; | 546 | ++count; | ||
547 | if (count > 3) { | 547 | if (count > 3) { | ||
▲ Show 20 Lines • Show All 1319 Lines • Show Last 20 Lines |