diff --git a/clients/b2/b2client.cpp b/clients/b2/b2client.cpp index 111e3adb0a..ce87c6a46a 100644 --- a/clients/b2/b2client.cpp +++ b/clients/b2/b2client.cpp @@ -1,5 +1,5 @@ -#ifndef CLIENTS/B2/B2CLIENT.CPP -#define CLIENTS/B2/B2CLIENT.CPP +#ifndef CLIENTS_B2_B2CLIENT +#define CLIENTS_B2_B2CLIENT /* * B-II KWin Client * @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -44,14 +45,14 @@ namespace B2 { #include "bitmaps.h" -enum { - Norm = 0, - Hover, Down, INorm, IHover, IDown, - NumStates +enum { + Norm = 0, + Hover, Down, INorm, IHover, IDown, + NumStates }; enum { - P_CLOSE = 0, + P_CLOSE = 0, P_MAX, P_NORMALIZE, P_ICONIFY, P_PINUP, P_MENU, P_HELP, P_SHADE, P_RESIZE, P_NUM_BUTTON_TYPES }; @@ -162,7 +163,7 @@ static void drawB2Rect(KPixmap *pix, const QColor &primary, bool down) if (down) qSwap(hColor, lColor); if (QPixmap::defaultDepth() > 8) { - KPixmapEffect::gradient(*pix, hColor, lColor, + KPixmapEffect::gradient(*pix, hColor, lColor, KPixmapEffect::DiagonalGradient); } else @@ -200,7 +201,7 @@ static void create_pixmaps() switch (i / NumStates) { case P_MAX: // will be initialized by copying P_CLOSE case P_RESIZE: - pixmap[i] = new KPixmap; + pixmap[i] = new KPixmap(); break; case P_ICONIFY: pixmap[i] = new KPixmap(10, 10); @@ -225,11 +226,11 @@ static void create_pixmaps() PIXMAP_ID(P_PINUP)->setMask(pindownMask); QBitmap menuMask = QBitmap::fromData(QSize( 16, 16 ), menu_mask_bits); - for (i = 0; i < NumStates; i++) + for (i = 0; i < NumStates; i++) pixmap[P_MENU * NumStates + i]->setMask(menuMask); QBitmap helpMask = QBitmap::fromData(QSize( 16, 16 ), help_mask_bits); - for (i = 0; i < NumStates; i++) + for (i = 0; i < NumStates; i++) pixmap[P_HELP * NumStates + i]->setMask(helpMask); QBitmap normalizeMask(16, 16); @@ -239,20 +240,20 @@ static void create_pixmaps() mask.begin(&normalizeMask); QBrush one(Qt::color1); - mask.fillRect(normalizeMask.width() - 12, normalizeMask.height() - 12, + mask.fillRect(normalizeMask.width() - 12, normalizeMask.height() - 12, 12, 12, one); mask.fillRect(0, 0, 10, 10, one); mask.end(); - for (i = 0; i < NumStates; i++) + for (i = 0; i < NumStates; i++) pixmap[P_NORMALIZE * NumStates + i]->setMask(normalizeMask); - + QBitmap shadeMask(bsize, bsize); shadeMask.clear(); mask.begin(&shadeMask); mask.fillRect(0, 0, bsize, 6, one); mask.end(); - for (i = 0; i < NumStates; i++) + for (i = 0; i < NumStates; i++) pixmap[P_SHADE * NumStates + i]->setMask(shadeMask); titleGradient[0] = 0; @@ -362,13 +363,13 @@ B2Client::B2Client(KDecorationBridge *b, KDecorationFactory *f) void B2Client::init() { const QString tips[] = { - i18n("Menu"), - isOnAllDesktops() ? - i18n("Not on all desktops") : i18n("On all desktops"), - i18n("Minimize"), i18n("Maximize"), + i18n("Menu"), + isOnAllDesktops() ? + i18n("Not on all desktops") : i18n("On all desktops"), + i18n("Minimize"), i18n("Maximize"), i18n("Close"), i18n("Help"), isSetShade() ? i18n("Unshade") : i18n("Shade"), - i18n("Resize") + i18n("Resize") }; // Check this early, otherwise the preview will be rendered badly. @@ -398,18 +399,18 @@ void B2Client::init() topSpacer = new QSpacerItem(10, buttonSize + 4, QSizePolicy::Expanding, QSizePolicy::Fixed); g->addItem(topSpacer, 0, 1); - - // Bottom border height. - bottomSpacer = new QSpacerItem(10, - thickness + (mustDrawHandle() ? 4 : 0), + + // Bottom border height. + bottomSpacer = new QSpacerItem(10, + thickness + (mustDrawHandle() ? 4 : 0), QSizePolicy::Expanding, QSizePolicy::Fixed); g->addItem(bottomSpacer, 2, 1); if (isPreview()) { QLabel *previewLabel = new QLabel( - i18n("
B II preview
"), + i18n("
B II preview
"), widget()); g->addWidget(previewLabel, 1, 1); - + } else { g->addItem(new QSpacerItem(0, 0), 1, 1); } @@ -460,7 +461,7 @@ void B2Client::addButtons(const QString& s, const QString tips[], switch (s[i].toLatin1()) { case 'M': // Menu button if (!button[BtnMenu]) { - button[BtnMenu] = new B2Button(this, tb, tips[BtnMenu], + button[BtnMenu] = new B2Button(this, tb, tips[BtnMenu], Qt::LeftButton | Qt::RightButton); button[BtnMenu]->setPixmaps(P_MENU); button[BtnMenu]->setUseMiniIcon(); @@ -500,7 +501,7 @@ void B2Client::addButtons(const QString& s, const QString tips[], break; case 'A': // Maximize button if (isMaximizable() && (!button[BtnMax])) { - button[BtnMax] = new B2Button(this, tb, tips[BtnMax], + button[BtnMax] = new B2Button(this, tb, tips[BtnMax], Qt::LeftButton | Qt::MidButton | Qt::RightButton); button[BtnMax]->setPixmaps(maximizeMode() == MaximizeFull ? P_NORMALIZE : P_MAX); @@ -543,8 +544,8 @@ void B2Client::addButtons(const QString& s, const QString tips[], } } -bool B2Client::mustDrawHandle() const -{ +bool B2Client::mustDrawHandle() const +{ if (drawSmallBorders && (maximizeMode() & MaximizeVertical)) { return false; } else { @@ -564,9 +565,9 @@ void B2Client::calcHiddenButtons() { // Hide buttons in this order: // Shade, Sticky, Help, Resize, Maximize, Minimize, Close, Menu - B2Button* btnArray[] = { + B2Button* btnArray[] = { button[BtnShade], button[BtnSticky], button[BtnHelp], button[BtnResize], - button[BtnMax], button[BtnIconify], button[BtnClose], button[BtnMenu] + button[BtnMax], button[BtnIconify], button[BtnClose], button[BtnMenu] }; int minWidth = 120; int currentWidth = width(); @@ -636,12 +637,12 @@ void B2Client::paintEvent(QPaintEvent* e) QBrush fillBrush(options()->color(frameColorGroup, isActive())); // outer frame rect - p.drawRect(0, t.bottom() - thickness + 1, + p.drawRect(0, t.bottom() - thickness + 1, width(), fHeight - bb + thickness); if (thickness >= 2) { // inner window rect - p.drawRect(thickness - 1, t.bottom(), + p.drawRect(thickness - 1, t.bottom(), width() - 2 * (thickness - 1), fHeight - bDepth + 2); if (thickness >= 3) { @@ -722,9 +723,9 @@ void B2Client::doShape() // top to the tilebar right if (bar_x_ofs) { // left from bar - mask -= QRect(0, 0, bar_x_ofs, t.height() - thickness); + mask -= QRect(0, 0, bar_x_ofs, t.height() - thickness); // top left point - mask -= QRect(0, t.height() - thickness, 1, 1); + mask -= QRect(0, t.height() - thickness, 1, 1); } if (t.right() < width() - 1) { mask -= QRect(width() - 1, @@ -733,17 +734,17 @@ void B2Client::doShape() width() - t.right() - 1, t.height() - thickness); } // bottom right point - mask -= QRect(width() - 1, height() - 1, 1, 1); + mask -= QRect(width() - 1, height() - 1, 1, 1); if (mustDrawHandle()) { // bottom left point - mask -= QRect(0, height() - 5, 1, 1); + mask -= QRect(0, height() - 5, 1, 1); // handle left point mask -= QRect(width() - 40, height() - 1, 1, 1); - // bottom left + // bottom left mask -= QRect(0, height() - 4, width() - 40, 4); } else { // bottom left point - mask -= QRect(0, height() - 1, 1, 1); + mask -= QRect(0, height() - 1, 1, 1); } setMask(mask); @@ -827,7 +828,7 @@ void B2Client::desktopChange() bool on = isOnAllDesktops(); if (B2Button *b = button[BtnSticky]) { b->setDown(on); - b->setToolTip( + b->setToolTip( on ? i18n("Not on all desktops") : i18n("On all desktops")); } } @@ -897,8 +898,8 @@ void B2Client::borders(int &left, int &right, int &top, int &bottom) const void B2Client::menuButtonPressed() { static B2Client *lastClient = NULL; - - bool dbl = (lastClient == this && + + bool dbl = (lastClient == this && time.elapsed() <= QApplication::doubleClickInterval()); lastClient = this; time.start(); @@ -975,7 +976,7 @@ static void redraw_pixmaps() QColor color = is_act ? aGrp.color( QPalette::Button ) : iGrp.color( QPalette::Button ); drawB2Rect(&thinBox, color, is_down); pix->fill(Qt::black); - bitBlt(pix, 0, 0, &thinBox, + bitBlt(pix, 0, 0, &thinBox, 0, 0, thinBox.width(), thinBox.height()); } @@ -984,17 +985,15 @@ static void redraw_pixmaps() *pixmap[P_MAX * NumStates + i] = *pixmap[P_CLOSE * NumStates + i]; pixmap[P_MAX * NumStates + i]->detach(); } - + // normalize + iconify - KPixmap smallBox; - smallBox.resize(10, 10); - KPixmap largeBox; - largeBox.resize(12, 12); + KPixmap smallBox( 10, 10 ); + KPixmap largeBox( 12, 12 ); for (i = 0; i < NumStates; i++) { bool is_act = (i < 3); bool is_down = (i == Down || i == IDown); - KPixmap *pix = pixmap[P_NORMALIZE * NumStates + i]; + QPixmap *pix = pixmap[P_NORMALIZE * NumStates + i]; drawB2Rect(&smallBox, is_act ? aGrp.color( QPalette::Button ) : iGrp.color( QPalette::Button ), is_down); drawB2Rect(&largeBox, is_act ? aGrp.color( QPalette::Button ) : iGrp.color( QPalette::Button ), is_down); pix->fill(options()->color(KDecoration::ColorTitleBar, is_act)); @@ -1005,7 +1004,7 @@ static void redraw_pixmaps() bitBlt(pixmap[P_ICONIFY * NumStates + i], 0, 0, &smallBox, 0, 0, 10, 10); } - + // resize for (i = 0; i < NumStates; i++) { bool is_act = (i < 3); @@ -1013,7 +1012,7 @@ static void redraw_pixmaps() *pixmap[P_RESIZE * NumStates + i] = *pixmap[P_CLOSE * NumStates + i]; pixmap[P_RESIZE * NumStates + i]->detach(); drawB2Rect(&smallBox, is_act ? aGrp.color( QPalette::Button ) : iGrp.color( QPalette::Button ), is_down); - bitBlt(pixmap[P_RESIZE * NumStates + i], + bitBlt(pixmap[P_RESIZE * NumStates + i], 0, 0, &smallBox, 0, 0, 10, 10); } @@ -1060,16 +1059,16 @@ static void redraw_pixmaps() QPixmap hilighted; for (i = 0; i < P_NUM_BUTTON_TYPES; i++) { int offset = i * NumStates; - hilighted = ie.apply(*pixmap[offset + Norm], + hilighted = ie.apply(*pixmap[offset + Norm], K3Icon::Small, K3Icon::ActiveState); - *pixmap[offset + Hover] = hilighted; + *pixmap[offset + Hover] = hilighted; - hilighted = ie.apply(*pixmap[offset + INorm], + hilighted = ie.apply(*pixmap[offset + INorm], K3Icon::Small, K3Icon::ActiveState); - *pixmap[offset + IHover] = hilighted; + *pixmap[offset + IHover] = hilighted; } - + // Create the titlebar gradients if (QPixmap::defaultDepth() > 8) { QColor titleColor[4] = { @@ -1090,7 +1089,7 @@ static void redraw_pixmaps() if (!titleGradient[i]) { titleGradient[i] = new KPixmap; } - titleGradient[i]->resize(64, buttonSize + 3); + *titleGradient[i] = QPixmap(64, buttonSize + 3); KPixmapEffect::gradient(*titleGradient[i], titleColor[2 * i], titleColor[2 * i + 1], KPixmapEffect::VerticalGradient); @@ -1200,7 +1199,7 @@ bool B2Client::eventFilter(QObject *o, QEvent *e) // ===================================== -B2Button::B2Button(B2Client *_client, QWidget *parent, +B2Button::B2Button(B2Client *_client, QWidget *parent, const QString& tip, const int realizeBtns) : Q3Button(parent, 0), hover(false) { @@ -1226,7 +1225,7 @@ QSizePolicy B2Button::sizePolicy() const void B2Button::drawButton(QPainter *p) { - KPixmap* gradient = titleGradient[client->isActive() ? 0 : 1]; + QPixmap* gradient = titleGradient[client->isActive() ? 0 : 1]; if (gradient) { p->drawTiledPixmap(0, 0, buttonSize, buttonSize, *gradient, 0, 2); } else { @@ -1254,7 +1253,7 @@ void B2Button::drawButton(QPainter *p) else type = INorm; } - p->drawPixmap((width() - icon[type]->width()) / 2, + p->drawPixmap((width() - icon[type]->width()) / 2, (height() - icon[type]->height()) / 2, *icon[type]); } } @@ -1271,9 +1270,9 @@ void B2Button::setPixmaps(int button_id) void B2Button::mousePressEvent(QMouseEvent * e) { last_button = e->button(); - QMouseEvent me(e->type(), e->pos(), e->globalPos(), - (e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton, - (e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton, + QMouseEvent me(e->type(), e->pos(), e->globalPos(), + (e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton, + (e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton, e->modifiers()); Q3Button::mousePressEvent(&me); } @@ -1281,9 +1280,9 @@ void B2Button::mousePressEvent(QMouseEvent * e) void B2Button::mouseReleaseEvent(QMouseEvent * e) { last_button = e->button(); - QMouseEvent me(e->type(), e->pos(), e->globalPos(), - (e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton, - (e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton, + QMouseEvent me(e->type(), e->pos(), e->globalPos(), + (e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton, + (e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton, e->modifiers()); Q3Button::mouseReleaseEvent(&me); } @@ -1346,7 +1345,7 @@ bool B2Titlebar::x11Event(XEvent *e) void B2Titlebar::drawTitlebar(QPainter &p, bool state) { - KPixmap* gradient = titleGradient[state ? 0 : 1]; + QPixmap* gradient = titleGradient[state ? 0 : 1]; QRect t = rect(); // black titlebar frame @@ -1371,7 +1370,7 @@ void B2Titlebar::drawTitlebar(QPainter &p, bool state) void B2Titlebar::recalcBuffer() { - titleBuffer.resize(width(), height()); + titleBuffer = QPixmap(width(), height()); QPainter p(&titleBuffer); drawTitlebar(p, true); diff --git a/clients/b2/b2client.h b/clients/b2/b2client.h index 6a6c913e5f..187c2534b0 100644 --- a/clients/b2/b2client.h +++ b/clients/b2/b2client.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -40,8 +40,8 @@ public: ~B2Button() {}; void setBg(const QColor &c){bg = c;} - void setPixmaps(KPixmap *pix, KPixmap *pixDown, KPixmap *iPix, - KPixmap *iPixDown); + void setPixmaps(QPixmap *pix, QPixmap *pixDown, QPixmap *iPix, + QPixmap *iPixDown); void setPixmaps(int button_id); void setToggle(){setCheckable(true);} void setActive(bool on){setChecked(on);} @@ -59,7 +59,7 @@ private: void leaveEvent(QEvent *e); bool useMiniIcon; - KPixmap *icon[6]; + QPixmap *icon[6]; QColor bg; //only use one color (the rest is pixmap) so forget QPalette ;) public: @@ -91,7 +91,7 @@ private: B2Client *client; QString oldTitle; - KPixmap titleBuffer; + QPixmap titleBuffer; QPoint moveOffset; bool set_x11mask; bool isfullyobscured; diff --git a/clients/default/kdedefault.cpp b/clients/default/kdedefault.cpp index ea3d5144bd..aa68f04b7c 100644 --- a/clients/default/kdedefault.cpp +++ b/clients/default/kdedefault.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -118,7 +119,7 @@ static const unsigned char pinup_mask_bits[] = { // =========================================================================== -static QPixmap* titlePix; +static KPixmap* titlePix; static KPixmap* titleBuffer; static KPixmap* aUpperGradient; static KPixmap* iUpperGradient; @@ -267,7 +268,7 @@ void KDEDefaultHandler::createPixmaps() QPainter p; QPainter maskPainter; int i, x, y; - titlePix = new QPixmap(132, normalTitleHeight+2); + titlePix = new KPixmap(132, normalTitleHeight+2); QBitmap mask(132, normalTitleHeight+2); mask.fill(Qt::color0); @@ -305,8 +306,7 @@ void KDEDefaultHandler::createPixmaps() // Create the titlebar gradients if (activeTitleColor1 != activeTitleColor2) { - aUpperGradient = new KPixmap; - aUpperGradient->resize(128, normalTitleHeight+2); + aUpperGradient = new KPixmap(128, normalTitleHeight+2); KPixmapEffect::gradient(*aUpperGradient, activeTitleColor1, activeTitleColor2, @@ -315,8 +315,7 @@ void KDEDefaultHandler::createPixmaps() if (inactiveTitleColor1 != inactiveTitleColor2) { - iUpperGradient = new KPixmap; - iUpperGradient->resize(128, normalTitleHeight+2); + iUpperGradient = new KPixmap(128, normalTitleHeight+2); KPixmapEffect::gradient(*iUpperGradient, inactiveTitleColor1, @@ -331,16 +330,14 @@ void KDEDefaultHandler::createPixmaps() // Active pins g = options()->palette( ColorButtonBg, true ); - pinUpPix = new KPixmap(); - pinUpPix->resize(16, 16); + pinUpPix = new KPixmap(16, 16); p.begin( pinUpPix ); kColorBitmaps( &p, g, 0, 0, 16, 16, true, pinup_white_bits, pinup_gray_bits, NULL, NULL, pinup_dgray_bits, NULL ); p.end(); pinUpPix->setMask( QBitmap::fromData(QSize( 16, 16 ), pinup_mask_bits) ); - pinDownPix = new KPixmap(); - pinDownPix->resize(16, 16); + pinDownPix = new KPixmap(16, 16); p.begin( pinDownPix ); kColorBitmaps( &p, g, 0, 0, 16, 16, true, pindown_white_bits, pindown_gray_bits, NULL, NULL, pindown_dgray_bits, NULL ); @@ -349,16 +346,14 @@ void KDEDefaultHandler::createPixmaps() // Inactive pins g = options()->palette( ColorButtonBg, false ); - ipinUpPix = new KPixmap(); - ipinUpPix->resize(16, 16); + ipinUpPix = new KPixmap(16, 16); p.begin( ipinUpPix ); kColorBitmaps( &p, g, 0, 0, 16, 16, true, pinup_white_bits, pinup_gray_bits, NULL, NULL, pinup_dgray_bits, NULL ); p.end(); ipinUpPix->setMask( QBitmap::fromData(QSize( 16, 16 ), pinup_mask_bits) ); - ipinDownPix = new KPixmap(); - ipinDownPix->resize(16, 16); + ipinDownPix = new KPixmap(16, 16); p.begin( ipinDownPix ); kColorBitmaps( &p, g, 0, 0, 16, 16, true, pindown_white_bits, pindown_gray_bits, NULL, NULL, pindown_dgray_bits, NULL ); @@ -369,41 +364,25 @@ void KDEDefaultHandler::createPixmaps() titleBuffer = new KPixmap(); // Cache all possible button states - leftBtnUpPix[true] = new KPixmap(); - leftBtnUpPix[true]->resize(normalTitleHeight, normalTitleHeight); - leftBtnDownPix[true] = new KPixmap(); - leftBtnDownPix[true]->resize(normalTitleHeight, normalTitleHeight); - ileftBtnUpPix[true] = new KPixmap(); - ileftBtnUpPix[true]->resize(normalTitleHeight, normalTitleHeight); - ileftBtnDownPix[true] = new KPixmap(); - ileftBtnDownPix[true]->resize(normalTitleHeight, normalTitleHeight); + leftBtnUpPix[true] = new KPixmap(normalTitleHeight, normalTitleHeight); + leftBtnDownPix[true] = new KPixmap(normalTitleHeight, normalTitleHeight); + ileftBtnUpPix[true] = new KPixmap(normalTitleHeight, normalTitleHeight); + ileftBtnDownPix[true] = new KPixmap(normalTitleHeight, normalTitleHeight); - rightBtnUpPix[true] = new KPixmap(); - rightBtnUpPix[true]->resize(normalTitleHeight, normalTitleHeight); - rightBtnDownPix[true] = new KPixmap(); - rightBtnDownPix[true]->resize(normalTitleHeight, normalTitleHeight); - irightBtnUpPix[true] = new KPixmap(); - irightBtnUpPix[true]->resize(normalTitleHeight, normalTitleHeight); - irightBtnDownPix[true] = new KPixmap(); - irightBtnDownPix[true]->resize(normalTitleHeight, normalTitleHeight); + rightBtnUpPix[true] = new KPixmap(normalTitleHeight, normalTitleHeight); + rightBtnDownPix[true] = new KPixmap(normalTitleHeight, normalTitleHeight); + irightBtnUpPix[true] = new KPixmap(normalTitleHeight, normalTitleHeight); + irightBtnDownPix[true] = new KPixmap(normalTitleHeight, normalTitleHeight); - leftBtnUpPix[false] = new KPixmap(); - leftBtnUpPix[false]->resize(toolTitleHeight, normalTitleHeight); - leftBtnDownPix[false] = new KPixmap(); - leftBtnDownPix[false]->resize(toolTitleHeight, normalTitleHeight); - ileftBtnUpPix[false] = new KPixmap(); - ileftBtnUpPix[false]->resize(normalTitleHeight, normalTitleHeight); - ileftBtnDownPix[false] = new KPixmap(); - ileftBtnDownPix[false]->resize(normalTitleHeight, normalTitleHeight); + leftBtnUpPix[false] = new KPixmap(toolTitleHeight, normalTitleHeight); + leftBtnDownPix[false] = new KPixmap(toolTitleHeight, normalTitleHeight); + ileftBtnUpPix[false] = new KPixmap(normalTitleHeight, normalTitleHeight); + ileftBtnDownPix[false] = new KPixmap(normalTitleHeight, normalTitleHeight); - rightBtnUpPix[false] = new KPixmap(); - rightBtnUpPix[false]->resize(toolTitleHeight, toolTitleHeight); - rightBtnDownPix[false] = new KPixmap(); - rightBtnDownPix[false]->resize(toolTitleHeight, toolTitleHeight); - irightBtnUpPix[false] = new KPixmap(); - irightBtnUpPix[false]->resize(toolTitleHeight, toolTitleHeight); - irightBtnDownPix[false] = new KPixmap(); - irightBtnDownPix[false]->resize(toolTitleHeight, toolTitleHeight); + rightBtnUpPix[false] = new KPixmap(toolTitleHeight, toolTitleHeight); + rightBtnDownPix[false] = new KPixmap(toolTitleHeight, toolTitleHeight); + irightBtnUpPix[false] = new KPixmap(toolTitleHeight, toolTitleHeight); + irightBtnDownPix[false] = new KPixmap(toolTitleHeight, toolTitleHeight); // Draw the button state pixmaps g = options()->palette( ColorTitleBar, true ); @@ -642,7 +621,7 @@ void KDEDefaultButton::drawButton(QPainter *p) if (deco) { // Fill the button background with an appropriate button image - KPixmap btnbg; + QPixmap btnbg; if (isLeft() ) { if (isDown()) @@ -666,7 +645,7 @@ void KDEDefaultButton::drawButton(QPainter *p) // Fill the button background with an appropriate color/gradient // This is for sticky and menu buttons - KPixmap* grad = active ? aUpperGradient : iUpperGradient; + QPixmap* grad = active ? aUpperGradient : iUpperGradient; if (!grad) { QColor c = KDecoration::options()->color(KDecoration::ColorTitleBar, active); p->fillRect(0, 0, width(), height(), c ); @@ -869,8 +848,8 @@ void KDEDefaultClient::reset( unsigned long changed) KCommonDecoration::reset(changed); } -bool KDEDefaultClient::mustDrawHandle() const -{ +bool KDEDefaultClient::mustDrawHandle() const +{ bool drawSmallBorders = !options()->moveResizeMaximizedWindows(); if (drawSmallBorders && (maximizeMode() & MaximizeVertical)) { return false; @@ -887,9 +866,9 @@ void KDEDefaultClient::paintEvent( QPaintEvent* ) QPalette g; int offset; - KPixmap* upperGradient = isActive() ? aUpperGradient : iUpperGradient; + QPixmap* upperGradient = isActive() ? aUpperGradient : iUpperGradient; - QPainter p(widget()); + QPainter p(widget()); // Obtain widget bounds. QRect r(widget()->rect()); @@ -907,16 +886,16 @@ void KDEDefaultClient::paintEvent( QPaintEvent* ) r = titleRect(); int rightOffset = r.x()+r.width()+1; - // Create a disposable pixmap buffer for the titlebar + // Create a disposable pixmap buffer for the titlebar // very early before drawing begins so there is no lag // during painting pixels. - titleBuffer->resize( rightOffset-3, titleHeight+1 ); + *titleBuffer = QPixmap( rightOffset-3, titleHeight+1 ); // Draw an outer black frame p.setPen(Qt::black); p.drawRect(x,y,w,h); - // Draw part of the frame that is the titlebar color + // Draw part of the frame that is the titlebar color g = options()->palette(ColorTitleBar, isActive()); p.setPen(g.color( QPalette::Light )); p.drawLine(x+1, y+1, rightOffset-1, y+1); diff --git a/clients/default/kdedefault.h b/clients/default/kdedefault.h index 944f9e6268..4a8ec19a75 100644 --- a/clients/default/kdedefault.h +++ b/clients/default/kdedefault.h @@ -15,13 +15,13 @@ #include #include -#include #include #include class QSpacerItem; class QBoxLayout; class QGridLayout; +class KPixmap; namespace Default { diff --git a/clients/keramik/keramik.cpp b/clients/keramik/keramik.cpp index 99f3fdc789..04970c9bce 100644 --- a/clients/keramik/keramik.cpp +++ b/clients/keramik/keramik.cpp @@ -1225,7 +1225,7 @@ void KeramikClient::updateCaptionBuffer() QPixmap *icon = NULL; if ( captionBuffer.size() != captionRect.size() ) - captionBuffer.resize( captionRect.size() ); + captionBuffer = QPixmap( captionRect.size() ); if ( captionBuffer.isNull() ) return; @@ -1469,7 +1469,7 @@ void KeramikClient::menuButtonPressed() menuTop += QPoint(-6, -3); menuBottom += QPoint(6, 3); KDecorationFactory* f = factory(); - showWindowMenu( QRect( button[MenuButton]->mapToGlobal( menuTop ), + showWindowMenu( QRect( button[MenuButton]->mapToGlobal( menuTop ), button[MenuButton]->mapToGlobal( menuBottom )) ); if( !f->exists( this )) // 'this' was destroyed return; diff --git a/clients/laptop/laptopclient.cpp b/clients/laptop/laptopclient.cpp index d06c03f630..c1c2c77907 100644 --- a/clients/laptop/laptopclient.cpp +++ b/clients/laptop/laptopclient.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -144,10 +145,8 @@ static void create_pixmaps() titlePix->setMask(mask); if(QPixmap::defaultDepth() > 8){ - aUpperGradient = new KPixmap; - aUpperGradient->resize(32, titleHeight+2); - iUpperGradient = new KPixmap; - iUpperGradient->resize(32, titleHeight+2); + aUpperGradient = new KPixmap(32, titleHeight+2); + iUpperGradient = new KPixmap(32, titleHeight+2); QColor bgColor = options()->color(KDecoration::ColorTitleBar, true); KPixmapEffect::gradient(*aUpperGradient, bgColor.light(120), @@ -162,22 +161,14 @@ static void create_pixmaps() // buttons (active/inactive, sunken/unsunken, 2 sizes each) QColorGroup g = options()->palette(KDecoration::ColorButtonBg, true).active(); QColor c = g.background(); - btnPix1 = new KPixmap; - btnPix1->resize(btnWidth1, titleHeight); - btnDownPix1 = new KPixmap; - btnDownPix1->resize(btnWidth1, titleHeight); - btnPix2 = new KPixmap; - btnPix2->resize(btnWidth2, titleHeight); - btnDownPix2 = new KPixmap; - btnDownPix2->resize(btnWidth2, titleHeight); - iBtnPix1 = new KPixmap; - iBtnPix1->resize(btnWidth1, titleHeight); - iBtnDownPix1 = new KPixmap; - iBtnDownPix1->resize(btnWidth1, titleHeight); - iBtnPix2 = new KPixmap; - iBtnPix2->resize(btnWidth2, titleHeight); - iBtnDownPix2 = new KPixmap; - iBtnDownPix2->resize(btnWidth2, titleHeight); + btnPix1 = new KPixmap(btnWidth1, titleHeight); + btnDownPix1 = new KPixmap(btnWidth1, titleHeight); + btnPix2 = new KPixmap(btnWidth2, titleHeight); + btnDownPix2 = new KPixmap(btnWidth2, titleHeight); + iBtnPix1 = new KPixmap(btnWidth1, titleHeight); + iBtnDownPix1 = new KPixmap(btnWidth1, titleHeight); + iBtnPix2 = new KPixmap(btnWidth2, titleHeight); + iBtnDownPix2 = new KPixmap(btnWidth2, titleHeight); if(QPixmap::defaultDepth() > 8){ KPixmapEffect::gradient(*btnPix1, c.light(120), c.dark(130), KPixmapEffect::DiagonalGradient); @@ -203,20 +194,20 @@ static void create_pixmaps() btnDownPix1->fill(c.rgb()); btnPix2->fill(c.rgb()); btnDownPix2->fill(c.rgb()); - g = options()->palette(KDecoration::ColorButtonBg, false).active(); + g = options()->palette(KDecoration::ColorButtonBg, false).active(); c = g.background(); iBtnPix1->fill(c.rgb()); iBtnDownPix1->fill(c.rgb()); iBtnPix2->fill(c.rgb()); iBtnDownPix2->fill(c.rgb()); } - g = options()->palette(KDecoration::ColorButtonBg, true).active(); + g = options()->palette(KDecoration::ColorButtonBg, true).active(); c = g.background(); drawButtonFrame(btnPix1, g, false); drawButtonFrame(btnDownPix1, g, true); drawButtonFrame(btnPix2, g, false); drawButtonFrame(btnDownPix2, g, true); - g = options()->palette(KDecoration::ColorButtonBg, false).active(); + g = options()->palette(KDecoration::ColorButtonBg, false).active(); c = g.background(); drawButtonFrame(iBtnPix1, g, false); drawButtonFrame(iBtnDownPix1, g, true); @@ -519,7 +510,7 @@ void LaptopClient::paintEvent( QPaintEvent* ) if (mustDrawHandle()) { if (r.width() > 3*handleSize + 20) { int range = 8 + 3*handleSize/2; - qDrawShadePanel(&p, r.x() + 1, r.bottom() - bs, range, + qDrawShadePanel(&p, r.x() + 1, r.bottom() - bs, range, handleSize - 2, g, false, 1, &g.brush(QColorGroup::Mid)); qDrawShadePanel(&p, r.x() + range + 1, r.bottom() - bs, r.width() - 2*range - 2, handleSize - 2, g, false, 1, @@ -602,8 +593,8 @@ QRegion LaptopClient::cornerShape(WindowCorner corner) } -bool LaptopClient::mustDrawHandle() const -{ +bool LaptopClient::mustDrawHandle() const +{ bool drawSmallBorders = !options()->moveResizeMaximizedWindows(); if (drawSmallBorders && (maximizeMode() & MaximizeVertical)) { return false; @@ -622,8 +613,7 @@ void LaptopClient::updateActiveBuffer( ) lastBufferWidth = rTitle.width(); bufferDirty = false; - activeBuffer.resize(rTitle.width(), - rTitle.height()); + activeBuffer = QPixmap(rTitle.width(), rTitle.height()); QPainter p; QRect r(0, 0, activeBuffer.width(), activeBuffer.height()); p.begin(&activeBuffer); diff --git a/clients/laptop/laptopclient.h b/clients/laptop/laptopclient.h index 66195bb3ab..ce8b595c50 100644 --- a/clients/laptop/laptopclient.h +++ b/clients/laptop/laptopclient.h @@ -8,7 +8,7 @@ #define __KDECLIENT_H #include -#include +#include #include #include @@ -54,7 +54,7 @@ private: bool mustDrawHandle() const; bool isTransient() const; private: - KPixmap activeBuffer; + QPixmap activeBuffer; int lastBufferWidth; bool bufferDirty; }; diff --git a/clients/modernsystem/modernsys.cpp b/clients/modernsystem/modernsys.cpp index e77dcac293..ba12250778 100644 --- a/clients/modernsystem/modernsys.cpp +++ b/clients/modernsystem/modernsys.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -126,7 +127,7 @@ static void make_button_fx(const QColorGroup &g, QPixmap *pix, bool light=false) srcColor.setHsv(destH, destS, srcV); destData[i] = srcColor.rgb(); } - pix->convertFromImage(btnDest); + *pix = QPixmap::fromImage(btnDest); } else{ @@ -160,10 +161,8 @@ static void create_pixmaps() btnSource = new QImage(btnhighcolor_xpm); if(QPixmap::defaultDepth() > 8){ - aUpperGradient = new KPixmap; - aUpperGradient->resize(32, title_height+2); - iUpperGradient = new KPixmap; - iUpperGradient->resize(32, title_height+2); + aUpperGradient = new KPixmap( 32, title_height+2 ); + iUpperGradient = new KPixmap( 32, title_height+2);; KPixmapEffect::gradient(*aUpperGradient, options()->color(KDecoration::ColorTitleBar, true).light(130), options()->color(KDecoration::ColorTitleBlend, true), @@ -376,7 +375,7 @@ void ModernSys::reset( unsigned long changed) { KCommonDecoration::reset(changed); - titleBuffer.resize(0, 0); + titleBuffer = QPixmap(); recalcTitleBuffer(); resetButtons(); widget()->update(); @@ -517,7 +516,7 @@ void ModernSys::recalcTitleBuffer() return; QFontMetrics fm(options()->font(true)); - titleBuffer.resize(width(), title_height+2); + titleBuffer = QPixmap(width(), title_height+2); QPainter p; p.begin(&titleBuffer); if(aUpperGradient) diff --git a/clients/modernsystem/modernsys.h b/clients/modernsystem/modernsys.h index d6eef97175..55a9fa04d6 100644 --- a/clients/modernsystem/modernsys.h +++ b/clients/modernsystem/modernsys.h @@ -2,7 +2,6 @@ #define __MODSYSTEMCLIENT_H #include -#include #include #include diff --git a/clients/plastik/misc.cpp b/clients/plastik/misc.cpp index d29be4fab5..109f3c4981 100644 --- a/clients/plastik/misc.cpp +++ b/clients/plastik/misc.cpp @@ -20,7 +20,6 @@ Boston, MA 02110-1301, USA. */ -#include #include #include diff --git a/clients/plastik/plastik.cpp b/clients/plastik/plastik.cpp index daabe2cd59..5a8b875a33 100644 --- a/clients/plastik/plastik.cpp +++ b/clients/plastik/plastik.cpp @@ -240,7 +240,7 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow const int titleBarTileHeight = (toolWindow ? m_titleHeightTool : m_titleHeight) + 2; // gradient used as well in TitleBarTileTop as TitleBarTile const int gradientHeight = 2 + titleBarTileHeight-1; - QPixmap gradient(1, gradientHeight); + KPixmap gradient(1, gradientHeight); QPainter painter(&gradient); KPixmap tempPixmap( 1, 4 ); KPixmapEffect::gradient(tempPixmap, @@ -248,7 +248,7 @@ const QPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindow getColor(TitleGradient2, active), KPixmapEffect::VerticalGradient); painter.drawPixmap(0,0, tempPixmap); - tempPixmap.resize(1, gradientHeight-4); + tempPixmap = QPixmap(1, gradientHeight-4); KPixmapEffect::gradient(tempPixmap, getColor(TitleGradient2, active), getColor(TitleGradient3, active), diff --git a/clients/plastik/plastikbutton.cpp b/clients/plastik/plastikbutton.cpp index 11c24d86af..29eead9b21 100644 --- a/clients/plastik/plastikbutton.cpp +++ b/clients/plastik/plastikbutton.cpp @@ -27,8 +27,8 @@ #include #include #include -#include #include +#include #include #include "plastikbutton.h" @@ -173,7 +173,7 @@ void PlastikButton::drawButton(QPainter *painter) QRect r(0,0,width(),height()); bool active = m_client->isActive(); - KPixmap tempKPixmap; + KPixmap tempPixmap; QColor highlightColor; if(type() == CloseButton) { @@ -222,13 +222,13 @@ void PlastikButton::drawButton(QPainter *painter) bP.drawPoint(r.x()+1, r.bottom()-1); bP.drawPoint(r.right()-1, r.bottom()-1); // sides of the contour - tempKPixmap.resize(1, r.height()-2*2); - KPixmapEffect::gradient(tempKPixmap, + tempPixmap = QPixmap( 1, r.height()-2*2 ); + KPixmapEffect::gradient(tempPixmap, contourTop, contourBottom, KPixmapEffect::VerticalGradient); - bP.drawPixmap(r.x(), r.y()+2, tempKPixmap); - bP.drawPixmap(r.right(), r.y()+2, tempKPixmap); + bP.drawPixmap(r.x(), r.y()+2, tempPixmap); + bP.drawPixmap(r.right(), r.y()+2, tempPixmap); // sort of anti-alias for the contour bP.setPen(alphaBlendColors(Handler()->getColor(TitleGradient2, active), contourTop, 150) ); @@ -249,12 +249,12 @@ void PlastikButton::drawButton(QPainter *painter) bP.setPen(sourfaceBottom); bP.drawLine(r.x()+2, r.bottom()-1, r.right()-2, r.bottom()-1 ); // fill the rest! :) - tempKPixmap.resize(1, r.height()-2*2); - KPixmapEffect::gradient(tempKPixmap, + tempPixmap = QPixmap(1, r.height()-2*2); + KPixmapEffect::gradient(tempPixmap, sourfaceTop, sourfaceBottom, KPixmapEffect::VerticalGradient); - bP.drawTiledPixmap(r.x()+1, r.y()+2, r.width()-2, r.height()-4, tempKPixmap); + bP.drawTiledPixmap(r.x()+1, r.y()+2, r.width()-2, r.height()-4, tempPixmap); } if (type() == MenuButton) diff --git a/clients/quartz/quartz.cpp b/clients/quartz/quartz.cpp index 8ac7e7fd11..dd5a9453ee 100644 --- a/clients/quartz/quartz.cpp +++ b/clients/quartz/quartz.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "quartz.h" @@ -294,22 +295,20 @@ void QuartzHandler::drawBlocks( KPixmap *pi, KPixmap &p, const QColor &c1, const void QuartzHandler::createPixmaps() { // Obtain titlebar blend colours, and create the block stuff on pixmaps. - QColorGroup g2 = options()->palette(ColorTitleBlend, true).active(); + QColorGroup g2 = options()->palette(ColorTitleBlend, true).active(); QColor c2 = g2.background(); - g2 = options()->palette(ColorTitleBar, true ).active(); + g2 = options()->palette(ColorTitleBar, true ).active(); QColor c = g2.background().light(130); - titleBlocks = new KPixmap(); - titleBlocks->resize( normalTitleHeight*25/18, normalTitleHeight ); + titleBlocks = new KPixmap( normalTitleHeight*25/18, normalTitleHeight ); drawBlocks( titleBlocks, *titleBlocks, c, c2 ); - g2 = options()->palette(ColorTitleBlend, false).active(); + g2 = options()->palette(ColorTitleBlend, false).active(); c2 = g2.background(); - g2 = options()->palette(ColorTitleBar, false ).active(); + g2 = options()->palette(ColorTitleBar, false ).active(); c = g2.background().light(130); - ititleBlocks = new KPixmap(); - ititleBlocks->resize( normalTitleHeight*25/18, normalTitleHeight ); + ititleBlocks = new KPixmap( normalTitleHeight*25/18, normalTitleHeight ); drawBlocks( ititleBlocks, *ititleBlocks, c, c2 ); // Set the on all desktops pin pixmaps; @@ -320,16 +319,14 @@ void QuartzHandler::createPixmaps() c = onAllDesktopsButtonOnLeft ? g.background().light(130) : g.background(); g2 = options()->palette( ColorButtonBg, true ).active(); - pinUpPix = new KPixmap(); - pinUpPix->resize(16, 16); + pinUpPix = new KPixmap(16, 16); p.begin( pinUpPix ); p.fillRect( 0, 0, 16, 16, c); kColorBitmaps( &p, g2, 0, 1, 16, 16, true, pinup_white_bits, pinup_gray_bits, NULL, NULL, pinup_dgray_bits, NULL ); p.end(); - pinDownPix = new KPixmap(); - pinDownPix->resize(16, 16); + pinDownPix = new KPixmap(16, 16); p.begin( pinDownPix ); p.fillRect( 0, 0, 16, 16, c); kColorBitmaps( &p, g2, 0, 1, 16, 16, true, pindown_white_bits, @@ -342,16 +339,14 @@ void QuartzHandler::createPixmaps() c = onAllDesktopsButtonOnLeft ? g.background().light(130) : g.background(); g2 = options()->palette( ColorButtonBg, false ).active(); - ipinUpPix = new KPixmap(); - ipinUpPix->resize(16, 16); + ipinUpPix = new KPixmap(16, 16); p.begin( ipinUpPix ); p.fillRect( 0, 0, 16, 16, c); kColorBitmaps( &p, g2, 0, 1, 16, 16, true, pinup_white_bits, pinup_gray_bits, NULL, NULL, pinup_dgray_bits, NULL ); p.end(); - ipinDownPix = new KPixmap(); - ipinDownPix->resize(16, 16); + ipinDownPix = new KPixmap(16, 16); p.begin( ipinDownPix ); p.fillRect( 0, 0, 16, 16, c); kColorBitmaps( &p, g2, 0, 1, 16, 16, true, pindown_white_bits, @@ -498,10 +493,8 @@ void QuartzButton::drawButton(QPainter *p) // Shrink the miniIcon for tiny titlebars. if ( height() < 16) { - QPixmap tmpPix; - // Smooth scale the image - tmpPix.convertFromImage( btnpix.toImage().scaled(height(), height(), Qt::IgnoreAspectRatio,Qt::SmoothTransformation)); + QPixmap tmpPix = QPixmap::fromImage( btnpix.toImage().scaled(height(), height(), Qt::IgnoreAspectRatio,Qt::SmoothTransformation)); p->drawPixmap( 0, 0, tmpPix ); } else { Offset += (height() - 16)/2; @@ -748,8 +741,7 @@ void QuartzClient::paintEvent( QPaintEvent* ) QColor c2 = options()->color(ColorTitleBlend, isActive() ); // Create a disposable pixmap buffer for the titlebar - KPixmap* titleBuffer = new KPixmap; - titleBuffer->resize( maxFull?w-2:(w-2*(borderSize-1)), titleHeight ); + QPixmap* titleBuffer = new QPixmap( maxFull?w-2:(w-2*(borderSize-1)), titleHeight ); QPainter p2( titleBuffer ); diff --git a/clients/quartz/quartz.h b/clients/quartz/quartz.h index 52e41fc80e..4266a02036 100644 --- a/clients/quartz/quartz.h +++ b/clients/quartz/quartz.h @@ -17,7 +17,6 @@ #define __KDEGALLIUM_QUARTZ_H #include -#include #include "../../lib/kcommondecoration.h" #include "../../lib/kdecorationfactory.h" diff --git a/clients/redmond/redmond.cpp b/clients/redmond/redmond.cpp index 16e055daa6..f758bb07b5 100644 --- a/clients/redmond/redmond.cpp +++ b/clients/redmond/redmond.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -90,7 +91,7 @@ static KPixmap *iMiniBtnPix1; static KPixmap *miniBtnDownPix1; static KPixmap *iMiniBtnDownPix1; -static QPixmap *defaultMenuPix; +static KPixmap *defaultMenuPix; static QColor *btnForeground; static bool pixmaps_created = false; @@ -103,7 +104,7 @@ static inline const KDecorationOptions *options() return KDecoration::options(); } -static void drawButtonFrame( KPixmap *pix, const QColorGroup &g, bool sunken ) +static void drawButtonFrame( QPixmap *pix, const QColorGroup &g, bool sunken ) { QPainter p; int x2 = pix->width() - 1; @@ -149,20 +150,20 @@ static void create_pixmaps () miniBtnDownPix1 = new KPixmap; iMiniBtnPix1 = new KPixmap; iMiniBtnDownPix1 = new KPixmap; - defaultMenuPix = new QPixmap(kdelogo); + defaultMenuPix = new KPixmap(kdelogo); // buttons (active/inactive, sunken/unsunken) QColorGroup g = options()->palette(KDecoration::ColorButtonBg, true).active(); QColor c = g.background(); - btnPix1->resize(normalTitleHeight, normalTitleHeight-2); - btnDownPix1->resize(normalTitleHeight, normalTitleHeight-2); - iBtnPix1->resize(normalTitleHeight, normalTitleHeight-2); - iBtnDownPix1->resize(normalTitleHeight, normalTitleHeight-2); + *btnPix1 = QPixmap(normalTitleHeight, normalTitleHeight-2); + *btnDownPix1 = QPixmap(normalTitleHeight, normalTitleHeight-2); + *iBtnPix1 = QPixmap(normalTitleHeight, normalTitleHeight-2); + *iBtnDownPix1 = QPixmap(normalTitleHeight, normalTitleHeight-2); - miniBtnPix1->resize(toolTitleHeight, toolTitleHeight); - miniBtnDownPix1->resize(toolTitleHeight, toolTitleHeight); - iMiniBtnPix1->resize(toolTitleHeight, toolTitleHeight); - iMiniBtnDownPix1->resize(toolTitleHeight, toolTitleHeight); + *miniBtnPix1 = QPixmap(toolTitleHeight, toolTitleHeight); + *miniBtnDownPix1 = QPixmap(toolTitleHeight, toolTitleHeight); + *iMiniBtnPix1 = QPixmap(toolTitleHeight, toolTitleHeight); + *iMiniBtnDownPix1 = QPixmap(toolTitleHeight, toolTitleHeight); if (highcolor && false) { KPixmapEffect::gradient(*btnPix1, c.light(130), c.dark(130), @@ -280,7 +281,7 @@ void RedmondButton::reset(unsigned long changed) void RedmondButton::setBitmap(const unsigned char *bitmap) { - pix.resize(0, 0); + pix = QPixmap(); if (bitmap) deco = QBitmap(10, 10, bitmap, true); @@ -294,7 +295,7 @@ void RedmondButton::setBitmap(const unsigned char *bitmap) void RedmondButton::setPixmap( const QPixmap &p ) { - deco.resize(0, 0); + deco = QPixmap(); pix = p; repaint(false); @@ -335,11 +336,10 @@ void RedmondButton::drawButton(QPainter *p) } if ( type()==MenuButton && height() < 16) { - QPixmap tmpPix; - // Smooth scale the menu button pixmap - tmpPix.convertFromImage( - pix.toImage().scaled( height(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation )); + // Smooth scale the menu button pixmap + QPixmap tmpPix = QPixmap::fromImage( + pix.toImage().scaled( height(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation )); p->drawPixmap( 0, 0, tmpPix ); } else { @@ -547,7 +547,7 @@ void RedmondDeco::paintEvent( QPaintEvent* ) // Create a disposable pixmap buffer for the title blend KPixmap* titleBuffer = new KPixmap; - titleBuffer->resize(w-2*modBorderWidth, titleHeight); + *titleBuffer = QPixmap(w-2*modBorderWidth, titleHeight); if (titleBuffer->depth() > 16) { KPixmapEffect::gradient(*titleBuffer, c1, c2, diff --git a/clients/redmond/redmond.h b/clients/redmond/redmond.h index 035e4104ca..bdde3361f8 100644 --- a/clients/redmond/redmond.h +++ b/clients/redmond/redmond.h @@ -19,7 +19,6 @@ #define __KDE_REDMOND_H #include -#include #include #include