mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Make "Mark all chats as read" option more visible
This commit is contained in:
@@ -382,6 +382,12 @@ void FiltersMenu::showAllMenu(QPoint position) {
|
|||||||
}
|
}
|
||||||
const auto defaultFilterId = _session->session().account().defaultFilterId();
|
const auto defaultFilterId = _session->session().account().defaultFilterId();
|
||||||
_popupMenu = base::make_unique_q<Ui::PopupMenu>(_all);
|
_popupMenu = base::make_unique_q<Ui::PopupMenu>(_all);
|
||||||
|
const auto addAction = [&](const QString &text, Fn<void()> callback) {
|
||||||
|
return _popupMenu->addAction(
|
||||||
|
text,
|
||||||
|
crl::guard(&_outer, std::move(callback)));
|
||||||
|
};
|
||||||
|
MenuAddMarkAsReadAllChatsAction(&_session->session().data(), addAction);
|
||||||
_popupMenu->addAction(
|
_popupMenu->addAction(
|
||||||
tr::ktg_filters_context_edit_all(tr::now),
|
tr::ktg_filters_context_edit_all(tr::now),
|
||||||
crl::guard(&_outer, [=] { _session->showSettings(Settings::Type::Folders); }));
|
crl::guard(&_outer, [=] { _session->showSettings(Settings::Type::Folders); }));
|
||||||
|
@@ -278,6 +278,7 @@ void MainMenu::AccountButton::paintEvent(QPaintEvent *e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainMenu::AccountButton::contextMenuEvent(QContextMenuEvent *e) {
|
void MainMenu::AccountButton::contextMenuEvent(QContextMenuEvent *e) {
|
||||||
|
/*
|
||||||
if (!_menu && IsAltShift(e->modifiers())) {
|
if (!_menu && IsAltShift(e->modifiers())) {
|
||||||
_menu = base::make_unique_q<Ui::PopupMenu>(this);
|
_menu = base::make_unique_q<Ui::PopupMenu>(this);
|
||||||
const auto addAction = [&](const QString &text, Fn<void()> callback) {
|
const auto addAction = [&](const QString &text, Fn<void()> callback) {
|
||||||
@@ -289,13 +290,23 @@ void MainMenu::AccountButton::contextMenuEvent(QContextMenuEvent *e) {
|
|||||||
_menu->popup(QCursor::pos());
|
_menu->popup(QCursor::pos());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (&_session->account() == &Core::App().activeAccount() || _menu) {
|
*/
|
||||||
|
if (_menu) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const auto isActiveAccount = &_session->account() == &Core::App().activeAccount();
|
||||||
_menu = base::make_unique_q<Ui::PopupMenu>(this);
|
_menu = base::make_unique_q<Ui::PopupMenu>(this);
|
||||||
_menu->addAction(tr::lng_menu_activate(tr::now), crl::guard(this, [=] {
|
if (!isActiveAccount) {
|
||||||
Core::App().domain().activate(&_session->account());
|
_menu->addAction(tr::lng_menu_activate(tr::now), crl::guard(this, [=] {
|
||||||
}));
|
Core::App().domain().activate(&_session->account());
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
const auto addAction = [&](const QString &text, Fn<void()> callback) {
|
||||||
|
return _menu->addAction(
|
||||||
|
text,
|
||||||
|
crl::guard(this, std::move(callback)));
|
||||||
|
};
|
||||||
|
MenuAddMarkAsReadAllChatsAction(&_session->data(), addAction);
|
||||||
_menu->addAction(tr::lng_settings_logout(tr::now), crl::guard(this, [=] {
|
_menu->addAction(tr::lng_settings_logout(tr::now), crl::guard(this, [=] {
|
||||||
const auto session = _session;
|
const auto session = _session;
|
||||||
const auto callback = [=](Fn<void()> &&close) {
|
const auto callback = [=](Fn<void()> &&close) {
|
||||||
|
Reference in New Issue
Block a user