GUI: language dialog: auto-focus first control on mode switch

This commit is contained in:
Moritz Bunkus 2021-11-15 21:40:41 +01:00
parent 0398b02eea
commit b41d623d6a
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85
2 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,11 @@
# Version ?
## New features and enhancements
* MKVToolNix GUI: language dialog: when the user switches between the two edit
modes, the mode's corresponding first control is automatically focussed.
# Version 63.0.0 "Everything" 2021-11-14
## New features and enhancements

View File

@ -89,14 +89,11 @@ LanguageDialog::LanguageDialog(QWidget *parent)
p.ui->setupUi(this);
if (Settings::get().m_bcp47LanguageEditingMode == Settings::BCP47LanguageEditingMode::FreeForm) {
if (Settings::get().m_bcp47LanguageEditingMode == Settings::BCP47LanguageEditingMode::FreeForm)
p.ui->rbFreeForm->setChecked(true);
p.ui->leFreeForm->setFocus();
} else {
else
p.ui->rbComponentSelection->setChecked(true);
p.ui->cbLanguage->setFocus();
}
createInitialComponentWidgetList();
createGridLayoutFromComponentWidgetList();
@ -341,6 +338,8 @@ LanguageDialog::setupFreeFormAndComponentControls() {
connect(p.ui->leFreeForm, &QLineEdit::textChanged, this, &LanguageDialog::updateFromFreeForm);
p.ui->leFreeForm->setFocus();
} else {
p.ui->leFreeForm->setEnabled(false);
Util::enableChildren(p.ui->sawComponents, true);
@ -349,6 +348,8 @@ LanguageDialog::setupFreeFormAndComponentControls() {
for (auto widget : componentWidgets)
connectComponentWidgetChange(widget);
p.ui->cbLanguage->setFocus();
}
maybeEnableAddExtendedSubtagButton();