mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Third attempt for fixing the layout issue, this time without side effects and only with very minor performance overhead...
svn path=/trunk/KDE/kdebase/apps/; revision=791824
This commit is contained in:
parent
b6f970d355
commit
e8cb5a292d
2 changed files with 15 additions and 0 deletions
|
@ -133,6 +133,18 @@ DolphinIconsView::~DolphinIconsView()
|
|||
m_categoryDrawer = 0;
|
||||
}
|
||||
|
||||
void DolphinIconsView::dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight)
|
||||
{
|
||||
KCategorizedView::dataChanged(topLeft, bottomRight);
|
||||
|
||||
KCategorizedSortFilterProxyModel* proxyModel = dynamic_cast<KCategorizedSortFilterProxyModel*>(model());
|
||||
if ((flow() == QListView::LeftToRight) && !proxyModel->isCategorizedModel()) {
|
||||
// bypass a QListView issue that items are not layout correctly if the decoration size of
|
||||
// an index changes
|
||||
scheduleDelayedItemsLayout();
|
||||
}
|
||||
}
|
||||
|
||||
QStyleOptionViewItem DolphinIconsView::viewOptions() const
|
||||
{
|
||||
QStyleOptionViewItem viewOptions = KCategorizedView::viewOptions();
|
||||
|
|
|
@ -48,6 +48,9 @@ public:
|
|||
explicit DolphinIconsView(QWidget* parent, DolphinController* controller);
|
||||
virtual ~DolphinIconsView();
|
||||
|
||||
protected slots:
|
||||
virtual void dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
|
||||
|
||||
protected:
|
||||
virtual QStyleOptionViewItem viewOptions() const;
|
||||
virtual void contextMenuEvent(QContextMenuEvent* event);
|
||||
|
|
Loading…
Reference in a new issue