Changeset View
Changeset View
Standalone View
Standalone View
libbreezecommon/breezestyleclassic.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 "breezestyleclassic.h" | ||||
| 22 | | ||||
| 23 | namespace Breeze | ||||
| 24 | { | ||||
| 25 | void RenderStyleClassic18By18::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 RenderStyleClassic18By18::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 RenderStyleClassic18By18::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 RenderStyleClassic18By18::renderMinimizeIcon() | ||||
| 73 | { | ||||
| 74 | //tiny filled square | ||||
| 75 | pen.setJoinStyle( Qt::RoundJoin ); | ||||
| 76 | painter->setBrush( pen.color() ); | ||||
| 77 | painter->setPen( pen ); | ||||
| 78 | | ||||
| 79 | painter->drawRect( QRectF( QPointF( 7.5, 7.5 ), QPointF( 10.5, 10.5 ) ) ); | ||||
| 80 | } | ||||
| 81 | | ||||
| 82 | | ||||
| 83 | /*//Experimental 3 squares | ||||
| 84 | void RenderStyleClassic18By18::renderKeepBehindIcon() | ||||
| 85 | { | ||||
| 86 | pen.setJoinStyle( Qt::RoundJoin ); | ||||
| 87 | painter->setPen( pen ); | ||||
| 88 | | ||||
| 89 | //foreground squares | ||||
| 90 | painter->drawRect( QRectF( QPointF( 3.5, 3.5 ), QPointF( 8.5, 8.5 ) ) ); | ||||
| 91 | painter->drawRect( QRectF( QPointF( 9.5, 9.5 ), QPointF( 14.5, 14.5 ) ) ); | ||||
| 92 | | ||||
| 93 | //filled background square | ||||
| 94 | painter->setBrush( pen.color() ); | ||||
| 95 | painter->drawPolygon( QPolygonF() | ||||
| 96 | << QPointF( 8.5, 5.5 ) | ||||
| 97 | << QPointF( 12.5, 5.5 ) | ||||
| 98 | << QPointF( 12.5, 9.5 ) | ||||
| 99 | << QPointF( 9.5, 9.5 ) | ||||
| 100 | << QPointF( 9.5, 12.5 ) | ||||
| 101 | << QPointF( 5.5, 12.5 ) | ||||
| 102 | << QPointF( 5.5, 8.5 ) | ||||
| 103 | << QPointF( 8.5, 8.5 ) | ||||
| 104 | ); | ||||
| 105 | } | ||||
| 106 | | ||||
| 107 | void RenderStyleClassic18By18::renderKeepInFrontIcon() | ||||
| 108 | { | ||||
| 109 | pen.setJoinStyle( Qt::RoundJoin ); | ||||
| 110 | painter->setPen( pen ); | ||||
| 111 | | ||||
| 112 | //background squares | ||||
| 113 | painter->drawRect( QRectF( QPointF( 3.5, 3.5 ), QPointF( 8.5, 8.5 ) ) ); | ||||
| 114 | painter->drawRect( QRectF( QPointF( 9.5, 9.5 ), QPointF( 14.5, 14.5 ) ) ); | ||||
| 115 | | ||||
| 116 | //filled foreground square | ||||
| 117 | painter->setBrush( pen.color() ); | ||||
| 118 | painter->drawRect( QRectF( QPointF( 5.5, 5.5 ), QPointF( 12.5, 12.5 ) ) ); | ||||
| 119 | } | ||||
| 120 | */ | ||||
| 121 | | ||||
| 122 | /*//Experimental 2 squares | ||||
| 123 | void RenderStyleClassic18By18::renderKeepBehindIcon() | ||||
| 124 | { | ||||
| 125 | pen.setJoinStyle( Qt::RoundJoin ); | ||||
| 126 | painter->setPen( pen ); | ||||
| 127 | | ||||
| 128 | //foreground square | ||||
| 129 | painter->drawRect( QRectF( QPointF( 7.5, 7.5 ), QPointF( 13.5, 13.5 ) ) ); | ||||
| 130 | | ||||
| 131 | //filled background square | ||||
| 132 | painter->setBrush( pen.color() ); | ||||
| 133 | painter->drawPolygon( QPolygonF() | ||||
| 134 | << QPointF( 4.5, 4.5 ) | ||||
| 135 | << QPointF( 10.5, 4.5 ) | ||||
| 136 | << QPointF( 10.5, 7.5 ) | ||||
| 137 | << QPointF( 7.5, 7.5 ) | ||||
| 138 | << QPointF( 7.5, 10.5 ) | ||||
| 139 | << QPointF( 4.5, 10.5 ) | ||||
| 140 | ); | ||||
| 141 | | ||||
| 142 | } | ||||
| 143 | | ||||
| 144 | void RenderStyleClassic18By18::renderKeepInFrontIcon() | ||||
| 145 | { | ||||
| 146 | pen.setJoinStyle( Qt::RoundJoin ); | ||||
| 147 | painter->setPen( pen ); | ||||
| 148 | | ||||
| 149 | //background square | ||||
| 150 | painter->drawRect( QRectF( QPointF( 7.5, 7.5 ), QPointF( 13.5, 13.5 ) ) ); | ||||
| 151 | | ||||
| 152 | //filled foreground square | ||||
| 153 | painter->setBrush( pen.color() ); | ||||
| 154 | painter->drawRect( QRectF( QPointF( 4.5, 4.5 ), QPointF( 10.5, 10.5 ) ) ); | ||||
| 155 | } | ||||
| 156 | */ | ||||
| 157 | | ||||
| 158 | /* //Experimental filled arrows | ||||
| 159 | void RenderStyleClassic18By18::renderKeepBehindIcon() | ||||
| 160 | { | ||||
| 161 | //horizontal lines | ||||
| 162 | painter->drawLine( QPointF( 4.5, 13.5 ), QPointF( 13.5, 13.5 ) ); | ||||
| 163 | painter->drawLine( QPointF( 9.5, 9.5 ), QPointF( 13.5, 9.5 ) ); | ||||
| 164 | painter->drawLine( QPointF( 9.5, 5.5 ), QPointF( 13.5, 5.5 ) ); | ||||
| 165 | | ||||
| 166 | //arrow | ||||
| 167 | painter->drawLine( QPointF( 4.5, 3.5 ), QPointF( 4.5, 11.5 ) ); | ||||
| 168 | | ||||
| 169 | painter->setBrush( pen.color() ); | ||||
| 170 | painter->drawConvexPolygon( QPolygonF() | ||||
| 171 | << QPointF( 2.5, 8.5 ) | ||||
| 172 | << QPointF( 4.5, 11.5 ) | ||||
| 173 | << QPointF( 6.5, 8.5 ) ); | ||||
| 174 | } | ||||
| 175 | | ||||
| 176 | void RenderStyleClassic18By18::renderKeepInFrontIcon() | ||||
| 177 | { | ||||
| 178 | //horizontal lines | ||||
| 179 | painter->drawLine( QPointF( 4.5, 4.5 ), QPointF( 13.5, 4.5 ) ); | ||||
| 180 | painter->drawLine( QPointF( 4.5, 8.5 ), QPointF( 8.5, 8.5 ) ); | ||||
| 181 | painter->drawLine( QPointF( 4.5, 12.5 ), QPointF( 8.5, 12.5 ) ); | ||||
| 182 | | ||||
| 183 | //arrow | ||||
| 184 | painter->drawLine( QPointF( 13.5, 6.5 ), QPointF( 13.5, 14.5 ) ); | ||||
| 185 | | ||||
| 186 | painter->setBrush( pen.color() ); | ||||
| 187 | painter->drawConvexPolygon( QPolygonF() | ||||
| 188 | << QPointF( 11.5, 9.5 ) | ||||
| 189 | << QPointF( 13.5, 6.5 ) | ||||
| 190 | << QPointF( 15.5, 9.5 ) ); | ||||
| 191 | } | ||||
| 192 | */ | ||||
| 193 | | ||||
| 194 | // For consistency with breeze icon set | ||||
| 195 | void RenderStyleClassic18By18::renderKeepBehindIcon() | ||||
| 196 | { | ||||
| 197 | //horizontal lines | ||||
| 198 | painter->drawLine( QPointF( 4.5, 13.5 ), QPointF( 13.5, 13.5 ) ); | ||||
| 199 | painter->drawLine( QPointF( 9.5, 9.5 ), QPointF( 13.5, 9.5 ) ); | ||||
| 200 | painter->drawLine( QPointF( 9.5, 5.5 ), QPointF( 13.5, 5.5 ) ); | ||||
| 201 | | ||||
| 202 | //arrow | ||||
| 203 | painter->drawLine( QPointF( 4.5, 3.5 ), QPointF( 4.5, 11.5 ) ); | ||||
| 204 | | ||||
| 205 | painter->drawPolyline( QVector<QPointF>{ | ||||
| 206 | QPointF( 2.5, 9.5 ), | ||||
| 207 | QPointF( 4.5, 11.5 ), | ||||
| 208 | QPointF( 6.5, 9.5 )} ); | ||||
| 209 | } | ||||
| 210 | | ||||
| 211 | void RenderStyleClassic18By18::renderKeepInFrontIcon() | ||||
| 212 | { | ||||
| 213 | //horizontal lines | ||||
| 214 | painter->drawLine( QPointF( 4.5, 4.5 ), QPointF( 13.5, 4.5 ) ); | ||||
| 215 | painter->drawLine( QPointF( 4.5, 8.5 ), QPointF( 8.5, 8.5 ) ); | ||||
| 216 | painter->drawLine( QPointF( 4.5, 12.5 ), QPointF( 8.5, 12.5 ) ); | ||||
| 217 | | ||||
| 218 | //arrow | ||||
| 219 | painter->drawLine( QPointF( 13.5, 6.5 ), QPointF( 13.5, 14.5 ) ); | ||||
| 220 | | ||||
| 221 | painter->drawPolyline( QVector<QPointF>{ | ||||
| 222 | QPointF( 11.5, 8.5 ), | ||||
| 223 | QPointF( 13.5, 6.5 ), | ||||
| 224 | QPointF( 15.5, 8.5 )} ); | ||||
| 225 | } | ||||
| 226 | | ||||
| 227 | | ||||
| 228 | | ||||
| 229 | } | ||||