From cc0ad49c75d6cf6b4e63eb8c6012afe55c1589f9 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 15 Feb 2011 19:15:16 +0000 Subject: Allow kdebase to (mostly) function correctly with TQt for Qt4 Fix kicker tackbar handling under Classic mode (thanks to Ilya Chernykh for the patch) Fix a newly invalidated section of code under GCC 4.5.2 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47723#c6) git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1220927 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kicker/taskbar/taskbar.cpp | 6 +++--- kicker/taskbar/taskcontainer.cpp | 25 +++++++++++++++---------- 2 files changed, 18 insertions(+), 13 deletions(-) (limited to 'kicker/taskbar') diff --git a/kicker/taskbar/taskbar.cpp b/kicker/taskbar/taskbar.cpp index b2159c196..c1204598a 100644 --- a/kicker/taskbar/taskbar.cpp +++ b/kicker/taskbar/taskbar.cpp @@ -1074,7 +1074,7 @@ void TaskBar::activateNextTask(bool forward) TaskContainer::List::iterator it; for (int i = 0; i < numContainers; ++i) { - it = forward ? list.at(i) : list.at(numContainers - i - 1); + it = forward ? list.tqat(i) : list.tqat(numContainers - i - 1); if (it != list.end() && (*it)->activateNextTask(forward, forcenext)) { @@ -1087,7 +1087,7 @@ void TaskBar::activateNextTask(bool forward) // moving forward from the last, or backward from the first, loop around for (int i = 0; i < numContainers; ++i) { - it = forward ? list.at(i) : list.at(numContainers - i - 1); + it = forward ? list.tqat(i) : list.tqat(numContainers - i - 1); if (it != list.end() && (*it)->activateNextTask(forward, forcenext)) { @@ -1101,7 +1101,7 @@ void TaskBar::activateNextTask(bool forward) forcenext = true; // select first for (int i = 0; i < numContainers; ++i) { - it = forward ? list.at(i) : list.at(numContainers - i - 1); + it = forward ? list.tqat(i) : list.tqat(numContainers - i - 1); if (it == list.end()) { diff --git a/kicker/taskbar/taskcontainer.cpp b/kicker/taskbar/taskcontainer.cpp index 345fcb1f9..749c33c03 100644 --- a/kicker/taskbar/taskcontainer.cpp +++ b/kicker/taskbar/taskcontainer.cpp @@ -233,9 +233,9 @@ void TaskContainer::setLastActivated() void TaskContainer::animationTimerFired() { - if (!frames.isEmpty() && taskBar->showIcon() && frames.at(currentFrame) != frames.end()) + if (!frames.isEmpty() && taskBar->showIcon() && frames.tqat(currentFrame) != frames.end()) { - TQPixmap *pm = *frames.at(currentFrame); + TQPixmap *pm = *frames.tqat(currentFrame); // draw pixmap if ( pm && !pm->isNull() ) { @@ -586,9 +586,9 @@ void TaskContainer::drawButton(TQPainter *p) // draw button background if (drawButton) { - tqstyle().tqdrawPrimitive(TQStyle::PE_HeaderSection, p, - TQRect(0, 0, width(), height()), - colors); + tqstyle().tqdrawPrimitive(TQStyle::PE_ButtonTool, p, + TQRect(1, 1, width()-2, height()-2), + colors, sunken ? TQStyle::Style_Down : TQStyle::Style_Raised); } // shift button label on sunken buttons @@ -684,11 +684,11 @@ void TaskContainer::drawButton(TQPainter *p) } else { - textPen = p->pen(); + textPen = TQPen(colors.buttonText()); // textPen = p->pen(); } } - int availableWidth = width() - (br.x() * 2) - textPos; + int availableWidth = width() - (br.x() * 2) - textPos - 2; if (m_filteredTasks.count() > 1) { availableWidth -= 8; @@ -721,7 +721,12 @@ void TaskContainer::drawButton(TQPainter *p) TQImage img = pm->convertToImage(); TQImage timg = tpm.convertToImage(); KImageEffect::blend(img, timg, *taskBar->blendGradient(size()), KImageEffect::Red); + + // End painting before assigning the pixmap + QPaintDevice* opd = p->device(); + p->end(); pm->convertFromImage(img); + p->tqbegin(opd ,this); } else { @@ -739,9 +744,9 @@ void TaskContainer::drawButton(TQPainter *p) } } - if (!frames.isEmpty() && m_startup && frames.at(currentFrame) != frames.end()) + if (!frames.isEmpty() && m_startup && frames.tqat(currentFrame) != frames.end()) { - TQPixmap *anim = *frames.at(currentFrame); + TQPixmap *anim = *frames.tqat(currentFrame); if (anim && !anim->isNull()) { @@ -841,7 +846,7 @@ TQString TaskContainer::name() } // strip trailing crap - while (i > 0 && !match.at(i).isLetterOrNumber()) + while (i > 0 && !match.tqat(i).isLetterOrNumber()) { --i; } -- cgit v1.2.1