Skip to content

Commit

Permalink
修复召唤师名会不必要地换行的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzaphkiel committed Nov 7, 2023
1 parent 56af348 commit 3e475bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/view/game_info_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def __init__(self, info: dict, parent=None):
self.summonerName.clicked.connect(lambda: self.parent().parent(
).parent().parent().summonerViewClicked.emit(info['puuid']))

if QWidget().fontMetrics().size(Qt.TextSingleLine, name).width() > 48:
if QWidget().fontMetrics().size(Qt.TextSingleLine, name).width() > 50 and len(name) > 8:
pos = (len(name)+1) // 2
name = name[:pos] + "\n" + name[pos:]
self.summonerName.setText(name)
Expand Down Expand Up @@ -523,7 +523,7 @@ def __init__(self, summoner, parent=None):
self.summonerName.clicked.connect(lambda: self.parent().parent(
).parent().summonerGamesClicked.emit(self.summonerName.text()))

if QWidget().fontMetrics().size(Qt.TextSingleLine, name).width() > 48:
if QWidget().fontMetrics().size(Qt.TextSingleLine, name).width() > 50 and len(name) > 8:
pos = (len(name)+1) // 2
name = name[:pos] + "\n" + name[pos:]
self.summonerName.setText(name)
Expand Down

0 comments on commit 3e475bf

Please sign in to comment.