svn path=/trunk/KDE/kdebase/apps/; revision=938051
const KStyleOptionToolTip *option,
const KToolTipItem *item) const
{
const KStyleOptionToolTip *option,
const KToolTipItem *item) const
{
+ QColor toColor = option->palette.brush(QPalette::ToolTipBase).color();
+ QColor fromColor = KColorScheme::shade(toColor, KColorScheme::LightShade, 0.2);
+
QPainterPath path = createPath(*option);
if (haveAlphaChannel()) {
painter->setRenderHint(QPainter::Antialiasing);
painter->translate(.5, .5);
QPainterPath path = createPath(*option);
if (haveAlphaChannel()) {
painter->setRenderHint(QPainter::Antialiasing);
painter->translate(.5, .5);
+ toColor.setAlpha(220);
+ fromColor.setAlpha(220);
- const QColor toColor = option->palette.brush(QPalette::ToolTipBase).color();
- const QColor fromColor = KColorScheme::shade(toColor, KColorScheme::LightShade, 0.2);
QLinearGradient gradient(option->rect.topLeft(), option->rect.bottomLeft());
gradient.setColorAt(0.0, fromColor);
QLinearGradient gradient(option->rect.topLeft(), option->rect.bottomLeft());
gradient.setColorAt(0.0, fromColor);
class QWidgetLabel : public QWidget, public KAbstractToolTipLabel
{
public:
class QWidgetLabel : public QWidget, public KAbstractToolTipLabel
{
public:
- QWidgetLabel() : QWidget(0, Qt::ToolTip) {}
void showTip(const QPoint &pos, const KToolTipItem *item);
void moveTip(const QPoint &pos);
void hideTip();
void showTip(const QPoint &pos, const KToolTipItem *item);
void moveTip(const QPoint &pos);
void hideTip();
const KToolTipItem *currentItem;
};
const KToolTipItem *currentItem;
};
+QWidgetLabel::QWidgetLabel() : QWidget(0, Qt::ToolTip)
+{
+ if (KToolTipManager::instance()->haveAlphaChannel()) {
+ setAttribute(Qt::WA_TranslucentBackground);
+ }
+}
+
void QWidgetLabel::showTip(const QPoint &pos, const KToolTipItem *item)
{
currentItem = item;
void QWidgetLabel::showTip(const QPoint &pos, const KToolTipItem *item)
{
currentItem = item;