mirror of
https://github.com/KDE/konsole.git
synced 2026-05-19 12:09:25 -04:00
Center decoration in 'Show In Menu' column of Manage Profiles dialog. I'm sure there must be an easier way.
svn path=/trunk/KDE/kdebase/apps/konsole/; revision=708382
This commit is contained in:
@@ -296,6 +296,19 @@ ProfileItemDelegate::ProfileItemDelegate(QObject* parent)
|
||||
: QItemDelegate(parent)
|
||||
{
|
||||
}
|
||||
// Is there a simpler way of centering the decoration than re-implementing
|
||||
// drawDecoration?
|
||||
void ProfileItemDelegate::drawDecoration(QPainter* painter,
|
||||
const QStyleOptionViewItem& option,
|
||||
const QRect& rect,const QPixmap& pixmap) const
|
||||
{
|
||||
QStyleOptionViewItem centeredOption(option);
|
||||
centeredOption.decorationAlignment = Qt::AlignCenter;
|
||||
QItemDelegate::drawDecoration(painter,
|
||||
centeredOption,
|
||||
QStyle::alignedRect(Qt::LeftToRight,Qt::AlignCenter,rect.size(),option.rect),
|
||||
pixmap);
|
||||
}
|
||||
bool ProfileItemDelegate::editorEvent(QEvent* event,QAbstractItemModel*,
|
||||
const QStyleOptionViewItem&,const QModelIndex& index)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user