From 2e15aa3eeb54f8206e2728eac79cf38cd03ba06b Mon Sep 17 00:00:00 2001 From: jqy <16437320+jqyisbest@users.noreply.github.com> Date: Sun, 27 Oct 2024 09:48:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA=E7=94=9F?= =?UTF-8?q?=E6=B6=AF=E9=A1=B5=E9=9D=A2KDA=E8=AE=A1=E7=AE=97=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E4=BB=85=E5=9C=A8=E9=83=A8=E5=88=86=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98(Bug=3FFe?= =?UTF-8?q?ature=3F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/view/career_interface.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/view/career_interface.py b/app/view/career_interface.py index 19fc340..c5ed886 100644 --- a/app/view/career_interface.py +++ b/app/view/career_interface.py @@ -78,7 +78,7 @@ def __init__(self, parent=None): self.tr('games)')) self.winsLabel = ColorLabel(self.tr("Wins:") + " None", 'win') self.lossesLabel = ColorLabel(self.tr("Losses:") + " None", 'lose') - self.kdaLabel = QLabel(self.tr("KDA:") + " None / None / None") + self.kdaLabel = QLabel(self.tr("KDA:") + " None / None / None" + self.tr("(") + "0" + self.tr(")")) self.championsCard = ChampionsCard() self.recentTeamButton = PushButton(self.tr("Recent teammates")) self.filterComboBox = ComboBox() @@ -555,8 +555,11 @@ def __onfilterComboBoxChanged(self, index): ) self.winsLabel.setText(f"{self.tr('Wins:')} {wins}") self.lossesLabel.setText(f"{self.tr('Losses:')} {losses}") - self.kdaLabel.setText( - f"{self.tr('KDA:')} {kills} / {deaths} / {assists}") + kda = f"{self.tr('KDA:')} {kills} / {deaths} / {assists}" + kda += self.tr("(") + kda += f"{(kills + assists) / (1 if deaths == 0 else deaths):.1f}" + kda += self.tr(")") + self.kdaLabel.setText(kda) self.gameInfoLayout.addSpacerItem( QSpacerItem(1, 1, QSizePolicy.Minimum, QSizePolicy.Expanding)) @@ -645,8 +648,8 @@ def updateSummoners(self, info): spacing = self.infopageVBoxLayout.spacing() if length < 5: - self.infopageVBoxLayout.addStretch(5-length) - self.infopageVBoxLayout.addSpacing(spacing * (5-length)) + self.infopageVBoxLayout.addStretch(5 - length) + self.infopageVBoxLayout.addSpacing(spacing * (5 - length)) def setLoadingPageEnabled(self, enable): index = 0 if enable else 1