mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-01-08 11:11:51 +00:00
GUI: preferences: fix width of combo box content view on Windows
Due to a bug in Qt[1] the content view will only be as wide as the combo box itself on Windows while expanding to the minimum length required on Linux and Mac OS. So force the minimum width to the maximum content width. [1] https://bugreports.qt.io/browse/QTBUG-3097
This commit is contained in:
parent
c9aa36005a
commit
740c19c7f3
@ -320,6 +320,8 @@ PreferencesDialog::setupPlaylistScanningPolicy() {
|
||||
|
||||
ui->cbMScanPlaylistsPolicy->setCurrentIndex(selected);
|
||||
ui->sbMMinPlaylistDuration->setValue(m_cfg.m_minimumPlaylistDuration);
|
||||
|
||||
Util::fixComboBoxViewWidth(*ui->cbMScanPlaylistsPolicy);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "common/common_pch.h"
|
||||
|
||||
#include <QAbstractItemView>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QIcon>
|
||||
@ -152,4 +153,10 @@ preventScrollingWithoutFocus(QObject *parent) {
|
||||
install(child);
|
||||
}
|
||||
|
||||
void
|
||||
fixComboBoxViewWidth(QComboBox &comboBox) {
|
||||
comboBox.setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
comboBox.view()->setMinimumWidth(comboBox.sizeHint().width());
|
||||
}
|
||||
|
||||
}}}
|
||||
|
@ -22,6 +22,7 @@ QIcon loadIcon(QString const &name, QList<int> const &sizes);
|
||||
bool setComboBoxIndexIf(QComboBox *comboBox, std::function<bool(QString const &, QVariant const &)> test);
|
||||
bool setComboBoxTextByData(QComboBox *comboBox, QString const &data);
|
||||
void setComboBoxTexts(QComboBox *comboBox, QStringList const &texts);
|
||||
void fixComboBoxViewWidth(QComboBox &comboBox);
|
||||
|
||||
void enableWidgets(QList<QWidget *> const &widgets, bool enable);
|
||||
QPushButton *buttonForRole(QDialogButtonBox *box, QDialogButtonBox::ButtonRole role = QDialogButtonBox::AcceptRole);
|
||||
|
Loading…
Reference in New Issue
Block a user