UI: Fix source item widget color height
The background color of the source tree item widgets wouldn't be rendered properly.
This commit is contained in:
parent
a4f486517f
commit
adba393ca8
7 changed files with 62 additions and 6 deletions
|
|
@ -1088,6 +1088,8 @@ SourceTree::SourceTree(QWidget *parent_) : QListView(parent_)
|
|||
connect(App(), &OBSApp::StyleChanged, this,
|
||||
&SourceTree::UpdateNoSourcesMessage);
|
||||
connect(App(), &OBSApp::StyleChanged, this, &SourceTree::UpdateIcons);
|
||||
|
||||
setItemDelegate(new SourceTreeDelegate(this));
|
||||
}
|
||||
|
||||
void SourceTree::UpdateIcons()
|
||||
|
|
@ -1743,3 +1745,17 @@ void SourceTree::paintEvent(QPaintEvent *event)
|
|||
QListView::paintEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
SourceTreeDelegate::SourceTreeDelegate(QObject *parent)
|
||||
: QStyledItemDelegate(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QSize SourceTreeDelegate::sizeHint(const QStyleOptionViewItem &,
|
||||
const QModelIndex &index) const
|
||||
{
|
||||
SourceTree *tree = qobject_cast<SourceTree *>(parent());
|
||||
QWidget *item = tree->indexWidget(index);
|
||||
|
||||
return (QSize(item->width(), item->height()));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue