Changeset View
Changeset View
Standalone View
Standalone View
kdecoration/breezebutton.cpp
Show First 20 Lines • Show All 200 Lines • ▼ Show 20 Line(s) | 193 | { | |||
---|---|---|---|---|---|
201 | 201 | | |||
202 | case DecorationButtonType::Maximize: | 202 | case DecorationButtonType::Maximize: | ||
203 | { | 203 | { | ||
204 | if( isChecked() ) | 204 | if( isChecked() ) | ||
205 | { | 205 | { | ||
206 | pen.setJoinStyle( Qt::RoundJoin ); | 206 | pen.setJoinStyle( Qt::RoundJoin ); | ||
207 | painter->setPen( pen ); | 207 | painter->setPen( pen ); | ||
208 | 208 | | |||
209 | painter->drawPolygon( QPolygonF() | 209 | painter->drawPolygon( QVector<QPointF>{ | ||
210 | << QPointF( 4, 9 ) | 210 | QPointF( 4, 9 ), | ||
211 | << QPointF( 9, 4 ) | 211 | QPointF( 9, 4 ), | ||
212 | << QPointF( 14, 9 ) | 212 | QPointF( 14, 9 ), | ||
213 | << QPointF( 9, 14 ) ); | 213 | QPointF( 9, 14 )} ); | ||
214 | 214 | | |||
215 | } else { | 215 | } else { | ||
216 | painter->drawPolyline( QPolygonF() | 216 | painter->drawPolyline( QVector<QPointF>{ | ||
217 | << QPointF( 4, 11 ) | 217 | QPointF( 4, 11 ), | ||
218 | << QPointF( 9, 6 ) | 218 | QPointF( 9, 6 ), | ||
219 | << QPointF( 14, 11 ) ); | 219 | QPointF( 14, 11 )}); | ||
220 | } | 220 | } | ||
221 | break; | 221 | break; | ||
222 | } | 222 | } | ||
223 | 223 | | |||
224 | case DecorationButtonType::Minimize: | 224 | case DecorationButtonType::Minimize: | ||
225 | { | 225 | { | ||
226 | painter->drawPolyline( QPolygonF() | 226 | painter->drawPolyline( QVector<QPointF>{ | ||
227 | << QPointF( 4, 7 ) | 227 | QPointF( 4, 7 ), | ||
228 | << QPointF( 9, 12 ) | 228 | QPointF( 9, 12 ), | ||
229 | << QPointF( 14, 7 ) ); | 229 | QPointF( 14, 7 ) }); | ||
230 | break; | 230 | break; | ||
231 | } | 231 | } | ||
232 | 232 | | |||
233 | case DecorationButtonType::OnAllDesktops: | 233 | case DecorationButtonType::OnAllDesktops: | ||
234 | { | 234 | { | ||
235 | painter->setPen( Qt::NoPen ); | 235 | painter->setPen( Qt::NoPen ); | ||
236 | painter->setBrush( foregroundColor ); | 236 | painter->setBrush( foregroundColor ); | ||
237 | 237 | | |||
Show All 11 Lines | 239 | { | |||
249 | if( backgroundColor.isValid() ) | 249 | if( backgroundColor.isValid() ) | ||
250 | { | 250 | { | ||
251 | painter->setBrush( backgroundColor ); | 251 | painter->setBrush( backgroundColor ); | ||
252 | painter->drawEllipse( QRectF( 8, 8, 2, 2 ) ); | 252 | painter->drawEllipse( QRectF( 8, 8, 2, 2 ) ); | ||
253 | } | 253 | } | ||
254 | 254 | | |||
255 | } else { | 255 | } else { | ||
256 | 256 | | |||
257 | painter->drawPolygon( QPolygonF() | 257 | painter->drawPolygon( QVector<QPointF> { | ||
258 | << QPointF( 6.5, 8.5 ) | 258 | QPointF( 6.5, 8.5 ), | ||
259 | << QPointF( 12, 3 ) | 259 | QPointF( 12, 3 ), | ||
260 | << QPointF( 15, 6 ) | 260 | QPointF( 15, 6 ), | ||
261 | << QPointF( 9.5, 11.5 ) ); | 261 | QPointF( 9.5, 11.5 )} ); | ||
262 | 262 | | |||
263 | painter->setPen( pen ); | 263 | painter->setPen( pen ); | ||
264 | painter->drawLine( QPointF( 5.5, 7.5 ), QPointF( 10.5, 12.5 ) ); | 264 | painter->drawLine( QPointF( 5.5, 7.5 ), QPointF( 10.5, 12.5 ) ); | ||
265 | painter->drawLine( QPointF( 12, 6 ), QPointF( 4.5, 13.5 ) ); | 265 | painter->drawLine( QPointF( 12, 6 ), QPointF( 4.5, 13.5 ) ); | ||
266 | } | 266 | } | ||
267 | break; | 267 | break; | ||
268 | } | 268 | } | ||
269 | 269 | | |||
270 | case DecorationButtonType::Shade: | 270 | case DecorationButtonType::Shade: | ||
271 | { | 271 | { | ||
272 | 272 | | |||
273 | if (isChecked()) | 273 | if (isChecked()) | ||
274 | { | 274 | { | ||
275 | 275 | | |||
276 | painter->drawLine( 4, 5, 14, 5 ); | 276 | painter->drawLine( 4, 5, 14, 5 ); | ||
277 | painter->drawPolyline( QPolygonF() | 277 | painter->drawPolyline( QVector<QPointF> { | ||
278 | << QPointF( 4, 8 ) | 278 | QPointF( 4, 8 ), | ||
279 | << QPointF( 9, 13 ) | 279 | QPointF( 9, 13 ), | ||
280 | << QPointF( 14, 8 ) ); | 280 | QPointF( 14, 8 )} ); | ||
281 | 281 | | |||
282 | } else { | 282 | } else { | ||
283 | 283 | | |||
284 | painter->drawLine( 4, 5, 14, 5 ); | 284 | painter->drawLine( 4, 5, 14, 5 ); | ||
285 | painter->drawPolyline( QPolygonF() | 285 | painter->drawPolyline( QVector<QPointF> { | ||
286 | << QPointF( 4, 13 ) | 286 | QPointF( 4, 13 ), | ||
287 | << QPointF( 9, 8 ) | 287 | QPointF( 9, 8 ), | ||
288 | << QPointF( 14, 13 ) ); | 288 | QPointF( 14, 13 ) }); | ||
289 | } | 289 | } | ||
290 | 290 | | |||
291 | break; | 291 | break; | ||
292 | 292 | | |||
293 | } | 293 | } | ||
294 | 294 | | |||
295 | case DecorationButtonType::KeepBelow: | 295 | case DecorationButtonType::KeepBelow: | ||
296 | { | 296 | { | ||
297 | 297 | | |||
298 | painter->drawPolyline( QPolygonF() | 298 | painter->drawPolyline( QVector<QPointF> { | ||
299 | << QPointF( 4, 5 ) | 299 | QPointF( 4, 5 ), | ||
300 | << QPointF( 9, 10 ) | 300 | QPointF( 9, 10 ), | ||
301 | << QPointF( 14, 5 ) ); | 301 | QPointF( 14, 5 ) }); | ||
302 | 302 | | |||
303 | painter->drawPolyline( QPolygonF() | 303 | painter->drawPolyline( QVector<QPointF> { | ||
304 | << QPointF( 4, 9 ) | 304 | QPointF( 4, 9 ), | ||
305 | << QPointF( 9, 14 ) | 305 | QPointF( 9, 14 ), | ||
306 | << QPointF( 14, 9 ) ); | 306 | QPointF( 14, 9 ) }); | ||
307 | break; | 307 | break; | ||
308 | 308 | | |||
309 | } | 309 | } | ||
310 | 310 | | |||
311 | case DecorationButtonType::KeepAbove: | 311 | case DecorationButtonType::KeepAbove: | ||
312 | { | 312 | { | ||
313 | painter->drawPolyline( QPolygonF() | 313 | painter->drawPolyline( QVector<QPointF> { | ||
314 | << QPointF( 4, 9 ) | 314 | QPointF( 4, 9 ), | ||
315 | << QPointF( 9, 4 ) | 315 | QPointF( 9, 4 ), | ||
316 | << QPointF( 14, 9 ) ); | 316 | QPointF( 14, 9 ) }); | ||
317 | 317 | | |||
318 | painter->drawPolyline( QPolygonF() | 318 | painter->drawPolyline( QVector<QPointF> { | ||
319 | << QPointF( 4, 13 ) | 319 | QPointF( 4, 13 ), | ||
320 | << QPointF( 9, 8 ) | 320 | QPointF( 9, 8 ), | ||
321 | << QPointF( 14, 13 ) ); | 321 | QPointF( 14, 13 ) }); | ||
322 | break; | 322 | break; | ||
323 | } | 323 | } | ||
324 | 324 | | |||
325 | 325 | | |||
326 | case DecorationButtonType::ApplicationMenu: | 326 | case DecorationButtonType::ApplicationMenu: | ||
327 | { | 327 | { | ||
328 | painter->drawLine( QPointF( 3.5, 5 ), QPointF( 14.5, 5 ) ); | 328 | painter->drawLine( QPointF( 3.5, 5 ), QPointF( 14.5, 5 ) ); | ||
329 | painter->drawLine( QPointF( 3.5, 9 ), QPointF( 14.5, 9 ) ); | 329 | painter->drawLine( QPointF( 3.5, 9 ), QPointF( 14.5, 9 ) ); | ||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |