mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
parent
7dfed2a012
commit
b782569faf
1 changed files with 17 additions and 5 deletions
|
@ -1747,9 +1747,7 @@ void HistoryWidget::activate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::setInnerFocus() {
|
void HistoryWidget::setInnerFocus() {
|
||||||
if (_scroll->isHidden()) {
|
if (_list) {
|
||||||
setFocus();
|
|
||||||
} else if (_list) {
|
|
||||||
if (isSearching()) {
|
if (isSearching()) {
|
||||||
_composeSearch->setInnerFocus();
|
_composeSearch->setInnerFocus();
|
||||||
} else if (_chooseTheme && _chooseTheme->shouldBeShown()) {
|
} else if (_chooseTheme && _chooseTheme->shouldBeShown()) {
|
||||||
|
@ -1760,10 +1758,16 @@ void HistoryWidget::setInnerFocus() {
|
||||||
|| isBotStart()
|
|| isBotStart()
|
||||||
|| isBlocked()
|
|| isBlocked()
|
||||||
|| !_canSendTexts) {
|
|| !_canSendTexts) {
|
||||||
_list->setFocus();
|
if (_scroll->isHidden()) {
|
||||||
|
setFocus();
|
||||||
|
} else {
|
||||||
|
_list->setFocus();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_field->setFocus();
|
_field->setFocus();
|
||||||
}
|
}
|
||||||
|
} else if (_scroll->isHidden()) {
|
||||||
|
setFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2679,6 +2683,10 @@ void HistoryWidget::updateControlsVisibility() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_firstLoadRequest && !_scroll->isHidden()) {
|
if (_firstLoadRequest && !_scroll->isHidden()) {
|
||||||
|
if (Ui::InFocusChain(_scroll.data())) {
|
||||||
|
// Don't loose focus back to chats list.
|
||||||
|
setFocus();
|
||||||
|
}
|
||||||
_scroll->hide();
|
_scroll->hide();
|
||||||
} else if (!_firstLoadRequest && _scroll->isHidden()) {
|
} else if (!_firstLoadRequest && _scroll->isHidden()) {
|
||||||
_scroll->show();
|
_scroll->show();
|
||||||
|
@ -6134,7 +6142,11 @@ void HistoryWidget::keyPressEvent(QKeyEvent *e) {
|
||||||
|
|
||||||
const auto commonModifiers = e->modifiers() & kCommonModifiers;
|
const auto commonModifiers = e->modifiers() & kCommonModifiers;
|
||||||
if (e->key() == Qt::Key_Escape) {
|
if (e->key() == Qt::Key_Escape) {
|
||||||
e->ignore();
|
if (hasFocus()) {
|
||||||
|
escape();
|
||||||
|
} else {
|
||||||
|
e->ignore();
|
||||||
|
}
|
||||||
} else if (e->key() == Qt::Key_Back) {
|
} else if (e->key() == Qt::Key_Back) {
|
||||||
_cancelRequests.fire({});
|
_cancelRequests.fire({});
|
||||||
} else if (e->key() == Qt::Key_PageDown) {
|
} else if (e->key() == Qt::Key_PageDown) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue