Skip to content

Commit

Permalink
优化生涯界面 KDA 标签可读性
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzaphkiel committed Nov 12, 2024
1 parent ac3c039 commit 2565b88
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 6 deletions.
48 changes: 42 additions & 6 deletions app/components/game_infobar_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,42 @@ def __init__(self, items, kills, deaths, assists, cs, gold, parent=None):
self.vBoxLayout = QHBoxLayout(self)
self.itemsLayout = QHBoxLayout()

self.kdaLabel = QLabel(f"{kills} / {deaths} / {assists}")
self.kills = QLabel(f"{kills}")
self.slash1 = QLabel("/")
self.deaths = ColorLabel(f"{deaths}", type='lose')
self.slash2 = QLabel("/")
self.assists = QLabel(f"{assists}")

self.csLabel = QLabel(f"{cs}")
self.goldLabel = QLabel(format(gold, ","))

self.kdaLabel.setAlignment(Qt.AlignCenter)
self.kdaLabel.setContentsMargins(0, 0, 0, 2)
self.kills.setAlignment(Qt.AlignCenter)
self.kills.setContentsMargins(0, 0, 0, 2)
self.kills.setFixedWidth(23)
self.kills.setObjectName("kills")
self.slash1.setAlignment(Qt.AlignCenter)
self.slash1.setContentsMargins(0, 0, 0, 2)
self.slash1.setFixedWidth(9)
self.slash1.setObjectName("slash1")
self.deaths.setAlignment(Qt.AlignCenter)
self.deaths.setContentsMargins(0, 0, 0, 2)
self.deaths.setFixedWidth(23)
self.deaths.setObjectName("deaths")
self.slash2.setAlignment(Qt.AlignCenter)
self.slash2.setContentsMargins(0, 0, 0, 2)
self.slash2.setFixedWidth(9)
self.slash2.setObjectName("slash2")
self.assists.setAlignment(Qt.AlignCenter)
self.assists.setContentsMargins(0, 0, 0, 2)
self.assists.setFixedWidth(23)
self.assists.setObjectName("assists")

# self.kills.setStyleSheet("border: 1px solid black;")
# self.slash1.setStyleSheet("border: 1px solid black;")
# self.deaths.setStyleSheet("border: 1px solid black;")
# self.slash2.setStyleSheet("border: 1px solid black;")
# self.assists.setStyleSheet("border: 1px solid black;")

self.csLabel.setAlignment(Qt.AlignCenter)
self.csLabel.setContentsMargins(0, 0, 0, 2)
self.goldLabel.setAlignment(Qt.AlignCenter)
Expand All @@ -131,7 +161,6 @@ def __init__(self, items, kills, deaths, assists, cs, gold, parent=None):
self.goldIcon.setFixedSize(16, 16)
self.goldIcon.setAlignment(Qt.AlignCenter)

# self.kdaLabel.setStyleSheet("QLabel {border: 1px solid black;}")
# self.csLabel.setStyleSheet("QLabel {border: 1px solid black;}")
# self.goldLabel.setStyleSheet("QLabel {border: 1px solid black;}")

Expand All @@ -148,12 +177,19 @@ def __initLayout(self, items):

self.itemsLayout.addWidget(image)

self.kdaLabel.setFixedWidth(90)
self.csLabel.setFixedWidth(40)

self.vBoxLayout.setContentsMargins(0, 0, 0, 0)
self.vBoxLayout.setSpacing(0)
self.vBoxLayout.addWidget(self.kdaLabel)
self.vBoxLayout.addWidget(self.kills)
self.vBoxLayout.addSpacing(-11)
self.vBoxLayout.addWidget(self.slash1)
self.vBoxLayout.addSpacing(-11)
self.vBoxLayout.addWidget(self.deaths)
self.vBoxLayout.addSpacing(-11)
self.vBoxLayout.addWidget(self.slash2)
self.vBoxLayout.addSpacing(-11)
self.vBoxLayout.addWidget(self.assists)
self.vBoxLayout.addSpacing(5)
self.vBoxLayout.addWidget(self.csLabel)
self.vBoxLayout.addSpacing(-6)
Expand Down
20 changes: 20 additions & 0 deletions app/resource/qss/dark/career_interface.qss
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,26 @@ ItemsKdaCsGold>QLabel {
font: 16px 'Segoe UI', 'Microsoft YaHei';
}

ItemsKdaCsGold>#kills {
font: bold 16px 'Segoe UI', 'Microsoft YaHei';
}

ItemsKdaCsGold>#deaths {
font: bold 16px 'Segoe UI', 'Microsoft YaHei';
}

ItemsKdaCsGold>#assists {
font: bold 16px 'Segoe UI', 'Microsoft YaHei';
}

ItemsKdaCsGold>#slash1 {
font: bold 16px 'Segoe UI', 'Microsoft YaHei';
}

ItemsKdaCsGold>#slash2 {
font: bold 16px 'Segoe UI', 'Microsoft YaHei';
}

ResultModeSpell>ColorLabel {
font: bold 17px 'Segoe UI', 'Microsoft YaHei';
}
Expand Down
20 changes: 20 additions & 0 deletions app/resource/qss/light/career_interface.qss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,26 @@ ItemsKdaCsGold>QLabel {
font: 16px 'Segoe UI', 'Microsoft YaHei';
}

ItemsKdaCsGold>#kills {
font: bold 16px 'Segoe UI', 'Microsoft YaHei';
}

ItemsKdaCsGold>#deaths {
font: bold 16px 'Segoe UI', 'Microsoft YaHei';
}

ItemsKdaCsGold>#assists {
font: bold 16px 'Segoe UI', 'Microsoft YaHei';
}

ItemsKdaCsGold>#slash1 {
font: bold 16px 'Segoe UI', 'Microsoft YaHei';
}

ItemsKdaCsGold>#slash2 {
font: bold 16px 'Segoe UI', 'Microsoft YaHei';
}

ResultModeSpell>ColorLabel {
font: bold 17px 'Segoe UI', 'Microsoft YaHei';
}
Expand Down

0 comments on commit 2565b88

Please sign in to comment.