浏览代码

UI: Fix position of Sources dock actions on horizontal resize

Attempting to resize the Sources dock to be smaller than when initially
loaded would result in the contents of the list to never shrink.
Switching to another scene & back would temporary fix the sizing.

Fixes an issue introduced in adba393ca85fba19ed1bf6cd825ab8188beb2d16
Matt Gajownik 3 年之前
父节点
当前提交
ad68380910
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      UI/source-tree.cpp

+ 2 - 2
UI/source-tree.cpp

@@ -1751,7 +1751,7 @@ SourceTreeDelegate::SourceTreeDelegate(QObject *parent)
 {
 {
 }
 }
 
 
-QSize SourceTreeDelegate::sizeHint(const QStyleOptionViewItem &,
+QSize SourceTreeDelegate::sizeHint(const QStyleOptionViewItem &option,
 				   const QModelIndex &index) const
 				   const QModelIndex &index) const
 {
 {
 	SourceTree *tree = qobject_cast<SourceTree *>(parent());
 	SourceTree *tree = qobject_cast<SourceTree *>(parent());
@@ -1760,5 +1760,5 @@ QSize SourceTreeDelegate::sizeHint(const QStyleOptionViewItem &,
 	if (!item)
 	if (!item)
 		return (QSize(0, 0));
 		return (QSize(0, 0));
 
 
-	return (QSize(item->width(), item->height()));
+	return (QSize(option.widget->minimumWidth(), item->height()));
 }
 }