| Summary: | Panel buttons and taskbar background render incorrectly with transperancy enabled | ||
|---|---|---|---|
| Product: | [Unmaintained] kicker | Reporter: | Nick Thompson <nickthompson> |
| Component: | general | Assignee: | Aaron J. Seigo <aseigo> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | corrupt kicker backgrounds | ||
|
Description
Nick Thompson
2005-09-23 17:42:40 UTC
Created attachment 12672 [details]
corrupt kicker backgrounds
SVN commit 463429 by aseigo:
paint button backgrounds properly
BUGS:113093,113160
M +50 -2 kicker/core/container_button.cpp
M +6 -2 libkicker/panelbutton.cpp
--- branches/KDE/3.5/kdebase/kicker/kicker/core/container_button.cpp #463428:463429
@@ -36,6 +36,7 @@
#include "global.h"
#include "appletop_mnu.h"
+#include "containerarea.h"
#include "panelbutton.h"
#include "bookmarksbutton.h"
#include "browserbutton.h"
@@ -43,6 +44,7 @@
#include "extensionbutton.h"
#include "kbutton.h"
#include "kicker.h"
+#include "kickerSettings.h"
#include "kickertip.h"
#include "nonkdeappbutton.h"
#include "paneldrag.h"
@@ -94,13 +96,59 @@
return width;
}
+#include <iostream>
+using namespace std;
void ButtonContainer::setBackground()
{
PanelButton* b = button();
- if (b)
+ if (!b)
{
- b->repaint();
+ return;
}
+
+cout << "ButtonContainer::setBackground()" << endl;
+ b->unsetPalette();
+
+ if (!KickerSettings::transparent())
+ {
+ b->update();
+ return;
+ }
+
+ // inheritance is ButtonContainer - ScrollView - ContainerArea
+ ContainerArea* area = 0;
+ QObject* ancestor = parent();
+ while (ancestor && !area)
+ {
+ area = dynamic_cast<ContainerArea*>(ancestor);
+ ancestor = ancestor->parent();
+ }
+
+ const QPixmap* containerBG = area ? area->completeBackgroundPixmap()
+ : 0;
+
+ if (!containerBG || containerBG->isNull())
+ {
+cout << "\tsetting no background!" << endl;
+ b->setPaletteBackgroundPixmap(QPixmap());
+ }
+ else
+ {
+ int srcx = x();
+ int srcy = y();
+ int buttonWidth = b->width();
+ int buttonHeight = b->height();
+
+ QPixmap buttonBackground(buttonWidth, buttonHeight);
+ copyBlt(&buttonBackground, 0, 0,
+ containerBG, srcx, srcy,
+ buttonWidth, buttonHeight);
+
+ b->setPaletteBackgroundPixmap(buttonBackground);
+ cout << "\tbackground set!" << endl;
+ }
+
+ b->update();
}
void ButtonContainer::configure()
--- branches/KDE/3.5/kdebase/kicker/libkicker/panelbutton.cpp #463428:463429
@@ -502,13 +502,17 @@
void PanelButton::drawButton(QPainter *p)
{
- // Draw the background. This is always needed, even when using tiles,
- // because they don't have to cover the entire button.
if (m_tileColor.isValid())
{
p->fillRect(rect(), m_tileColor);
style().drawPrimitive(QStyle::PE_Panel, p, rect(), colorGroup());
}
+ else if (paletteBackgroundPixmap())
+ {
+ // Draw the background. This is always needed, even when using tiles,
+ // because they don't have to cover the entire button.
+ p->drawPixmap(0, 0, *paletteBackgroundPixmap());
+ }
const QPixmap& tile = (isDown() || isOn()) ? m_down : m_up;
if (!tile.isNull())
Panel buttons seem much less likely to suffer from the effects I attached in the previous screen shot after updating only the two files patched. But it does still happen. I'm finding it very difficult to reproduce now though. I didn't screenshot it when I got it to happen because it looks the same as before. Also the taskbar, systray, clock and logout/lock applet backgrounds all still get turned to grey, as in my previous screen shot. (I really wish KDE had anonymous svn+http access. Damn file walls :( ) I seem to be able to reproduce it a lot easier now. If mouse over doesn't cause the issue, then clicking on one of the buttons seems to put it in a bad state. After clicking on a button, its background get corrupted as before, but mousing over further buttons, corrupts them as well now. Mouse over now seems to stay in that bad state. Clicking a button again, puts it back into a good state, correcting the button backgrounds as I mouse over the icons. The taskbar etc background corruptions, still seems to happen randomly as I change desktops. Sometimes it right, sometimes its wrong. Its about 50-50. |