Add labels to buttons in dialog widget

This commit is contained in:
mukthar777
2026-02-10 18:23:40 +05:30
committed by John Preston
parent 91fb6d405d
commit 17db3361d3
3 changed files with 19 additions and 0 deletions
+5
View File
@@ -7604,4 +7604,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_sr_playback_order" = "Playback order";
"lng_sr_player_close" = "Close media player";
"lng_sr_group_call_menu" = "Video chat menu";
"lng_sr_search_date" = "Search by date";
"lng_sr_cancel_search" = "Cancel search";
"lng_sr_clear_search" = "Clear search";
"lng_sr_scroll_to_top" = "Scroll to top";
// Keys finished
@@ -587,14 +587,20 @@ Widget::Widget(
_cancelSearch->setClickedCallback([=] {
cancelSearch({ .jumpBackToSearchedChat = true });
});
_cancelSearch->setAccessibleName(tr::lng_sr_cancel_search(tr::now));
_jumpToDate->entity()->setClickedCallback([=] { showCalendar(); });
_jumpToDate->entity()->setAccessibleName(
tr::lng_sr_search_date(tr::now));
_chooseFromUser->entity()->setClickedCallback([=] { showSearchFrom(); });
_chooseFromUser->entity()->setAccessibleName(
tr::lng_search_messages_from(tr::now));
rpl::single(rpl::empty) | rpl::then(
session().domain().local().localPasscodeChanged()
) | rpl::on_next([=] {
updateLockUnlockVisibility();
}, lifetime());
const auto lockUnlock = _lockUnlock->entity();
lockUnlock->setAccessibleName(tr::lng_shortcuts_lock(tr::now));
lockUnlock->setClickedCallback([=] {
lockUnlock->setIconOverride(
&st::dialogsUnlockIcon,
@@ -616,6 +622,7 @@ Widget::Widget(
controller->closeForum();
}
});
_searchForNarrowLayout->setAccessibleName(tr::lng_dlg_filter(tr::now));
setAcceptDrops(true);
@@ -1048,6 +1055,7 @@ void Widget::scrollToDefaultChecked(bool verytop) {
void Widget::setupScrollUpButton() {
_scrollToTop->setClickedCallback([=] { scrollToDefaultChecked(); });
_scrollToTop->setAccessibleName(tr::lng_sr_scroll_to_top(tr::now));
trackScroll(_scrollToTop);
trackScroll(this);
updateScrollUpVisibility();
@@ -3336,6 +3344,11 @@ void Widget::updateCancelSearch() {
|| (!_searchState.inChat
&& (_searchHasFocus || _searchSuggestionsLocked));
_cancelSearch->toggle(shown, anim::type::normal);
if (_searchState.inChat) {
_cancelSearch->setAccessibleName(shown
? tr::lng_sr_clear_search(tr::now)
: tr::lng_sr_cancel_search(tr::now));
}
}
QString Widget::validateSearchQuery() {
@@ -449,6 +449,7 @@ void ChatSearchIn::updateSection(
const auto st = &st::dialogsCancelSearchInPeer;
section->cancel = std::make_unique<Ui::IconButton>(raw, *st);
section->cancel->setAccessibleName(tr::lng_cancel(tr::now));
section->cancel->show();
raw->sizeValue() | rpl::on_next([=](QSize size) {
const auto left = size.width() - section->cancel->width();