From 9750f81ff01fe3e1a809325597c5a3e00e031471 Mon Sep 17 00:00:00 2001 From: nerix Date: Thu, 20 Mar 2025 08:39:42 +0100 Subject: [PATCH] fix: focus input after updating visibility (#6096) Fixes #6097 --- CHANGELOG.md | 2 ++ src/widgets/dialogs/SelectChannelDialog.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32c5ee08..d769cf48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unversioned +- Bugfix: Fixed the channel name input not being focused when opening the select-channel dialog. (#6096) + ## 2.5.3-beta.1 - Minor: Added an option to allow multiple user-selected extensions to interact with Chatterino. (#5997) diff --git a/src/widgets/dialogs/SelectChannelDialog.cpp b/src/widgets/dialogs/SelectChannelDialog.cpp index 151d2faa..e9109394 100644 --- a/src/widgets/dialogs/SelectChannelDialog.cpp +++ b/src/widgets/dialogs/SelectChannelDialog.cpp @@ -55,14 +55,14 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent) QObject::connect(ui.channel, &AutoCheckedRadioButton::toggled, this, [this](bool enabled) { auto &ui = this->ui_; + ui.channelName->setVisible(enabled); + ui.channelLabel->setVisible(enabled); + if (enabled) { ui.channelName->setFocus(); ui.channelName->selectAll(); } - - ui.channelName->setVisible(enabled); - ui.channelLabel->setVisible(enabled); }); ui.channel->installEventFilter(&this->tabFilter_);