mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kio: remove unused KFileItemDelegate::Private::transition() method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
964f78287f
commit
5e358d3015
1 changed files with 0 additions and 58 deletions
|
@ -93,7 +93,6 @@ class KFileItemDelegate::Private
|
||||||
void drawTextItems(QPainter *painter, const QTextLayout &labelLayout, const QTextLayout &infoLayout,
|
void drawTextItems(QPainter *painter, const QTextLayout &labelLayout, const QTextLayout &infoLayout,
|
||||||
const QRect &textBoundingRect) const;
|
const QRect &textBoundingRect) const;
|
||||||
QPixmap applyHoverEffect(const QPixmap &icon) const;
|
QPixmap applyHoverEffect(const QPixmap &icon) const;
|
||||||
QPixmap transition(const QPixmap &from, const QPixmap &to, qreal amount) const;
|
|
||||||
void initStyleOption(QStyleOptionViewItemV4 *option, const QModelIndex &index) const;
|
void initStyleOption(QStyleOptionViewItemV4 *option, const QModelIndex &index) const;
|
||||||
void drawFocusRect(QPainter *painter, const QStyleOptionViewItemV4 &option, const QRect &rect) const;
|
void drawFocusRect(QPainter *painter, const QStyleOptionViewItemV4 &option, const QRect &rect) const;
|
||||||
|
|
||||||
|
@ -554,63 +553,6 @@ QPixmap KFileItemDelegate::Private::applyHoverEffect(const QPixmap &icon) const
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap KFileItemDelegate::Private::transition(const QPixmap &from, const QPixmap &to, qreal amount) const
|
|
||||||
{
|
|
||||||
int value = int(0xff * amount);
|
|
||||||
|
|
||||||
if (value == 0 || to.isNull())
|
|
||||||
return from;
|
|
||||||
|
|
||||||
if (value == 0xff || from.isNull())
|
|
||||||
return to;
|
|
||||||
|
|
||||||
QColor color;
|
|
||||||
color.setAlphaF(amount);
|
|
||||||
|
|
||||||
// If the native paint engine supports Porter/Duff compositing and CompositionMode_Plus
|
|
||||||
if (from.paintEngine()->hasFeature(QPaintEngine::PorterDuff) &&
|
|
||||||
from.paintEngine()->hasFeature(QPaintEngine::BlendModes))
|
|
||||||
{
|
|
||||||
QPixmap under = from;
|
|
||||||
QPixmap over = to;
|
|
||||||
|
|
||||||
QPainter p;
|
|
||||||
p.begin(&over);
|
|
||||||
p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
|
|
||||||
p.fillRect(over.rect(), color);
|
|
||||||
p.end();
|
|
||||||
|
|
||||||
p.begin(&under);
|
|
||||||
p.setCompositionMode(QPainter::CompositionMode_DestinationOut);
|
|
||||||
p.fillRect(under.rect(), color);
|
|
||||||
p.setCompositionMode(QPainter::CompositionMode_Plus);
|
|
||||||
p.drawPixmap(0, 0, over);
|
|
||||||
p.end();
|
|
||||||
|
|
||||||
return under;
|
|
||||||
} else {
|
|
||||||
// Fall back to using QRasterPaintEngine to do the transition.
|
|
||||||
QImage under = from.toImage();
|
|
||||||
QImage over = to.toImage();
|
|
||||||
|
|
||||||
QPainter p;
|
|
||||||
p.begin(&over);
|
|
||||||
p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
|
|
||||||
p.fillRect(over.rect(), color);
|
|
||||||
p.end();
|
|
||||||
|
|
||||||
p.begin(&under);
|
|
||||||
p.setCompositionMode(QPainter::CompositionMode_DestinationOut);
|
|
||||||
p.fillRect(under.rect(), color);
|
|
||||||
p.setCompositionMode(QPainter::CompositionMode_Plus);
|
|
||||||
p.drawImage(0, 0, over);
|
|
||||||
p.end();
|
|
||||||
|
|
||||||
return QPixmap::fromImage(under);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void KFileItemDelegate::Private::layoutTextItems(const QStyleOptionViewItemV4 &option, const QModelIndex &index,
|
void KFileItemDelegate::Private::layoutTextItems(const QStyleOptionViewItemV4 &option, const QModelIndex &index,
|
||||||
QTextLayout *labelLayout, QTextLayout *infoLayout,
|
QTextLayout *labelLayout, QTextLayout *infoLayout,
|
||||||
QRect *textBoundingRect) const
|
QRect *textBoundingRect) const
|
||||||
|
|
Loading…
Add table
Reference in a new issue