From 47756fb8c3f9d2efffcdb7ffdcab637e39a6bb41 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 21 Apr 2023 00:23:49 +0300 Subject: [PATCH] Removed focus from disabled editor in UsernamesBox for bots. --- Telegram/SourceFiles/boxes/background_box.cpp | 1 - Telegram/SourceFiles/boxes/username_box.cpp | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/boxes/background_box.cpp b/Telegram/SourceFiles/boxes/background_box.cpp index 4adde4e1e..2c7efa6cf 100644 --- a/Telegram/SourceFiles/boxes/background_box.cpp +++ b/Telegram/SourceFiles/boxes/background_box.cpp @@ -301,7 +301,6 @@ void BackgroundBox::chosen(const Data::WallPaper &paper) { void BackgroundBox::resetForPeer() { const auto api = &_controller->session().api(); - using Flag = MTPmessages_SetChatWallPaper::Flag; api->request(MTPmessages_SetChatWallPaper( MTP_flags(0), _forPeer->input, diff --git a/Telegram/SourceFiles/boxes/username_box.cpp b/Telegram/SourceFiles/boxes/username_box.cpp index 3e0245486..6e4e10a9d 100644 --- a/Telegram/SourceFiles/boxes/username_box.cpp +++ b/Telegram/SourceFiles/boxes/username_box.cpp @@ -126,11 +126,14 @@ rpl::producer<> UsernameEditor::submitted() const { } void UsernameEditor::setInnerFocus() { - _username->setFocusFast(); + if (_username->isEnabled()) { + _username->setFocusFast(); + } } void UsernameEditor::setEnabled(bool value) { _username->setEnabled(value); + _username->setDisplayFocused(value); } void UsernameEditor::resizeEvent(QResizeEvent *e) {