- Fix paint on null bitmap
- Fix ClientFactory::supprts() to report only supported buttons. svn path=/trunk/KDE/kdebase/workspace/; revision=726597
This commit is contained in:
parent
56b2c4ed8e
commit
0fb2ba30e2
1 changed files with 38 additions and 34 deletions
|
@ -117,7 +117,7 @@ static void read_config(B2ClientFactory *f)
|
||||||
buttonSize = (QFontMetrics(options()->font(true)).height() - 1) & 0x3e;
|
buttonSize = (QFontMetrics(options()->font(true)).height() - 1) & 0x3e;
|
||||||
if (buttonSize < 16) buttonSize = 16;
|
if (buttonSize < 16) buttonSize = 16;
|
||||||
|
|
||||||
KConfig _conf( "kwinb2rc" );
|
KConfig _conf("kwinb2rc");
|
||||||
KConfigGroup conf(&_conf, "General");
|
KConfigGroup conf(&_conf, "General");
|
||||||
colored_frame = conf.readEntry("UseTitleBarBorderColors", false);
|
colored_frame = conf.readEntry("UseTitleBarBorderColors", false);
|
||||||
do_draw_handle = conf.readEntry("DrawGrabHandle", true);
|
do_draw_handle = conf.readEntry("DrawGrabHandle", true);
|
||||||
|
@ -205,7 +205,7 @@ static void create_pixmaps()
|
||||||
for (i = 0; i < NUM_PIXMAPS; i++) {
|
for (i = 0; i < NUM_PIXMAPS; i++) {
|
||||||
|
|
||||||
switch (i / NumStates) {
|
switch (i / NumStates) {
|
||||||
case P_CLOSE: // will be initialized by copying P_CLOSE
|
case P_CLOSE: // will be initialized by copying P_MAX
|
||||||
case P_RESIZE:
|
case P_RESIZE:
|
||||||
pixmap[i] = new QPixmap();
|
pixmap[i] = new QPixmap();
|
||||||
break;
|
break;
|
||||||
|
@ -325,11 +325,12 @@ bool B2ClientFactory::supports(Ability ability)
|
||||||
case AbilityButtonMinimize:
|
case AbilityButtonMinimize:
|
||||||
case AbilityButtonMaximize:
|
case AbilityButtonMaximize:
|
||||||
case AbilityButtonClose:
|
case AbilityButtonClose:
|
||||||
case AbilityButtonAboveOthers:
|
|
||||||
case AbilityButtonBelowOthers:
|
|
||||||
case AbilityButtonShade:
|
case AbilityButtonShade:
|
||||||
case AbilityButtonResize:
|
case AbilityButtonResize:
|
||||||
return true;
|
return true;
|
||||||
|
// These are not (yet) supported.
|
||||||
|
case AbilityButtonAboveOthers:
|
||||||
|
case AbilityButtonBelowOthers:
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
@ -974,13 +975,13 @@ static void redraw_pixmaps()
|
||||||
QColor activeColor = aPal.color(QPalette::Button);
|
QColor activeColor = aPal.color(QPalette::Button);
|
||||||
|
|
||||||
// maximize
|
// maximize
|
||||||
drawB2Rect(PIXMAP_A(P_MAX), activeColor, false);
|
for (int i = 0; i < NumStates; i++) {
|
||||||
drawB2Rect(PIXMAP_AH(P_MAX), activeColor, true);
|
bool is_act = (i < 2);
|
||||||
drawB2Rect(PIXMAP_AD(P_MAX), activeColor, true);
|
bool is_down = ((i & 1) == 1);
|
||||||
|
QPixmap *pix = pixmap[P_MAX * NumStates + i];
|
||||||
drawB2Rect(PIXMAP_I(P_MAX), inactiveColor, false);
|
QColor color = is_act ? activeColor : inactiveColor;
|
||||||
drawB2Rect(PIXMAP_IH(P_MAX), inactiveColor, true);
|
drawB2Rect(pix, color, is_down);
|
||||||
drawB2Rect(PIXMAP_ID(P_MAX), inactiveColor, true);
|
}
|
||||||
|
|
||||||
// shade
|
// shade
|
||||||
QPixmap thinBox(buttonSize - 2, 6);
|
QPixmap thinBox(buttonSize - 2, 6);
|
||||||
|
@ -1019,7 +1020,7 @@ static void redraw_pixmaps()
|
||||||
for (int i = 0; i < NumStates; i++) {
|
for (int i = 0; i < NumStates; i++) {
|
||||||
bool is_act = (i < 3);
|
bool is_act = (i < 3);
|
||||||
bool is_down = (i == Down || i == IDown);
|
bool is_down = (i == Down || i == IDown);
|
||||||
*pixmap[P_RESIZE * NumStates + i] = *pixmap[P_CLOSE * NumStates + i];
|
*pixmap[P_RESIZE * NumStates + i] = *pixmap[P_MAX * NumStates + i];
|
||||||
pixmap[P_RESIZE * NumStates + i]->detach();
|
pixmap[P_RESIZE * NumStates + i]->detach();
|
||||||
drawB2Rect(&smallBox, is_act ? activeColor : inactiveColor, is_down);
|
drawB2Rect(&smallBox, is_act ? activeColor : inactiveColor, is_down);
|
||||||
bitBlt(pixmap[P_RESIZE * NumStates + i],
|
bitBlt(pixmap[P_RESIZE * NumStates + i],
|
||||||
|
@ -1103,6 +1104,7 @@ static void redraw_pixmaps()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Help button: a question mark.
|
||||||
// pin
|
// pin
|
||||||
for (int i = 0; i < NumStates; i++) {
|
for (int i = 0; i < NumStates; i++) {
|
||||||
const bool isDown = (i == Down || i == IDown);
|
const bool isDown = (i == Down || i == IDown);
|
||||||
|
@ -1145,7 +1147,6 @@ static void redraw_pixmaps()
|
||||||
*pixmap[offset + IHover] = hilighted;
|
*pixmap[offset + IHover] = hilighted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Create the titlebar gradients
|
// Create the titlebar gradients
|
||||||
if (QPixmap::defaultDepth() > 8) {
|
if (QPixmap::defaultDepth() > 8) {
|
||||||
QColor titleColor[4] = {
|
QColor titleColor[4] = {
|
||||||
|
@ -1243,9 +1244,8 @@ bool B2Client::drawbound(const QRect& geom, bool clear)
|
||||||
kDebug() << "workspaceWidget is null";
|
kDebug() << "workspaceWidget is null";
|
||||||
} else {
|
} else {
|
||||||
kDebug() << "workspaceWidget is " << workspaceWidget();
|
kDebug() << "workspaceWidget is " << workspaceWidget();
|
||||||
}
|
QPainter p;
|
||||||
|
if (p.begin(workspaceWidget())) {
|
||||||
QPainter p(workspaceWidget());
|
|
||||||
p.setPen(QPen(Qt::white, 5));
|
p.setPen(QPen(Qt::white, 5));
|
||||||
p.setCompositionMode(QPainter::CompositionMode_Xor);
|
p.setCompositionMode(QPainter::CompositionMode_Xor);
|
||||||
p.drawPolygon(bound_shape);
|
p.drawPolygon(bound_shape);
|
||||||
|
@ -1253,6 +1253,10 @@ bool B2Client::drawbound(const QRect& geom, bool clear)
|
||||||
delete visible_bound;
|
delete visible_bound;
|
||||||
visible_bound = 0;
|
visible_bound = 0;
|
||||||
}
|
}
|
||||||
|
p.end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue