diff --git a/src/mkvtoolnix-gui/main_window/preferences_dialog.cpp b/src/mkvtoolnix-gui/main_window/preferences_dialog.cpp index 7adaa3985..77ea61d86 100644 --- a/src/mkvtoolnix-gui/main_window/preferences_dialog.cpp +++ b/src/mkvtoolnix-gui/main_window/preferences_dialog.cpp @@ -320,6 +320,8 @@ PreferencesDialog::setupPlaylistScanningPolicy() { ui->cbMScanPlaylistsPolicy->setCurrentIndex(selected); ui->sbMMinPlaylistDuration->setValue(m_cfg.m_minimumPlaylistDuration); + + Util::fixComboBoxViewWidth(*ui->cbMScanPlaylistsPolicy); } void diff --git a/src/mkvtoolnix-gui/util/widget.cpp b/src/mkvtoolnix-gui/util/widget.cpp index 03deefe6f..3603fd38e 100644 --- a/src/mkvtoolnix-gui/util/widget.cpp +++ b/src/mkvtoolnix-gui/util/widget.cpp @@ -1,5 +1,6 @@ #include "common/common_pch.h" +#include #include #include #include @@ -152,4 +153,10 @@ preventScrollingWithoutFocus(QObject *parent) { install(child); } +void +fixComboBoxViewWidth(QComboBox &comboBox) { + comboBox.setSizeAdjustPolicy(QComboBox::AdjustToContents); + comboBox.view()->setMinimumWidth(comboBox.sizeHint().width()); +} + }}} diff --git a/src/mkvtoolnix-gui/util/widget.h b/src/mkvtoolnix-gui/util/widget.h index 867a64db9..85c73ccb4 100644 --- a/src/mkvtoolnix-gui/util/widget.h +++ b/src/mkvtoolnix-gui/util/widget.h @@ -22,6 +22,7 @@ QIcon loadIcon(QString const &name, QList const &sizes); bool setComboBoxIndexIf(QComboBox *comboBox, std::function test); bool setComboBoxTextByData(QComboBox *comboBox, QString const &data); void setComboBoxTexts(QComboBox *comboBox, QStringList const &texts); +void fixComboBoxViewWidth(QComboBox &comboBox); void enableWidgets(QList const &widgets, bool enable); QPushButton *buttonForRole(QDialogButtonBox *box, QDialogButtonBox::ButtonRole role = QDialogButtonBox::AcceptRole);