mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Feat: Set accessibility name for Main menu toggle and add related strings.
This commit is contained in:
committed by
John Preston
parent
496e96d00a
commit
673db168ac
@@ -22,7 +22,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_menu_my_stories" = "My Stories";
|
||||
"lng_menu_my_groups" = "My Groups";
|
||||
"lng_menu_my_channels" = "My Channels";
|
||||
"lng_open_menu" = "Open navigation menu";
|
||||
"lng_main_menu" = "Main menu";
|
||||
"lng_filter_unread_chats#one" = "{text} ({count} unread chat)";
|
||||
"lng_filter_unread_chats#other" = "{text} ({count} unread chats)";
|
||||
|
||||
"lng_disable_notifications_from_tray" = "Disable notifications";
|
||||
"lng_enable_notifications_from_tray" = "Enable notifications";
|
||||
|
||||
@@ -1323,6 +1323,7 @@ void Widget::setupMainMenuToggle() {
|
||||
});
|
||||
_mainMenu.under->stackUnder(_mainMenu.toggle);
|
||||
_mainMenu.toggle->setClickedCallback([=] { showMainMenu(); });
|
||||
_mainMenu.toggle->setAccessibleName(tr::lng_main_menu(tr::now));
|
||||
|
||||
rpl::single(rpl::empty) | rpl::then(
|
||||
controller()->filtersMenuChanged()
|
||||
|
||||
@@ -66,6 +66,7 @@ FiltersMenu::~FiltersMenu() = default;
|
||||
|
||||
void FiltersMenu::setup() {
|
||||
setupMainMenuIcon();
|
||||
_menu.setAccessibleName(tr::lng_main_menu(tr::now));
|
||||
|
||||
_outer.setAttribute(Qt::WA_OpaquePaintEvent);
|
||||
_outer.show();
|
||||
@@ -271,6 +272,9 @@ base::unique_qptr<Ui::SideBarButton> FiltersMenu::prepareButton(
|
||||
: container->add(std::move(prepared));
|
||||
auto button = base::unique_qptr<Ui::SideBarButton>(std::move(added));
|
||||
const auto raw = button.get();
|
||||
const auto nameText = id
|
||||
? title.text.text
|
||||
: tr::lng_filters_all(tr::now);
|
||||
const auto &icons = Ui::LookupFilterIcon(id
|
||||
? icon
|
||||
: Ui::FilterIcon::All);
|
||||
@@ -293,6 +297,14 @@ base::unique_qptr<Ui::SideBarButton> FiltersMenu::prepareButton(
|
||||
? "99+"
|
||||
: QString::number(count);
|
||||
raw->setBadge(string, includeMuted && (count == muted));
|
||||
raw->setAccessibleName(count
|
||||
? tr::lng_filter_unread_chats(
|
||||
tr::now,
|
||||
lt_count,
|
||||
count,
|
||||
lt_text,
|
||||
nameText)
|
||||
: nameText);
|
||||
}, raw->lifetime());
|
||||
}
|
||||
raw->setActive(_session->activeChatsFilterCurrent() == id);
|
||||
|
||||
Reference in New Issue
Block a user