Polish the rough edges out of the gradient painting code.
svn path=/trunk/KDE/kdelibs/; revision=891051
This commit is contained in:
parent
0fd4c5e3b2
commit
629a3b3789
@ -300,8 +300,8 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
|
|||||||
const QColor gradientColor =
|
const QColor gradientColor =
|
||||||
KColorScheme(QPalette::Active).background(KColorScheme::NormalBackground).color();
|
KColorScheme(QPalette::Active).background(KColorScheme::NormalBackground).color();
|
||||||
if (option.direction == Qt::LeftToRight) {
|
if (option.direction == Qt::LeftToRight) {
|
||||||
if ((titleRect.width() + 20) > option.rect.width() ||
|
if ((titleRect.width() + 60) > option.rect.width() ||
|
||||||
(subTitleRect.width() + 20) > option.rect.width()) {
|
(subTitleRect.width() + 60) > option.rect.width()) {
|
||||||
QLinearGradient gr;
|
QLinearGradient gr;
|
||||||
QRect gradientRect(option.rect.width() - 30, titleRect.y(),
|
QRect gradientRect(option.rect.width() - 30, titleRect.y(),
|
||||||
80, titleRect.height() + subTitleRect.height());
|
80, titleRect.height() + subTitleRect.height());
|
||||||
@ -315,8 +315,8 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (titleRect.width() + 20 > option.rect.width() ||
|
if (titleRect.width() + 60 > option.rect.width() ||
|
||||||
subTitleRect.width() + 20 > option.rect.width()) {
|
subTitleRect.width() + 60 > option.rect.width()) {
|
||||||
QLinearGradient gr;
|
QLinearGradient gr;
|
||||||
QRect gradientRect(option.rect.x() - 25, titleRect.y(),
|
QRect gradientRect(option.rect.x() - 25, titleRect.y(),
|
||||||
60, titleRect.height() + subTitleRect.height());
|
60, titleRect.height() + subTitleRect.height());
|
||||||
|
@ -79,6 +79,7 @@ public:
|
|||||||
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option,
|
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option,
|
||||||
const QModelIndex &index) const;
|
const QModelIndex &index) const;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Returns the empty area after the title.
|
* Returns the empty area after the title.
|
||||||
|
@ -72,6 +72,7 @@ ToolBox::ToolBox(Containment *parent)
|
|||||||
: QGraphicsItem(parent),
|
: QGraphicsItem(parent),
|
||||||
d(new ToolBoxPrivate(parent))
|
d(new ToolBoxPrivate(parent))
|
||||||
{
|
{
|
||||||
|
d->userMoved = false;
|
||||||
setAcceptsHoverEvents(true);
|
setAcceptsHoverEvents(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user