Merge pull request #771 from 0-Kutya-0/dev

Multiple UI fixes
This commit is contained in:
parhelia512 2025-09-16 22:23:42 +08:00 committed by GitHub
commit b85aab3f0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View File

@ -2178,7 +2178,7 @@ Release note:
</message>
<message>
<source>Used: %1 Remain: %2 Expire: %3</source>
<translation>Использовано: %1, осталось: %2, истекло: %3</translation>
<translation>Использовано: %1, осталось: %2, истекает: %3</translation>
</message>
<message>
<source>Default</source>

View File

@ -35,7 +35,7 @@ QString ParseSubInfo(const QString &info) {
}
result = QObject::tr("Used: %1 Remain: %2 Expire: %3")
.arg(ReadableSize(used), ReadableSize(total - used), DisplayTime(expire, QLocale::ShortFormat));
.arg(ReadableSize(used), (total == 0) ? QString::fromUtf8("\u221E") : ReadableSize(total - used), DisplayTime(expire, QLocale::ShortFormat));
return result;
}

View File

@ -228,7 +228,9 @@ RouteItem::RouteItem(QWidget *parent, const std::shared_ptr<Configs::RoutingChai
connect(ui->rule_name, &QLineEdit::textChanged, this, [=,this](const QString& text) {
if (currentIndex == -1) return;
chain->Rules[currentIndex]->name = QString(text);
updateRouteItemsView();
auto ruleNameCursorPosition = ui->rule_name->cursorPosition();
updateRouteItemsView();
ui->rule_name->setCursorPosition(ruleNameCursorPosition);
});
connect(ui->rule_attr_selector, &QComboBox::currentTextChanged, this, [=,this](const QString& text){