Skip to content

Commit 0619056

Browse files
committed
MusicBrainz dialog section-resize fix plus cleanup
1 parent 0322ac6 commit 0619056

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/library/dlgtagfetcher.cpp

+5-8
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@ void DlgTagFetcher::init() {
8585
connect(&m_tagFetcher, &TagFetcher::fetchProgress, this, &DlgTagFetcher::fetchTagProgress);
8686
connect(&m_tagFetcher, &TagFetcher::networkError, this, &DlgTagFetcher::slotNetworkResult);
8787

88-
// Resize columns, this can't be set in the ui file
89-
results->setColumnWidth(0, 160); // Title column
90-
results->setColumnWidth(1, 160); // Artist column
91-
results->setColumnWidth(2, 160); // Album column
92-
results->setColumnWidth(3, 50); // Year column
93-
results->setColumnWidth(4, 50); // Track (numbers) column
94-
results->setColumnWidth(5, 160); // Album artist column
9588
}
9689

9790
void DlgTagFetcher::slotNext() {
@@ -307,7 +300,11 @@ void DlgTagFetcher::updateStack() {
307300
}
308301
}
309302

310-
results->header()->resizeSections(QHeaderView::ResizeToContents);
303+
for (int i = 0; i < results->model()->columnCount(); i++) {
304+
results->resizeColumnToContents(i);
305+
int sectionSize = (results->columnWidth(i) + 10);
306+
results->header()->resizeSection(i, sectionSize);
307+
}
311308

312309
// Find the item that was selected last time
313310
for (int i = 0; i < results->model()->rowCount(); ++i) {

src/library/dlgtagfetcher.ui

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<number>50</number>
4747
</attribute>
4848
<attribute name="headerStretchLastSection">
49-
<bool>false</bool>
49+
<bool>true</bool>
5050
</attribute>
5151
<column>
5252
<property name="text">

0 commit comments

Comments
 (0)