mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
Add more custom colors to the side bar elements so we can theme selected items
This commit is contained in:
@ -50,7 +50,13 @@ void YACReaderReadingListsViewItemDeletegate::paint(QPainter *painter, const QSt
|
||||
return;
|
||||
}
|
||||
|
||||
QStyledItemDelegate::paint(painter, option, index);
|
||||
// Promote hover to selected so QIcon::Selected mode activates on mouse-over,
|
||||
// matching the QSS which already uses the same background for hover and selected.
|
||||
QStyleOptionViewItem opt = option;
|
||||
if (opt.state & QStyle::State_MouseOver)
|
||||
opt.state |= QStyle::State_Selected;
|
||||
|
||||
QStyledItemDelegate::paint(painter, opt, index);
|
||||
}
|
||||
|
||||
QSize YACReaderReadingListsViewItemDeletegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
|
||||
Reference in New Issue
Block a user