mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Moved current interface language to top of list in translate box.
This commit is contained in:
parent
9e93ecc154
commit
0e93693856
1 changed files with 9 additions and 1 deletions
|
@ -474,7 +474,15 @@ void ChooseLanguageBox(
|
|||
box->setFocusCallback([=] { multiSelect->setInnerFocus(); });
|
||||
|
||||
const auto container = box->verticalLayout();
|
||||
const auto langs = Languages();
|
||||
const auto langs = [&] {
|
||||
auto langs = Languages();
|
||||
const auto current = QLocale(
|
||||
Lang::LanguageIdOrDefault(Lang::Id())).language();
|
||||
if (const auto it = ranges::find(langs, current); it != end(langs)) {
|
||||
base::reorder(langs, std::distance(begin(langs), it), 0);
|
||||
}
|
||||
return langs;
|
||||
}();
|
||||
auto rows = std::vector<not_null<Ui::SlideWrap<Row>*>>();
|
||||
rows.reserve(langs.size());
|
||||
for (const auto &lang : langs) {
|
||||
|
|
Loading…
Add table
Reference in a new issue