Adjust horizontal gap between icons in grid view to equal distribute
icons over space. Issue #1169
This commit is contained in:
@@ -40,6 +40,7 @@ ListView::ListView(QWidget *parent)
|
||||
, eventFilter(nullptr)
|
||||
, menu(nullptr)
|
||||
, zoomLevel(1.0)
|
||||
, prevWidth(0)
|
||||
{
|
||||
setDragEnabled(true);
|
||||
setContextMenuPolicy(Qt::NoContextMenu);
|
||||
@@ -140,6 +141,15 @@ void ListView::paintEvent(QPaintEvent *e)
|
||||
QListView::paintEvent(e);
|
||||
}
|
||||
|
||||
void ListView::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
QListView::resizeEvent(e);
|
||||
if (IconMode==viewMode() && width()!=prevWidth) {
|
||||
emit widthChanged();
|
||||
prevWidth=width();
|
||||
}
|
||||
}
|
||||
|
||||
// Workaround for https://bugreports.qt-project.org/browse/QTBUG-18009
|
||||
void ListView::correctSelection()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user