2 Copyright (C) 1999 Daniel M. Duley <mosfet@kde.org>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 // Daniel M. DULEY <mosfet@kde.org> original work
21 // Melchior FRANZ <a8603365@unet.univie.ac.at> configuration options
23 #include "modernsys.h"
25 #include <kconfiggroup.h>
29 #include <QtGui/qdrawutil.h>
32 #include <QPaintEvent>
36 #include <QApplication>
39 #include "buttondata.h"
40 #include "btnhighcolor.h"
43 namespace ModernSystem
{
45 static unsigned char iconify_bits
[] = {
46 0x00, 0x00, 0xff, 0xff, 0x7e, 0x3c, 0x18, 0x00};
48 static unsigned char close_bits
[] = {
49 0x00, 0x66, 0x7e, 0x3c, 0x3c, 0x7e, 0x66, 0x00};
51 static unsigned char maximize_bits
[] = {
52 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x00, 0x00};
54 static unsigned char r_minmax_bits
[] = {
55 0x0c, 0x18, 0x33, 0x67, 0xcf, 0x9f, 0x3f, 0x3f};
57 static unsigned char l_minmax_bits
[] = {
58 0x30, 0x18, 0xcc, 0xe6, 0xf3, 0xf9, 0xfc, 0xfc};
60 static unsigned char unsticky_bits
[] = {
61 0x3c, 0x42, 0x99, 0xbd, 0xbd, 0x99, 0x42, 0x3c};
63 static unsigned char sticky_bits
[] = {
64 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
66 static unsigned char question_bits
[] = {
67 0x3c, 0x66, 0x60, 0x30, 0x18, 0x00, 0x18, 0x18};
69 static unsigned char above_on_bits
[] = {
70 0x7e, 0x00, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00};
72 static unsigned char above_off_bits
[] = {
73 0x18, 0x3c, 0x7e, 0x00, 0x7e, 0x00, 0x00, 0x00};
75 static unsigned char below_off_bits
[] = {
76 0x00, 0x00, 0x00, 0x7e, 0x00, 0x7e, 0x3c, 0x18};
78 static unsigned char below_on_bits
[] = {
79 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x00, 0x7e};
81 static unsigned char shade_off_bits
[] = {
82 0x00, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00};
84 static unsigned char shade_on_bits
[] = {
85 0x00, 0x7e, 0x7e, 0x42, 0x42, 0x42, 0x7e, 0x00};
87 static unsigned char menu_bits
[] = {
88 0xff, 0x81, 0x81, 0xff, 0x81, 0xff, 0x81, 0xff};
90 static unsigned char btnhighcolor_mask_bits
[] = {
91 0xe0,0x41,0xf8,0x07,0xfc,0x0f,0xfe,0xdf,0xfe,0x1f,0xff,0x3f,0xff,0xff,0xff,
92 0x3f,0xff,0x3f,0xff,0xff,0xff,0xff,0xfe,0x9f,0xfe,0x1f,0xfc,0x0f,0xf0,0x03,
93 0x00,0x40,0x80,0x00,0x00,0x00,0x39,0x00,0x00,0x00,0x20,0x99,0x0f,0x08,0xc4,
94 0x00,0x00,0x00,0x67,0x00,0x00,0x00,0x58,0x5f,0x43,0x68,0x61,0x6e,0x67,0x65 };
96 static QPixmap
*aUpperGradient
=0;
97 static QPixmap
*iUpperGradient
=0;
98 static QPixmap
*buttonPix
=0;
99 static QPixmap
*buttonPixDown
=0;
100 static QPixmap
*iButtonPix
=0;
101 static QPixmap
*iButtonPixDown
=0;
103 static QColor
*buttonFg
;
104 static bool pixmaps_created
= false;
106 static QBitmap
*lcDark1
;
107 static QBitmap
*lcDark2
;
108 static QBitmap
*lcDark3
;
109 static QBitmap
*lcLight1
;
110 static QImage
*btnSource
;
112 static bool show_handle
;
113 static int handle_size
;
114 static int handle_width
;
115 static int border_width
;
116 static int title_height
;
118 static inline const KDecorationOptions
* options()
120 return KDecoration::options();
123 static void make_button_fx(const QPalette
&g
, QPixmap
*pix
, bool light
=false)
125 pix
->fill(g
.background().color());
128 if(QPixmap::defaultDepth() > 8){
129 int i
, destH
, destS
, destV
, srcH
, srcS
, srcV
;
130 QColor btnColor
= g
.background().color();
132 if(btnSource
->depth() < 32)
133 *btnSource
= btnSource
->convertDepth(32);
135 btnColor
= btnColor
.light(120);
136 btnColor
.getHsv(&destH
, &destS
, &destV
);
137 QImage
btnDest(14, 15, 32);
139 unsigned int *srcData
= (unsigned int *)btnSource
->bits();
140 unsigned int *destData
= (unsigned int *)btnDest
.bits();
142 for(i
=0; i
< btnSource
->width()*btnSource
->height(); ++i
){
143 srcColor
.setRgb(srcData
[i
]);
144 srcColor
.getHsv(&srcH
, &srcS
, &srcV
);
145 srcColor
.setHsv(destH
, destS
, srcV
);
146 destData
[i
] = srcColor
.rgb();
148 *pix
= QPixmap::fromImage(btnDest
);
152 if(!lcDark1
->mask()){
153 lcDark1
->setMask(*lcDark1
);
154 lcDark2
->setMask(*lcDark2
);
155 lcDark3
->setMask(*lcDark3
);
156 lcLight1
->setMask(*lcLight1
);
158 p
.setPen(g
.dark().color());
159 p
.drawPixmap(0, 0, *lcDark2
);
160 p
.drawPixmap(0, 0, *lcDark1
);
161 p
.setPen(g
.mid().color());
162 p
.drawPixmap(0, 0, *lcDark3
);
163 p
.setPen(g
.light().color());
164 p
.drawPixmap(0, 0, *lcLight1
);
168 static void gradientFill(QPixmap
*pixmap
, const QColor
&color1
, const QColor
&color2
)
171 QLinearGradient
gradient(0, 0, 0, pixmap
->height());
172 gradient
.setColorAt(0.0, color1
);
173 gradient
.setColorAt(1.0, color2
);
174 QBrush
brush(gradient
);
175 p
.fillRect(pixmap
->rect(), brush
);
178 static void create_pixmaps()
182 pixmaps_created
= true;
184 lcDark1
= new QBitmap(14, 15, lowcolor_6a696a_bits
, true);
185 lcDark2
= new QBitmap(14, 15, lowcolor_949194_bits
, true);
186 lcDark3
= new QBitmap(14, 15, lowcolor_b4b6b4_bits
, true);
187 lcLight1
= new QBitmap(14, 15, lowcolor_e6e6e6_bits
, true);
188 btnSource
= new QImage(btnhighcolor_xpm
);
190 if(QPixmap::defaultDepth() > 8){
191 aUpperGradient
= new QPixmap( 32, title_height
+2 );
192 iUpperGradient
= new QPixmap( 32, title_height
+2);;
193 gradientFill(aUpperGradient
,
194 options()->color(KDecoration::ColorTitleBar
, true).light(130),
195 options()->color(KDecoration::ColorTitleBlend
, true));
196 gradientFill(iUpperGradient
,
197 options()->color(KDecoration::ColorTitleBar
, false).light(130),
198 options()->color(KDecoration::ColorTitleBlend
, false));
201 QPalette
btnColor(options()->palette(KDecoration::ColorButtonBg
, true) );
202 btnColor
.setCurrentColorGroup(QPalette::Active
);
203 buttonPix
= new QPixmap(14, 15);
204 make_button_fx(btnColor
, buttonPix
);
205 buttonPixDown
= new QPixmap(14, 15);
206 make_button_fx(btnColor
, buttonPixDown
, true);
208 btnColor
= options()->palette(KDecoration::ColorButtonBg
, false);
209 btnColor
.setCurrentColorGroup(QPalette::Active
);
210 iButtonPix
= new QPixmap(14, 15);
211 make_button_fx(btnColor
, iButtonPix
);
212 iButtonPixDown
= new QPixmap(14, 15);
213 make_button_fx(btnColor
, iButtonPixDown
, true);
216 if(qGray(btnColor
.background().color().rgb()) < 150)
217 buttonFg
= new QColor(Qt::white
);
219 buttonFg
= new QColor(Qt::black
);
228 static void delete_pixmaps()
231 delete aUpperGradient
;
232 delete iUpperGradient
;
235 delete buttonPixDown
;
237 delete iButtonPixDown
;
241 pixmaps_created
= false;
244 static void draw_button(QPainter
&p
, int x
, int y
, int w
, int h
, const QPalette
&pal
)
246 if (w
> 16 && h
> 16){
247 int x2
= x
+w
, y2
= y
+h
;
248 QPen oldPen
= p
.pen();
249 QPolygon hPntArray
, lPntArray
;
250 hPntArray
.putPoints(0, 12, x
+4,y
+1, x
+5,y
+1, // top left
251 x
+3,y
+2, x
+2,y
+3, x
+1,y
+4, x
+1,y
+5,
252 x
+1,y2
-5, x
+1,y2
-4, x
+2,y2
-3, // half corners
253 x2
-5,y
+1, x2
-4,y
+1, x2
-3,y
+2);
255 lPntArray
.putPoints(0, 17, x2
-5,y2
-1, x2
-4,y2
-1, // btm right
256 x2
-3,y2
-2, x2
-2,y2
-3, x2
-1,y2
-5, x2
-1,y2
-4,
258 x
+3,y2
-2, x
+4,y2
-1, x
+5,y2
-1, //half corners
259 x2
-2,y
+3, x2
-1,y
+4, x2
-1,y
+5,
261 x2
-5,y2
-2, x2
-4,y2
-2, // testing
263 x2
-2,y2
-5, x2
-2,y2
-4);
265 p
.setPen(pal
.color(QPalette::Light
));
266 p
.drawLine(x
+6, y
, x2
-6, y
);
267 p
.drawLine(0, y
+6, 0, y2
-6);
268 p
.drawPoints(hPntArray
);
270 p
.setPen(pal
.color(QPalette::Dark
));
271 p
.drawLine(x
+6, y2
, x2
-6, y2
);
272 p
.drawLine(x
+6, y2
-1, x2
-6, y2
-1);
273 p
.drawLine(x2
, y
+6, x2
, y2
-6);
274 p
.drawLine(x2
-1, y
+6, x2
-1, y2
-6);
275 p
.drawPoints(lPntArray
);
279 qDrawWinPanel(&p
, x
, y
, w
, h
, pal
, false);
282 void ModernSysFactory::read_config()
285 int hsize
, hwidth
, bwidth
, theight
;
287 KConfig
_c( "kwinmodernsysrc" );
288 KConfigGroup
c(&_c
, "General");
289 showh
= c
.readEntry("ShowHandle", true);
291 hwidth
= c
.readEntry("HandleWidth", 6);
292 hsize
= c
.readEntry("HandleSize", 30);
293 if (!(showh
&& hsize
&& hwidth
)) {
298 switch(options()->preferredBorderSize( this )) {
301 hwidth
= hwidth
* 7/5;
304 case BorderVeryLarge
:
306 hwidth
= hwidth
* 17/10 + 2;
307 hsize
= hsize
* 17/10;
311 hwidth
= hwidth
* 2 + 6;
315 // If we allow these large sizes we need to change the
316 // correlation between the border width and the handle size.
319 hwidth = hwidth * 5/2 + 15;
322 case BorderOversized:
324 hwidth = hwidth * 3 + 22;
333 theight
= QFontMetrics(options()->font(true)).height();
336 if (theight
< bwidth
)
340 handle_width
= hwidth
;
342 border_width
= bwidth
;
343 title_height
= theight
;
346 QList
< ModernSysFactory::BorderSize
> ModernSysFactory::borderSizes() const
347 { // the list must be sorted
348 return QList
< BorderSize
>() << BorderNormal
<< BorderLarge
<<
349 BorderVeryLarge
<< BorderHuge
;
350 // as long as the buttons don't scale don't offer the largest two sizes.
351 // BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized;
354 ModernButton::ModernButton(ButtonType type
, ModernSys
*parent
, const char *name
)
355 : KCommonDecorationButton(type
, parent
)
357 setObjectName( name
);
358 setAttribute(Qt::WA_NoSystemBackground
, true);
360 QBitmap mask
= QBitmap::fromData( QSize(14, 15), QPixmap::defaultDepth() > 8 ? btnhighcolor_mask_bits
: lowcolor_mask_bits
);
366 void ModernButton::reset(unsigned long changed
)
368 if (changed
&DecorationReset
|| changed
&ManualReset
|| changed
&SizeChange
|| changed
&StateChange
) {
371 setBitmap(close_bits
);
374 setBitmap(question_bits
);
377 setBitmap(iconify_bits
);
380 setBitmap( isChecked() ? (isLeft()?l_minmax_bits
:r_minmax_bits
) : maximize_bits
);
382 case OnAllDesktopsButton
:
383 setBitmap( isChecked() ? unsticky_bits
: sticky_bits
);
386 setBitmap( isChecked() ? shade_on_bits
: shade_off_bits
);
389 setBitmap( isChecked() ? above_on_bits
: above_off_bits
);
392 setBitmap( isChecked() ? below_on_bits
: below_off_bits
);
395 setBitmap(menu_bits
);
406 void ModernButton::setBitmap(const unsigned char *bitmap
)
409 deco
= QBitmap::fromData( QSize(8, 8), bitmap
);
412 deco
.fill(Qt::color0
);
417 void ModernButton::paintEvent(QPaintEvent
*)
423 void ModernButton::drawButton(QPainter
*p
)
425 if(decoration()->isActive()){
427 p
->drawPixmap(0, 0, isDown() ? *buttonPixDown
: *buttonPix
);
431 p
->drawPixmap(0, 0, isDown() ? *iButtonPixDown
: *iButtonPix
);
434 p
->setPen(*buttonFg
);
435 p
->drawPixmap(isDown() ? 4 : 3, isDown() ? 5 : 4, deco
);
439 void ModernSys::reset( unsigned long changed
)
441 KCommonDecoration::reset(changed
);
443 titleBuffer
= QPixmap();
449 ModernSys::ModernSys( KDecorationBridge
* b
, KDecorationFactory
* f
)
450 : KCommonDecoration( b
, f
)
454 QString
ModernSys::visibleName() const
456 return i18n("Modern System");
459 QString
ModernSys::defaultButtonsLeft() const
464 QString
ModernSys::defaultButtonsRight() const
469 bool ModernSys::decorationBehaviour(DecorationBehaviour behaviour
) const
482 return KCommonDecoration::decorationBehaviour(behaviour
);
486 int ModernSys::layoutMetric(LayoutMetric lm
, bool respectWindowState
, const KCommonDecorationButton
*btn
) const
488 // bool maximized = maximizeMode()==MaximizeFull && !options()->moveResizeMaximizedWindows();
492 return border_width
+ (reverse
? handle_width
: 0);
495 return border_width
+ (reverse
? 0 : handle_width
);
497 case LM_BorderBottom
:
498 return border_width
+ handle_width
;
500 case LM_TitleEdgeLeft
:
501 return layoutMetric(LM_BorderLeft
,respectWindowState
)+3;
502 case LM_TitleEdgeRight
:
503 return layoutMetric(LM_BorderRight
,respectWindowState
)+3;
505 case LM_TitleEdgeTop
:
508 case LM_TitleEdgeBottom
:
511 case LM_TitleBorderLeft
:
512 case LM_TitleBorderRight
:
520 case LM_ButtonHeight
:
523 case LM_ButtonSpacing
:
527 return KCommonDecoration::layoutMetric(lm
, respectWindowState
, btn
);
531 KCommonDecorationButton
*ModernSys::createButton(ButtonType type
)
535 return new ModernButton(MenuButton
, this, "menu");
537 case OnAllDesktopsButton
:
538 return new ModernButton(OnAllDesktopsButton
, this, "on_all_desktops");
541 return new ModernButton(HelpButton
, this, "help");
544 return new ModernButton(MinButton
, this, "minimize");
547 return new ModernButton(MaxButton
, this, "maximize");
550 return new ModernButton(CloseButton
, this, "close");
553 return new ModernButton(AboveButton
, this, "above");
556 return new ModernButton(BelowButton
, this, "below");
559 return new ModernButton(ShadeButton
, this, "shade");
566 void ModernSys::init()
568 reverse
= QApplication::isRightToLeft();
570 KCommonDecoration::init();
575 void ModernSys::recalcTitleBuffer()
577 if(oldTitle
== caption() && width() == titleBuffer
.width())
580 QFontMetrics
fm(options()->font(true));
581 titleBuffer
= QPixmap(width(), title_height
+2);
583 p
.begin(&titleBuffer
);
585 QPalette pt
= options()->palette(ColorTitleBar
, true);
586 pt
.setCurrentColorGroup( QPalette::Active
);
588 p
.drawTiledPixmap(0, 0, width(), title_height
+2, *aUpperGradient
);
590 p
.fillRect(0, 0, width(), title_height
+2,
591 pt
.brush(QPalette::Button
));
593 QRect t
= titleRect(); // titlebar->geometry();
595 t
.setLeft( t
.left() );
596 t
.setRight( t
.right() - 2 );
598 QRegion
r(t
.x(), 0, t
.width(), title_height
+2);
599 r
-= QRect(t
.x()+((t
.width()-fm
.width(caption()))/2)-4,
600 0, fm
.width(caption())+8, title_height
+2);
603 ly
= (title_height
% 3 == 0) ? 3 : 4;
604 for(i
=0; i
< (title_height
-2)/3; ++i
, ly
+=3){
605 p
.setPen(options()->color(ColorTitleBar
, true).light(150));
606 p
.drawLine(0, ly
, width()-1, ly
);
607 p
.setPen(options()->color(ColorTitleBar
, true).dark(120));
608 p
.drawLine(0, ly
+1, width()-1, ly
+1);
611 p
.setPen(options()->color(ColorFont
, true));
612 p
.setFont(options()->font(true));
614 p
.drawText(t
.x()+((t
.width()-fm
.width(caption()))/2)-4,
615 0, fm
.width(caption())+8, title_height
+2, Qt::AlignCenter
, caption());
616 p
.setClipping(false);
618 oldTitle
= caption();
621 void ModernSys::updateCaption()
623 widget()->update(titleRect() );
626 void ModernSys::drawRoundFrame(QPainter
&p
, int x
, int y
, int w
, int h
)
628 QPalette pt
= options()->palette(ColorFrame
, isActive());
629 pt
.setCurrentColorGroup( QPalette::Active
);
630 draw_button(p
, x
, y
, w
, h
, pt
);
634 void ModernSys::paintEvent( QPaintEvent
* )
636 // update title buffer...
637 if (oldTitle
!= caption() || width() != titleBuffer
.width() )
640 int hs
= handle_size
;
641 int hw
= handle_width
;
643 QPainter
p( widget() );
644 QRect t
= titleRect(); // titlebar->geometry();
646 QPalette pt
= options()->palette(ColorFrame
, isActive());
647 pt
.setCurrentColorGroup( QPalette::Active
);
648 QBrush
fillBrush(widget()->palette().brush(QPalette::Background
).pixmap() ?
649 widget()->palette().brush(QPalette::Background
) :
650 pt
.brush(QPalette::Button
));
652 p
.fillRect(1, title_height
+3, width()-2, height()-(title_height
+3), fillBrush
);
653 p
.fillRect(width()-6, 0, width()-1, height(), fillBrush
);
656 t
.setLeft( t
.left() );
657 t
.setRight( t
.right() - 2 );
659 int w
= width() - hw
; // exclude handle
660 int h
= height() - hw
;
663 QPalette g
= options()->palette(ColorTitleBar
, isActive());
664 g
.setCurrentColorGroup( QPalette::Active
);
666 p
.drawPixmap(1, 1, titleBuffer
, 0, 0, w
-2, title_height
+2);
670 p
.drawTiledPixmap(1, 1, w
-2, title_height
+2, *iUpperGradient
);
672 p
.fillRect(1, 1, w
-2, title_height
+2, fillBrush
);
673 p
.setPen(options()->color(ColorFont
, isActive()));
674 p
.setFont(options()->font(isActive()));
675 p
.drawText(t
, Qt::AlignCenter
, caption() );
678 // titlebar highlight
679 p
.setPen(g
.light().color());
680 p
.drawLine(1, 1, 1, title_height
+3);
681 p
.drawLine(1, 1, w
-3, 1);
682 p
.setPen(g
.dark().color());
683 p
.drawLine(w
-2, 1, w
-2, title_height
+3);
684 p
.drawLine(0, title_height
+2, w
-2, title_height
+2);
687 g
= options()->palette(ColorFrame
, isActive());
688 g
.setCurrentColorGroup(QPalette::Active
);
689 p
.setPen(g
.light().color());
690 p
.drawLine(1, title_height
+3, 1, h
-2);
691 p
.setPen(g
.dark().color());
692 p
.drawLine(2, h
-2, w
-2, h
-2);
693 p
.drawLine(w
-2, title_height
+3, w
-2, h
-2);
694 //p.drawPoint(w-3, title_height+3);
695 //p.drawPoint(2, title_height+3);
697 qDrawShadePanel(&p
, border_width
-1, title_height
+3, w
-2*border_width
+2, h
-title_height
-border_width
-2, g
, true);
700 p
.setPen(g
.dark().color());
701 p
.drawLine(width()-3, height()-hs
-1, width()-3, height()-3);
702 p
.drawLine(width()-hs
-1, height()-3, width()-3, height()-3);
704 p
.setPen(g
.light().color());
705 p
.drawLine(width()-hw
, height()-hs
-1, width()-hw
, height()-hw
);
706 p
.drawLine(width()-hs
-1, height()-hw
, width()-hw
, height()-hw
);
707 p
.drawLine(width()-hw
, height()-hs
-1, width()-4, height()-hs
-1);
708 p
.drawLine(width()-hs
-1, height()-hw
, width()-hs
-1, height()-4);
711 p
.drawRect(0, 0, w
-1, h
-1);
714 p
.drawLine(width()-hw
, height()-hs
, width(), height()-hs
);
715 p
.drawLine(width()-2, height()-hs
, width()-2, height()-2);
716 p
.drawLine(width()-hs
, height()-2, width()-2, height()-2);
717 p
.drawLine(width()-hs
, height()-hw
, width()-hs
, height()-2);
720 p
.drawRect(0, 0, w
-1, h
-1);
724 void ModernSys::updateWindowShape()
726 int hs
= handle_size
;
727 int hw
= handle_width
;
729 mask
+= QRect(0, 0, width()-hw
, height()-hw
);
731 mask
-= QRect(0, 0, 1, 1);
732 mask
-= QRect(width()-hw
-1, 0, 1, 1);
733 mask
-= QRect(0, height()-hw
-1, 1, 1);
736 mask
+= QRect(width()-hs
, height()-hs
, hs
-1, hs
-1);
737 mask
-= QRect(width()-2, height()-2, 1, 1);
738 mask
-= QRect(width()-2, height()-hs
, 1, 1);
739 mask
-= QRect(width()-hs
, height()-2, 1, 1);
741 mask
-= QRect(width()-1, height()-1, 1, 1);
746 ModernSysFactory::ModernSysFactory()
752 ModernSysFactory::~ModernSysFactory()
754 ModernSystem::delete_pixmaps();
757 KDecoration
* ModernSysFactory::createDecoration( KDecorationBridge
* b
)
759 return(new ModernSys(b
, this))->decoration();
762 bool ModernSysFactory::reset( unsigned long changed
)
766 bool needHardReset
= true;
767 if( changed
& (SettingColors
| SettingBorder
| SettingFont
) )
772 if( ( changed
& ~(SettingColors
| SettingBorder
| SettingFont
| SettingButtons
)) == 0 )
773 needHardReset
= false;
779 resetDecorations( changed
);
780 return false; // no recreating of decorations
784 bool ModernSysFactory::supports( Ability ability
) const
789 case AbilityAnnounceButtons
:
790 case AbilityAnnounceColors
:
792 case AbilityButtonOnAllDesktops
:
793 case AbilityButtonSpacer
:
794 case AbilityButtonHelp
:
795 case AbilityButtonMinimize
:
796 case AbilityButtonMaximize
:
797 case AbilityButtonClose
:
798 case AbilityButtonAboveOthers
:
799 case AbilityButtonBelowOthers
:
800 case AbilityButtonShade
:
801 case AbilityButtonMenu
:
803 case AbilityColorTitleBack
:
804 case AbilityColorTitleBlend
:
805 case AbilityColorTitleFore
:
814 // KWin extended plugin interface
815 extern "C" KDE_EXPORT KDecorationFactory
* create_factory()
817 return new ModernSystem::ModernSysFactory();