fix: attempt to fix display issues on Windows
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
af8eabbc3a
commit
b8fa65b8d2
@ -28,8 +28,12 @@ void InstanceDelegate::initStyleOption(QStyleOptionViewItem* option, const QMode
|
|||||||
QStyledItemDelegate::initStyleOption(option, index);
|
QStyledItemDelegate::initStyleOption(option, index);
|
||||||
if (index.column() == InstanceList::NameColumn) {
|
if (index.column() == InstanceList::NameColumn) {
|
||||||
option->decorationSize = QSize(m_iconSize, m_iconSize);
|
option->decorationSize = QSize(m_iconSize, m_iconSize);
|
||||||
if (m_isGrid) // FIXME: kinda hacky way to add vertical padding. This assumes that the icon is square in the first place
|
if (m_isGrid) {
|
||||||
|
option->decorationAlignment = Qt::AlignCenter;
|
||||||
|
option->displayAlignment = Qt::AlignHCenter | Qt::AlignTop;
|
||||||
|
// FIXME: kinda hacky way to add vertical padding. This assumes that the icon is square in the first place
|
||||||
option->decorationSize.rheight() += 8;
|
option->decorationSize.rheight() += 8;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,6 +41,6 @@ QSize InstanceDelegate::sizeHint(const QStyleOptionViewItem& option, const QMode
|
|||||||
{
|
{
|
||||||
QSize s = QStyledItemDelegate::sizeHint(option, index);
|
QSize s = QStyledItemDelegate::sizeHint(option, index);
|
||||||
if (m_isGrid)
|
if (m_isGrid)
|
||||||
return s.expandedTo(QSize(m_iconSize * 2, m_iconSize * 2));
|
s.rheight() = std::max(s.height(), m_iconSize * 2);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user