Skip to content

Commit a111727

Browse files
committed
Fix build with Qt 5.
1 parent 5c900c2 commit a111727

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

Telegram/Resources/langs/lang.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
460460
"lng_update_telegram" = "Update Telegram";
461461
"lng_dlg_search_in" = "Search messages in";
462462
"lng_dlg_search_from" = "From: {user}";
463+
"lng_chat_menu" = "Chat menu";
463464

464465
"lng_settings_save" = "Save";
465466
"lng_settings_apply" = "Apply";

Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,13 @@ TopBarWidget::TopBarWidget(
258258
}, lifetime());
259259

260260
setCursor(style::cur_pointer);
261+
_call->setAccessibleName(tr::lng_profile_action_short_call(tr::now));
262+
_groupCall->setAccessibleName(tr::lng_group_call_title(tr::now));
263+
_search->setAccessibleName(tr::lng_shortcuts_search(tr::now));
264+
_infoToggle->setAccessibleName(tr::lng_settings_section_info(tr::now));
265+
_menuToggle->setAccessibleName(tr::lng_chat_menu(tr::now));
266+
_back->setAccessibleName(tr::lng_go_back(tr::now));
267+
_cancelChoose->setAccessibleName(tr::lng_cancel(tr::now));
261268
}
262269

263270
TopBarWidget::~TopBarWidget() = default;
@@ -1002,6 +1009,13 @@ void TopBarWidget::refreshInfoButton() {
10021009
}
10031010
if (_info) {
10041011
_info->setAttribute(Qt::WA_TransparentForMouseEvents);
1012+
_info->setAccessibleName(tr::lng_settings_section_info(tr::now));
1013+
if (_back && _info) {
1014+
QWidget::setTabOrder(_back.data(), _info.data());
1015+
}
1016+
if (_info && _search) {
1017+
QWidget::setTabOrder(_info.data(), _search.data());
1018+
}
10051019
}
10061020
}
10071021

Telegram/SourceFiles/ui/controls/send_button.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ For license and copyright information please follow this link:
1616
#include "styles/style_boxes.h"
1717
#include "styles/style_chat_helpers.h"
1818
#include "styles/style_credits.h"
19+
#include "lang/lang_keys.h"
20+
#include "ui/text/format_values.h"
1921

2022
namespace Ui {
2123
namespace {
@@ -79,6 +81,27 @@ void SendButton::setState(State state) {
7981
}
8082
_state = state;
8183

84+
setAccessibleName([&] {
85+
switch (_state.type) {
86+
case Type::Send: return tr::lng_send_button(tr::now);
87+
case Type::Record:
88+
return tr::lng_shortcuts_record_voice_message(tr::now);
89+
case Type::Round:
90+
return tr::lng_shortcuts_record_round_message(tr::now);
91+
case Type::Cancel: return tr::lng_cancel(tr::now);
92+
case Type::Save: return tr::lng_settings_save(tr::now);
93+
case Type::Slowmode:
94+
return tr::lng_slowmode_enabled(
95+
tr::now,
96+
lt_left,
97+
Ui::FormatDurationWordsSlowmode(_state.slowmodeDelay));
98+
case Type::Schedule: return tr::lng_schedule_button(tr::now);
99+
case Type::EditPrice:
100+
return tr::lng_suggest_menu_edit_price(tr::now);
101+
}
102+
Unexpected("Send button type.");
103+
}());
104+
82105
if (voiceRoundTransition) {
83106
_voiceRoundAnimating = true;
84107

0 commit comments

Comments
 (0)