mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Slightly improved style of box for premium accounts limits.
Added an icon for the info bubble. Added a gradient color to selected account. Respected an order of accounts from settings.
This commit is contained in:
@@ -619,29 +619,6 @@ void SetupAccountsWrap(
|
||||
return result;
|
||||
}
|
||||
|
||||
[[nodiscard]] std::vector<not_null<Main::Account*>> OrderedAccounts() {
|
||||
using namespace Main;
|
||||
|
||||
const auto order = Core::App().settings().accountsOrder();
|
||||
auto accounts = ranges::views::all(
|
||||
Core::App().domain().accounts()
|
||||
) | ranges::views::transform([](const Domain::AccountWithIndex &a) {
|
||||
return not_null{ a.account.get() };
|
||||
}) | ranges::to_vector;
|
||||
ranges::stable_sort(accounts, [&](
|
||||
not_null<Account*> a,
|
||||
not_null<Account*> b) {
|
||||
const auto aIt = a->sessionExists()
|
||||
? ranges::find(order, a->session().uniqueId())
|
||||
: end(order);
|
||||
const auto bIt = b->sessionExists()
|
||||
? ranges::find(order, b->session().uniqueId())
|
||||
: end(order);
|
||||
return aIt < bIt;
|
||||
});
|
||||
return accounts;
|
||||
}
|
||||
|
||||
AccountsList::AccountsList(
|
||||
not_null<Ui::VerticalLayout*> container,
|
||||
not_null<Window::SessionController*> controller)
|
||||
@@ -853,6 +830,29 @@ AccountsEvents SetupAccounts(
|
||||
};
|
||||
}
|
||||
|
||||
std::vector<not_null<Main::Account*>> OrderedAccounts() {
|
||||
using namespace Main;
|
||||
|
||||
const auto order = Core::App().settings().accountsOrder();
|
||||
auto accounts = ranges::views::all(
|
||||
Core::App().domain().accounts()
|
||||
) | ranges::views::transform([](const Domain::AccountWithIndex &a) {
|
||||
return not_null{ a.account.get() };
|
||||
}) | ranges::to_vector;
|
||||
ranges::stable_sort(accounts, [&](
|
||||
not_null<Account*> a,
|
||||
not_null<Account*> b) {
|
||||
const auto aIt = a->sessionExists()
|
||||
? ranges::find(order, a->session().uniqueId())
|
||||
: end(order);
|
||||
const auto bIt = b->sessionExists()
|
||||
? ranges::find(order, b->session().uniqueId())
|
||||
: end(order);
|
||||
return aIt < bIt;
|
||||
});
|
||||
return accounts;
|
||||
}
|
||||
|
||||
Dialogs::Ui::UnreadBadgeStyle BadgeStyle() {
|
||||
auto result = Dialogs::Ui::UnreadBadgeStyle();
|
||||
result.font = st::mainMenuBadgeFont;
|
||||
|
Reference in New Issue
Block a user