1 /********************************************************************
4 Copyright (c) 2005 Sandro Giessl <sandro@giessl.com>
5 Port of this decoration to KDE 3.2, accessibility enhancement are
6 Copyright (c) 2003 Luciano Montanaro <mikelima@cirulla.net>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *********************************************************************/
22 #include <kconfig.h> // up here to avoid X11 header conflict :P
23 #include "laptopclient.h"
25 #include <QPaintEvent>
33 static const unsigned char iconify_bits
[] = {
34 0xff, 0xff, 0x00, 0xff, 0xff, 0x7e, 0x3c, 0x18};
36 static const unsigned char close_bits
[] = {
37 0x42, 0xe7, 0x7e, 0x3c, 0x3c, 0x7e, 0xe7, 0x42};
39 static const unsigned char maximize_bits
[] = {
40 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x00, 0xff, 0xff };
42 static const unsigned char r_minmax_bits
[] = {
43 0x0c, 0x18, 0x33, 0x67, 0xcf, 0x9f, 0x3f, 0x3f};
45 static const unsigned char l_minmax_bits
[] = {
46 0x30, 0x18, 0xcc, 0xe6, 0xf3, 0xf9, 0xfc, 0xfc};
48 static const unsigned char question_bits
[] = {
49 0x3c, 0x66, 0x60, 0x30, 0x18, 0x00, 0x18, 0x18};
51 static const unsigned char unsticky_bits
[] = {
52 0x3c, 0x42, 0x99, 0xbd, 0xbd, 0x99, 0x42, 0x3c};
54 static const unsigned char sticky_bits
[] = {
55 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
57 static QPixmap
*titlePix
;
58 static QPixmap
*aUpperGradient
;
59 static QPixmap
*iUpperGradient
;
60 // buttons active, inactive, up, down, and 2 sizes :P
61 static QPixmap
*btnPix1
;
62 static QPixmap
*iBtnPix1
;
63 static QPixmap
*btnDownPix1
;
64 static QPixmap
*iBtnDownPix1
;
65 static QPixmap
*btnPix2
;
66 static QPixmap
*btnDownPix2
;
67 static QPixmap
*iBtnPix2
;
68 static QPixmap
*iBtnDownPix2
;
69 static QColor btnForeground
;
71 static int titleHeight
= 14;
72 static int btnWidth1
= 17;
73 static int btnWidth2
= 27;
75 static int handleSize
= 8; // the resize handle size in pixels
77 static bool pixmaps_created
= false;
79 // =====================================
81 extern "C" KDE_EXPORT KDecorationFactory
* create_factory()
83 return new Laptop::LaptopClientFactory();
86 // =====================================
88 static inline const KDecorationOptions
* options()
90 return KDecoration::options();
93 static void gradientFill(QPixmap
*pixmap
, const QColor
&color1
, const QColor
&color2
, bool diagonal
= false)
96 QLinearGradient
gradient(0, 0, diagonal
? pixmap
->width() : 0, pixmap
->height());
97 gradient
.setColorAt(0.0, color1
);
98 gradient
.setColorAt(1.0, color2
);
99 QBrush
brush(gradient
);
100 p
.fillRect(pixmap
->rect(), brush
);
103 static void drawButtonFrame(QPixmap
*pix
, const QPalette
&g
, bool sunken
)
106 int w
= pix
->width();
107 int h
= pix
->height();
113 qDrawShadePanel(&p
, 0, 0, w
, h
, g
, true, 2);
116 p
.setPen(g
.color(QPalette::Dark
));
117 p
.drawRect(0, 0, w
-1, h
-1);
118 p
.setPen(g
.color(QPalette::Light
));
119 p
.drawLine(x2
, 0, x2
, y2
);
120 p
.drawLine(0, y2
, x2
, y2
);
121 p
.drawLine(1, 1, x2
-2, 1);
122 p
.drawLine(1, 1, 1, y2
-2);
127 static void create_pixmaps()
131 pixmaps_created
= true;
133 titleHeight
= QFontMetrics(options()->font(true)).height();
134 if (titleHeight
< handleSize
) titleHeight
= handleSize
;
135 titleHeight
&= ~1; // Make title height even
136 if (titleHeight
< 14) titleHeight
= 14;
138 btnWidth1
= titleHeight
+ 3;
139 btnWidth2
= 3*titleHeight
/2 + 6;
143 QPainter maskPainter
;
145 titlePix
= new QPixmap(33, 12);
146 QBitmap
mask(33, 12);
147 mask
.fill(Qt::color0
);
150 maskPainter
.begin(&mask
);
151 maskPainter
.setPen(Qt::color1
);
152 for(i
=0, y
=2; i
< 3; ++i
, y
+=4){
153 for(x
=1; x
<= 33; x
+=3){
154 p
.setPen(options()->color(KDecoration::ColorTitleBar
, true).light(150));
156 maskPainter
.drawPoint(x
, y
);
157 p
.setPen(options()->color(KDecoration::ColorTitleBar
, true).dark(150));
158 p
.drawPoint(x
+1, y
+1);
159 maskPainter
.drawPoint(x
+1, y
+1);
164 titlePix
->setMask(mask
);
166 if(QPixmap::defaultDepth() > 8){
167 aUpperGradient
= new QPixmap(32, titleHeight
+2);
168 iUpperGradient
= new QPixmap(32, titleHeight
+2);
169 QColor bgColor
= options()->color(KDecoration::ColorTitleBar
, true);
170 gradientFill(aUpperGradient
, bgColor
.light(120), bgColor
.dark(120));
171 bgColor
= options()->color(KDecoration::ColorTitleBar
, false);
172 gradientFill(iUpperGradient
, bgColor
.light(120), bgColor
.dark(120));
174 // buttons (active/inactive, sunken/unsunken, 2 sizes each)
175 QPalette g
= options()->palette(KDecoration::ColorButtonBg
, true);
176 g
.setCurrentColorGroup( QPalette::Active
);
177 QColor c
= g
.color( QPalette::Background
);
178 btnPix1
= new QPixmap(btnWidth1
, titleHeight
);
179 btnDownPix1
= new QPixmap(btnWidth1
, titleHeight
);
180 btnPix2
= new QPixmap(btnWidth2
, titleHeight
);
181 btnDownPix2
= new QPixmap(btnWidth2
, titleHeight
);
182 iBtnPix1
= new QPixmap(btnWidth1
, titleHeight
);
183 iBtnDownPix1
= new QPixmap(btnWidth1
, titleHeight
);
184 iBtnPix2
= new QPixmap(btnWidth2
, titleHeight
);
185 iBtnDownPix2
= new QPixmap(btnWidth2
, titleHeight
);
186 if(QPixmap::defaultDepth() > 8){
187 gradientFill(btnPix1
, c
.light(120), c
.dark(130), true);
188 gradientFill(btnPix2
, c
.light(120), c
.dark(130), true);
189 gradientFill(btnDownPix1
, c
.light(120), c
.dark(130), true);
190 gradientFill(btnDownPix2
, c
.light(120), c
.dark(130), true);
191 g
= options()->palette(KDecoration::ColorButtonBg
, false);
192 g
.setCurrentColorGroup( QPalette::Active
);
193 c
= g
.color(QPalette::Background
);
194 gradientFill(iBtnPix1
, c
.light(120), c
.dark(130), true);
195 gradientFill(iBtnPix2
, c
.light(120), c
.dark(130), true);
196 gradientFill(iBtnDownPix1
, c
.light(120), c
.dark(130), true);
197 gradientFill(iBtnDownPix2
, c
.light(120), c
.dark(130), true);
200 btnPix1
->fill(c
.rgb());
201 btnDownPix1
->fill(c
.rgb());
202 btnPix2
->fill(c
.rgb());
203 btnDownPix2
->fill(c
.rgb());
204 g
= options()->palette(KDecoration::ColorButtonBg
, false);
205 g
.setCurrentColorGroup( QPalette::Active
);
206 c
= g
.background().color();
207 iBtnPix1
->fill(c
.rgb());
208 iBtnDownPix1
->fill(c
.rgb());
209 iBtnPix2
->fill(c
.rgb());
210 iBtnDownPix2
->fill(c
.rgb());
212 g
= options()->palette(KDecoration::ColorButtonBg
, true);
213 g
.setCurrentColorGroup( QPalette::Active
);
214 c
= g
.background().color();
215 drawButtonFrame(btnPix1
, g
, false);
216 drawButtonFrame(btnDownPix1
, g
, true);
217 drawButtonFrame(btnPix2
, g
, false);
218 drawButtonFrame(btnDownPix2
, g
, true);
219 g
= options()->palette(KDecoration::ColorButtonBg
, false);
220 g
.setCurrentColorGroup( QPalette::Active
);
221 c
= g
.background().color();
222 drawButtonFrame(iBtnPix1
, g
, false);
223 drawButtonFrame(iBtnDownPix1
, g
, true);
224 drawButtonFrame(iBtnPix2
, g
, false);
225 drawButtonFrame(iBtnDownPix2
, g
, true);
227 if(qGray(options()->color(KDecoration::ColorButtonBg
, true).rgb()) > 128)
228 btnForeground
= Qt::black
;
230 btnForeground
= Qt::white
;
233 static void delete_pixmaps()
237 delete aUpperGradient
;
238 delete iUpperGradient
;
248 pixmaps_created
= false;
251 // =====================================
253 LaptopButton::LaptopButton(ButtonType type
, LaptopClient
*parent
, const char *name
)
254 : KCommonDecorationButton(type
, parent
)
256 setAttribute(Qt::WA_NoSystemBackground
, true);
259 void LaptopButton::reset(unsigned long changed
)
261 if (changed
&DecorationReset
|| changed
&ManualReset
|| changed
&SizeChange
|| changed
&StateChange
) {
264 setBitmap(close_bits
);
267 setBitmap(question_bits
);
270 setBitmap(iconify_bits
);
274 setBitmap(isLeft() ? l_minmax_bits
: r_minmax_bits
);
276 setBitmap(maximize_bits
);
279 case OnAllDesktopsButton
:
280 setBitmap( isChecked() ? unsticky_bits
: sticky_bits
);
291 void LaptopButton::setBitmap(const unsigned char *bitmap
)
294 deco
= QBitmap::fromData( QSize(8, 8), bitmap
);
297 deco
.fill(Qt::color0
);
303 void LaptopButton::paintEvent(QPaintEvent
*)
309 void LaptopButton::drawButton(QPainter
*p
)
311 bool smallBtn
= width() == btnWidth1
;
313 if(decoration()->isActive()){
315 p
->drawPixmap(0, 0, smallBtn
? *btnDownPix1
: *btnDownPix2
);
317 p
->drawPixmap(0, 0, smallBtn
? *btnPix1
: *btnPix2
);
321 p
->drawPixmap(0, 0, smallBtn
? *iBtnDownPix1
: *iBtnDownPix2
);
323 p
->drawPixmap(0, 0, smallBtn
? *iBtnPix1
: *iBtnPix2
);
327 QPalette g
= options()->palette(KDecoration::ColorButtonBg
, decoration()->isActive());
328 g
.setCurrentColorGroup( QPalette::Active
);
331 p
->fillRect(1, 1, w
-2, h
-2, isDown() ? g
.color(QPalette::Mid
) : g
.color(QPalette::Button
) );
332 p
->setPen(isDown() ? g
.color( QPalette::Dark
) : g
.color( QPalette::Light
));
333 p
->drawLine(0, 0, w
-1, 0);
334 p
->drawLine(0, 0, 0, w
-1);
335 p
->setPen(isDown() ? g
.color( QPalette::Light
) : g
.color( QPalette::Dark
));
336 p
->drawLine(w
-1, 0, w
-1, h
-1);
337 p
->drawLine(0, h
-1, w
-1, h
-1);
340 p
->setPen(btnForeground
);
341 int xOff
= (width()-8)/2;
342 int yOff
= (height()-8)/2;
343 p
->drawPixmap(isDown() ? xOff
+1: xOff
, isDown() ? yOff
+1 : yOff
, deco
);
346 // =====================================
348 void LaptopClient::reset(unsigned long changed
)
350 KCommonDecoration::reset(changed
);
353 LaptopClient::LaptopClient(KDecorationBridge
*b
, KDecorationFactory
*f
)
354 : KCommonDecoration(b
, f
)
358 LaptopClient::~LaptopClient()
362 QString
LaptopClient::visibleName() const
364 return i18n("Laptop");
367 QString
LaptopClient::defaultButtonsLeft() const
372 QString
LaptopClient::defaultButtonsRight() const
377 bool LaptopClient::decorationBehaviour(DecorationBehaviour behaviour
) const
390 return KCommonDecoration::decorationBehaviour(behaviour
);
394 int LaptopClient::layoutMetric(LayoutMetric lm
, bool respectWindowState
, const KCommonDecorationButton
*btn
) const
397 case LM_TitleEdgeLeft
:
398 case LM_TitleEdgeRight
:
403 case LM_BorderBottom
:
404 return mustDrawHandle() ? handleSize
: 4;
406 case LM_TitleEdgeTop
:
409 case LM_TitleEdgeBottom
:
412 case LM_TitleBorderLeft
:
413 case LM_TitleBorderRight
:
418 if (btn
&& (btn
->type()==HelpButton
||btn
->type()==OnAllDesktopsButton
) ) {
425 case LM_ButtonHeight
:
428 return titleHeight
-2;
432 case LM_ButtonSpacing
:
436 return KCommonDecoration::layoutMetric(lm
, respectWindowState
, btn
);
440 KCommonDecorationButton
*LaptopClient::createButton(ButtonType type
)
443 case OnAllDesktopsButton
:
444 return new LaptopButton(OnAllDesktopsButton
, this, "on_all_desktops");
447 return new LaptopButton(HelpButton
, this, "help");
450 return new LaptopButton(MinButton
, this, "minimize");
453 return new LaptopButton(MaxButton
, this, "maximize");
456 return new LaptopButton(CloseButton
, this, "close");
463 void LaptopClient::init()
467 KCommonDecoration::init();
470 void LaptopClient::captionChange()
474 KCommonDecoration::captionChange();
477 void LaptopClient::paintEvent( QPaintEvent
* )
479 QPainter
p(widget());
480 QPalette g
= options()->palette(KDecoration::ColorFrame
, isActive());
481 g
.setCurrentColorGroup( QPalette::Active
);
483 QRect
r(widget()->rect());
485 p
.drawRect(r
.adjusted(0, 0, -1, -1));
488 p
.setPen(g
.background().color());
489 p
.drawLine(r
.x()+2, r
.y()+2, r
.right()-2, r
.y()+2);
490 p
.drawLine(r
.left()+2, r
.y()+3, r
.left()+2, r
.bottom()-layoutMetric(LM_BorderBottom
)+1);
491 p
.drawLine(r
.right()-2, r
.y()+3, r
.right()-2, r
.bottom()-layoutMetric(LM_BorderBottom
)+1);
492 p
.drawLine(r
.left()+3, r
.y()+3, r
.left()+3, r
.y()+layoutMetric(LM_TitleEdgeTop
)+layoutMetric(LM_TitleHeight
)+layoutMetric(LM_TitleEdgeTop
) );
493 p
.drawLine(r
.right()-3, r
.y()+3, r
.right()-3, r
.y()+layoutMetric(LM_TitleEdgeTop
)+layoutMetric(LM_TitleHeight
)+layoutMetric(LM_TitleEdgeTop
) );
494 if (!mustDrawHandle() )
495 p
.drawLine(r
.left()+1, r
.bottom()-2, r
.right()-1, r
.bottom()-2);
498 p
.setPen(g
.color(QPalette::Light
));
499 p
.drawLine(r
.x()+1, r
.y()+1, r
.right()-1, r
.y()+1);
500 p
.drawLine(r
.x()+1, r
.y()+1, r
.x()+1, r
.bottom()-1);
501 p
.setPen(g
.dark().color());
502 p
.drawLine(r
.right()-1, r
.y()+1, r
.right()-1, r
.bottom()-1);
503 p
.drawLine(r
.x()+1, r
.bottom()-1, r
.right()-1, r
.bottom()-1);
505 int th
= titleHeight
;
506 int bb
= handleSize
+ 2; // Bottom border
507 int bs
= handleSize
- 2; // inner size of bottom border
508 if (!mustDrawHandle()) {
512 if ( isToolWindow() )
516 p
.drawRect(r
.x() + 3, r
.y() + th
+ 3, r
.width() - 7, r
.height() - th
- bb
- 1);
519 if (mustDrawHandle()) {
520 if (r
.width() > 3*handleSize
+ 20) {
521 int range
= 8 + 3*handleSize
/2;
522 qDrawShadePanel(&p
, r
.x() + 1, r
.bottom() - bs
, range
,
523 handleSize
- 2, g
, false, 1, &g
.brush(QPalette::Mid
));
524 qDrawShadePanel(&p
, r
.x() + range
+ 1, r
.bottom() - bs
,
525 r
.width() - 2*range
- 2, handleSize
- 2, g
, false, 1,
526 isActive() ? &g
.brush(QPalette::Background
) :
527 &g
.brush(QPalette::Mid
));
528 qDrawShadePanel(&p
, r
.right() - range
, r
.bottom() - bs
,
529 range
, bs
, g
, false, 1, &g
.brush(QPalette::Mid
));
531 qDrawShadePanel(&p
, r
.x() + 1, r
.bottom() - bs
,
532 r
.width() - 2, bs
, g
, false, 1,
533 isActive() ? &g
.brush(QPalette::Background
) :
534 &g
.brush(QPalette::Mid
));
541 updateActiveBuffer();
542 p
.drawPixmap(r
.x(), r
.y(), activeBuffer
);
543 p
.setPen(g
.background().color());
544 p
.drawPoint(r
.x(), r
.y());
545 p
.drawPoint(r
.right(), r
.y());
546 p
.drawLine(r
.right()+1, r
.y(), r
.right()+1, r
.bottom());
550 p
.drawTiledPixmap(r
.x(), r
.y(), r
.width(), r
.height()-1,
553 p
.fillRect(r
.x(), r
.y(), r
.width(), r
.height()-1,
554 options()->color(KDecoration::ColorTitleBar
, false));
556 p
.setFont(options()->font(false, isToolWindow() ));
557 QFontMetrics
fm(options()->font(false));
558 g
= options()->palette(KDecoration::ColorTitleBar
, false);
559 g
.setCurrentColorGroup( QPalette::Active
);
561 p
.drawTiledPixmap(r
.x()+((r
.width()-fm
.width(caption()))/2)-4,
562 r
.y(), fm
.width(caption())+8, r
.height()-1,
565 p
.fillRect(r
.x()+((r
.width()-fm
.width(caption()))/2)-4, r
.y(),
566 fm
.width(caption())+8, r
.height()-1,
567 g
.brush(QPalette::Background
));
568 p
.setPen(g
.mid().color());
569 p
.drawLine(r
.x(), r
.y(), r
.right(), r
.y());
570 p
.drawLine(r
.x(), r
.y(), r
.x(), r
.bottom());
571 p
.setPen(g
.color(QPalette::Button
));
572 p
.drawLine(r
.right(), r
.y(), r
.right(), r
.bottom());
573 p
.drawLine(r
.x(), r
.bottom(), r
.right(), r
.bottom());
574 p
.setPen(options()->color(KDecoration::ColorFont
, false));
575 p
.drawText(r
.x(), r
.y()+1, r
.width(), r
.height()-1,
576 Qt::AlignCenter
, caption() );
577 g
= options()->palette(KDecoration::ColorFrame
, true);
578 g
.setCurrentColorGroup( QPalette::Active
);
579 p
.setPen(g
.background().color());
580 p
.drawPoint(r
.x(), r
.y());
581 p
.drawPoint(r
.right(), r
.y());
582 p
.drawLine(r
.right()+1, r
.y(), r
.right()+1, r
.bottom());
586 QRegion
LaptopClient::cornerShape(WindowCorner corner
)
590 return QRect(0, 0, 1, 1);
593 return QRect(width()-1, 0, 1, 1);
596 return QRect(0, height()-1, 1, 1);
599 return QRect(width()-1, height()-1, 1, 1);
607 bool LaptopClient::mustDrawHandle() const
609 bool drawSmallBorders
= !options()->moveResizeMaximizedWindows();
610 if (drawSmallBorders
&& (maximizeMode() & MaximizeVertical
)) {
613 return isResizable();
617 void LaptopClient::updateActiveBuffer( )
619 QRect rTitle
= titleRect();
620 if( !bufferDirty
&& (lastBufferWidth
== rTitle
.width()))
622 if ( rTitle
.width() <= 0 || rTitle
.height() <= 0 )
624 lastBufferWidth
= rTitle
.width();
627 activeBuffer
= QPixmap(rTitle
.width(), rTitle
.height());
629 QRect
r(0, 0, activeBuffer
.width(), activeBuffer
.height());
630 p
.begin(&activeBuffer
);
632 p
.drawTiledPixmap(r
, *aUpperGradient
);
635 p
.fillRect(r
, options()->color(KDecoration::ColorTitleBar
, true));
638 p
.drawTiledPixmap(r
, *titlePix
);
640 p
.setFont(options()->font(true, isToolWindow() ));
641 QFontMetrics
fm(options()->font(true));
642 QPalette g
= options()->palette(KDecoration::ColorTitleBar
, true);
643 g
.setCurrentColorGroup( QPalette::Active
);
645 p
.drawTiledPixmap(r
.x()+((r
.width()-fm
.width(caption()))/2)-4,
646 r
.y(), fm
.width(caption())+8, r
.height()-1,
649 p
.fillRect(r
.x()+((r
.width()-fm
.width(caption()))/2)-4, 0,
650 fm
.width(caption())+8, r
.height(),
651 g
.brush(QPalette::Background
));
652 p
.setPen(g
.mid().color());
653 p
.drawLine(r
.x(), r
.y(), r
.right(), r
.y());
654 p
.drawLine(r
.x(), r
.y(), r
.x(), r
.bottom());
655 p
.setPen(g
.color(QPalette::Button
));
656 p
.drawLine(r
.right(), r
.y(), r
.right(), r
.bottom());
657 p
.drawLine(r
.x(), r
.bottom(), r
.right(), r
.bottom());
658 p
.setPen(options()->color(KDecoration::ColorFont
, true));
659 p
.drawText(r
.x(), r
.y()+1, r
.width(), r
.height()-1,
660 Qt::AlignCenter
, caption() );
661 g
= options()->palette(KDecoration::ColorFrame
, true);
662 g
.setCurrentColorGroup( QPalette::Active
);
663 p
.setPen(g
.background().color());
664 p
.drawPoint(r
.x(), r
.y());
665 p
.drawPoint(r
.right(), r
.y());
666 p
.drawLine(r
.right()+1, r
.y(), r
.right()+1, r
.bottom());
670 static const int SUPPORTED_WINDOW_TYPES_MASK
= NET::NormalMask
|
671 NET::DesktopMask
| NET::DockMask
| NET::ToolbarMask
| NET::MenuMask
|
672 NET::DialogMask
| /*NET::OverrideMask |*/ NET::TopMenuMask
|
673 NET::UtilityMask
| NET::SplashMask
;
675 bool LaptopClient::isTransient() const
677 NET::WindowType type
= windowType(SUPPORTED_WINDOW_TYPES_MASK
);
678 return type
== NET::Dialog
;
681 // =====================================
683 LaptopClientFactory::LaptopClientFactory()
688 LaptopClientFactory::~LaptopClientFactory()
693 KDecoration
*LaptopClientFactory::createDecoration(KDecorationBridge
*b
)
695 findPreferredHandleSize();
696 return (new Laptop::LaptopClient(b
, this))->decoration();
699 bool LaptopClientFactory::reset(unsigned long changed
)
701 findPreferredHandleSize();
703 // TODO Do not recreate decorations if it is not needed. Look at
704 // ModernSystem for how to do that
705 Laptop::delete_pixmaps();
706 Laptop::create_pixmaps();
708 bool needHardReset
= true;
709 if ((changed
& ~SettingButtons
) == 0) {
710 // handled by KCommonDecoration
711 needHardReset
= false;
717 resetDecorations(changed
);
722 bool LaptopClientFactory::supports( Ability ability
) const
727 case AbilityAnnounceButtons
:
728 case AbilityAnnounceColors
:
730 case AbilityButtonOnAllDesktops
:
731 case AbilityButtonHelp
:
732 case AbilityButtonMinimize
:
733 case AbilityButtonMaximize
:
734 case AbilityButtonClose
:
735 case AbilityButtonSpacer
:
737 case AbilityColorTitleBack
:
738 case AbilityColorTitleFore
:
739 case AbilityColorButtonBack
:
746 QList
< LaptopClientFactory::BorderSize
>
747 LaptopClientFactory::borderSizes() const
749 // the list must be sorted
750 return QList
< BorderSize
>() << BorderNormal
<< BorderLarge
<<
751 BorderVeryLarge
<< BorderHuge
<< BorderVeryHuge
<< BorderOversized
;
754 void LaptopClientFactory::findPreferredHandleSize()
756 switch (options()->preferredBorderSize(this)) {
757 case KDecoration::BorderLarge
:
760 case KDecoration::BorderVeryLarge
:
763 case KDecoration::BorderHuge
:
766 case KDecoration::BorderVeryHuge
:
769 case KDecoration::BorderOversized
:
772 case KDecoration::BorderTiny
:
773 case KDecoration::BorderNormal
:
779 } // Laptop namespace