Changeset View
Changeset View
Standalone View
Standalone View
libbreezecommon/breezestyleredmond.cpp
- This file was added.
| Property | Old Value | New Value |
|---|---|---|
| File Mode | null | 100755 |
| 1 | /* | ||||
|---|---|---|---|---|---|
| 2 | * Copyright 2020 Paul McAuley <kde@paulmcauley.com> | ||||
| 3 | * | ||||
| 4 | * This program is free software; you can redistribute it and/or | ||||
| 5 | * modify it under the terms of the GNU General Public License as | ||||
| 6 | * published by the Free Software Foundation; either version 2 of | ||||
| 7 | * the License or (at your option) version 3 or any later version | ||||
| 8 | * accepted by the membership of KDE e.V. (or its successor approved | ||||
| 9 | * by the membership of KDE e.V.), which shall act as a proxy | ||||
| 10 | * defined in Section 14 of version 3 of the license. | ||||
| 11 | * | ||||
| 12 | * This program is distributed in the hope that it will be useful, | ||||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
| 15 | * GNU General Public License for more details. | ||||
| 16 | * | ||||
| 17 | * You should have received a copy of the GNU General Public License | ||||
| 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
| 19 | */ | ||||
| 20 | | ||||
| 21 | #include "breezestyleredmond.h" | ||||
| 22 | | ||||
| 23 | namespace Breeze | ||||
| 24 | { | ||||
| 25 | void RenderStyleRedmond18By18::renderCloseIcon() | ||||
| 26 | { | ||||
| 27 | // slightly larger X to tie-in with design of square maximize button | ||||
| 28 | painter->drawLine( QPointF( 4.5, 4.5 ), QPointF( 13.5, 13.5 ) ); | ||||
| 29 | painter->drawLine( QPointF(13.5, 4.5), QPointF(4.5, 13.5) ); | ||||
| 30 | } | ||||
| 31 | | ||||
| 32 | void RenderStyleRedmond18By18::renderMaximizeIcon() | ||||
| 33 | { | ||||
| 34 | //large square | ||||
| 35 | pen.setJoinStyle( Qt::RoundJoin ); | ||||
| 36 | painter->setPen( pen ); | ||||
| 37 | | ||||
| 38 | painter->drawRect( QRectF( QPointF( 4.5, 4.5 ), QPointF( 13.5, 13.5 ) ) ); | ||||
| 39 | } | ||||
| 40 | | ||||
| 41 | void RenderStyleRedmond18By18::renderRestoreIcon() | ||||
| 42 | { | ||||
| 43 | pen.setJoinStyle( Qt::RoundJoin ); | ||||
| 44 | painter->setPen( pen ); | ||||
| 45 | | ||||
| 46 | if(this->notInTitlebar){ | ||||
| 47 | //disable antialiasing to remove blur at small sizes | ||||
| 48 | painter->setRenderHints( QPainter::Antialiasing, false ); | ||||
| 49 | | ||||
| 50 | //overlapping windows icon | ||||
| 51 | painter->drawRect( QRectF( QPointF( 4, 6 ), QPointF( 11, 13 ) ) ); | ||||
| 52 | painter->drawPolyline( QVector<QPointF>{ | ||||
| 53 | QPointF( 6, 6 ), | ||||
| 54 | QPointF( 6, 4 ), | ||||
| 55 | QPointF( 13, 4 ), | ||||
| 56 | QPointF( 13, 11 ), | ||||
| 57 | QPointF( 11, 11 )} ); | ||||
| 58 | | ||||
| 59 | } else { | ||||
| 60 | | ||||
| 61 | //overlapping windows icon | ||||
| 62 | painter->drawRect( QRectF( QPointF( 4.5, 6.5 ), QPointF( 11.5, 13.5 ) ) ); | ||||
| 63 | painter->drawPolyline( QVector<QPointF>{ | ||||
| 64 | QPointF( 6.5, 6.5 ), | ||||
| 65 | QPointF( 6.5, 4.5 ), | ||||
| 66 | QPointF( 13.5, 4.5 ), | ||||
| 67 | QPointF( 13.5, 11.5 ), | ||||
| 68 | QPointF( 11.5, 11.5 )} ); | ||||
| 69 | } | ||||
| 70 | } | ||||
| 71 | | ||||
| 72 | void RenderStyleRedmond18By18::renderMinimizeIcon() | ||||
| 73 | { | ||||
| 74 | //horizontal line | ||||
| 75 | painter->drawLine( QPointF( 4.5, 9.5 ), QPointF( 13.5, 9.5 ) ); | ||||
| 76 | | ||||
| 77 | } | ||||
| 78 | | ||||
| 79 | | ||||
| 80 | /*//Experimental 3 squares | ||||
| 81 | void RenderStyleRedmond18By18::renderKeepBehindIcon() | ||||
| 82 | { | ||||
| 83 | pen.setJoinStyle( Qt::RoundJoin ); | ||||
| 84 | painter->setPen( pen ); | ||||
| 85 | | ||||
| 86 | //foreground squares | ||||
| 87 | painter->drawRect( QRectF( QPointF( 3.5, 3.5 ), QPointF( 8.5, 8.5 ) ) ); | ||||
| 88 | painter->drawRect( QRectF( QPointF( 9.5, 9.5 ), QPointF( 14.5, 14.5 ) ) ); | ||||
| 89 | | ||||
| 90 | //filled background square | ||||
| 91 | painter->setBrush( pen.color() ); | ||||
| 92 | painter->drawPolygon( QPolygonF() | ||||
| 93 | << QPointF( 8.5, 5.5 ) | ||||
| 94 | << QPointF( 12.5, 5.5 ) | ||||
| 95 | << QPointF( 12.5, 9.5 ) | ||||
| 96 | << QPointF( 9.5, 9.5 ) | ||||
| 97 | << QPointF( 9.5, 12.5 ) | ||||
| 98 | << QPointF( 5.5, 12.5 ) | ||||
| 99 | << QPointF( 5.5, 8.5 ) | ||||
| 100 | << QPointF( 8.5, 8.5 ) | ||||
| 101 | ); | ||||
| 102 | } | ||||
| 103 | | ||||
| 104 | void RenderStyleRedmond18By18::renderKeepInFrontIcon() | ||||
| 105 | { | ||||
| 106 | pen.setJoinStyle( Qt::RoundJoin ); | ||||
| 107 | painter->setPen( pen ); | ||||
| 108 | | ||||
| 109 | //background squares | ||||
| 110 | painter->drawRect( QRectF( QPointF( 3.5, 3.5 ), QPointF( 8.5, 8.5 ) ) ); | ||||
| 111 | painter->drawRect( QRectF( QPointF( 9.5, 9.5 ), QPointF( 14.5, 14.5 ) ) ); | ||||
| 112 | | ||||
| 113 | //filled foreground square | ||||
| 114 | painter->setBrush( pen.color() ); | ||||
| 115 | painter->drawRect( QRectF( QPointF( 5.5, 5.5 ), QPointF( 12.5, 12.5 ) ) ); | ||||
| 116 | } | ||||
| 117 | */ | ||||
| 118 | | ||||
| 119 | /*//Experimental 2 squares | ||||
| 120 | void RenderStyleRedmond18By18::renderKeepBehindIcon() | ||||
| 121 | { | ||||
| 122 | pen.setJoinStyle( Qt::RoundJoin ); | ||||
| 123 | painter->setPen( pen ); | ||||
| 124 | | ||||
| 125 | //foreground square | ||||
| 126 | painter->drawRect( QRectF( QPointF( 7.5, 7.5 ), QPointF( 13.5, 13.5 ) ) ); | ||||
| 127 | | ||||
| 128 | //filled background square | ||||
| 129 | painter->setBrush( pen.color() ); | ||||
| 130 | painter->drawPolygon( QPolygonF() | ||||
| 131 | << QPointF( 4.5, 4.5 ) | ||||
| 132 | << QPointF( 10.5, 4.5 ) | ||||
| 133 | << QPointF( 10.5, 7.5 ) | ||||
| 134 | << QPointF( 7.5, 7.5 ) | ||||
| 135 | << QPointF( 7.5, 10.5 ) | ||||
| 136 | << QPointF( 4.5, 10.5 ) | ||||
| 137 | ); | ||||
| 138 | | ||||
| 139 | } | ||||
| 140 | | ||||
| 141 | void RenderStyleRedmond18By18::renderKeepInFrontIcon() | ||||
| 142 | { | ||||
| 143 | pen.setJoinStyle( Qt::RoundJoin ); | ||||
| 144 | painter->setPen( pen ); | ||||
| 145 | | ||||
| 146 | //background square | ||||
| 147 | painter->drawRect( QRectF( QPointF( 7.5, 7.5 ), QPointF( 13.5, 13.5 ) ) ); | ||||
| 148 | | ||||
| 149 | //filled foreground square | ||||
| 150 | painter->setBrush( pen.color() ); | ||||
| 151 | painter->drawRect( QRectF( QPointF( 4.5, 4.5 ), QPointF( 10.5, 10.5 ) ) ); | ||||
| 152 | } | ||||
| 153 | */ | ||||
| 154 | | ||||
| 155 | // For consistency with breeze icon set | ||||
| 156 | void RenderStyleRedmond18By18::renderKeepBehindIcon() | ||||
| 157 | { | ||||
| 158 | //horizontal lines | ||||
| 159 | painter->drawLine( QPointF( 4.5, 13.5 ), QPointF( 13.5, 13.5 ) ); | ||||
| 160 | painter->drawLine( QPointF( 9.5, 9.5 ), QPointF( 13.5, 9.5 ) ); | ||||
| 161 | painter->drawLine( QPointF( 9.5, 5.5 ), QPointF( 13.5, 5.5 ) ); | ||||
| 162 | | ||||
| 163 | //arrow | ||||
| 164 | painter->drawLine( QPointF( 4.5, 3.5 ), QPointF( 4.5, 11.5 ) ); | ||||
| 165 | | ||||
| 166 | painter->drawPolyline( QVector<QPointF>{ | ||||
| 167 | QPointF( 2.5, 9.5 ), | ||||
| 168 | QPointF( 4.5, 11.5 ), | ||||
| 169 | QPointF( 6.5, 9.5 )} ); | ||||
| 170 | } | ||||
| 171 | | ||||
| 172 | void RenderStyleRedmond18By18::renderKeepInFrontIcon() | ||||
| 173 | { | ||||
| 174 | //horizontal lines | ||||
| 175 | painter->drawLine( QPointF( 4.5, 4.5 ), QPointF( 13.5, 4.5 ) ); | ||||
| 176 | painter->drawLine( QPointF( 4.5, 8.5 ), QPointF( 8.5, 8.5 ) ); | ||||
| 177 | painter->drawLine( QPointF( 4.5, 12.5 ), QPointF( 8.5, 12.5 ) ); | ||||
| 178 | | ||||
| 179 | //arrow | ||||
| 180 | painter->drawLine( QPointF( 13.5, 6.5 ), QPointF( 13.5, 14.5 ) ); | ||||
| 181 | | ||||
| 182 | painter->drawPolyline( QVector<QPointF>{ | ||||
| 183 | QPointF( 11.5, 8.5 ), | ||||
| 184 | QPointF( 13.5, 6.5 ), | ||||
| 185 | QPointF( 15.5, 8.5 )} ); | ||||
| 186 | } | ||||
| 187 | | ||||
| 188 | } | ||||