From 074befd90c8884e3047bca72c104b7182402975c Mon Sep 17 00:00:00 2001 From: Zzaphkiel <1278228162@qq.com> Date: Wed, 21 Feb 2024 23:45:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=87=E9=95=BF=E7=9A=84?= =?UTF-8?q?=E5=8F=AC=E5=94=A4=E5=B8=88=E5=90=8D=E5=9C=A8=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#249)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/resource/qss/dark/search_interface.qss | 2 +- app/resource/qss/light/search_interface.qss | 2 +- app/view/search_interface.py | 19 ++++++++++++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/app/resource/qss/dark/search_interface.qss b/app/resource/qss/dark/search_interface.qss index 94145e08..a084be58 100644 --- a/app/resource/qss/dark/search_interface.qss +++ b/app/resource/qss/dark/search_interface.qss @@ -109,7 +109,7 @@ SummonerInfoBar#currentSummonerWidget>#levelLabel { SummonerName { font: 14px 'Segoe UI', 'Microsoft YaHei', 'PingFang SC'; text-align: left; - padding: 4px 6px 4px 6px; + padding: 0px 6px 3px 6px; color: white; border: none; background-color: transparent; diff --git a/app/resource/qss/light/search_interface.qss b/app/resource/qss/light/search_interface.qss index 15f3862f..97148744 100644 --- a/app/resource/qss/light/search_interface.qss +++ b/app/resource/qss/light/search_interface.qss @@ -99,7 +99,7 @@ SummonerInfoBar#currentSummonerWidget>QLabel { SummonerName { font: 14px 'Segoe UI', 'Microsoft YaHei'; text-align: left; - padding: 4px 6px 4px 6px; + padding: 0px 6px 3px 6px; color: black; border: none; background-color: transparent; diff --git a/app/view/search_interface.py b/app/view/search_interface.py index 73a1bd03..fa73393e 100644 --- a/app/view/search_interface.py +++ b/app/view/search_interface.py @@ -7,9 +7,9 @@ from PyQt5.QtCore import Qt, pyqtSignal from PyQt5.QtGui import QPixmap from ..common.qfluentwidgets import (SmoothScrollArea, LineEdit, PushButton, ToolButton, InfoBar, - InfoBarPosition, ToolTipFilter, ToolTipPosition, Theme, isDarkTheme, FlyoutViewBase, Flyout, - CardWidget, IndeterminateProgressRing, FlyoutView, FlyoutAnimationType, ComboBox, - StateToolTip) + InfoBarPosition, ToolTipFilter, ToolTipPosition, Theme, isDarkTheme, FlyoutViewBase, Flyout, + CardWidget, IndeterminateProgressRing, FlyoutView, FlyoutAnimationType, ComboBox, + StateToolTip) from ..common.style_sheet import StyleSheet from ..common.icons import Icon @@ -732,7 +732,8 @@ def __init__(self, summoner, parent=None): self.levelLabel = QLabel() self.championIconLabel = RoundIcon(summoner["championIcon"], 25, 0, 3) - self.summonerName = SummonerName(summoner["summonerName"], isPublic=summoner["isPublic"]) + self.summonerName = SummonerName( + summoner["summonerName"], isPublic=summoner["isPublic"]) self.rankIcon = QLabel() @@ -755,6 +756,10 @@ def __initWidget(self, summoner): if self.isCurrent: self.setObjectName("currentSummonerWidget") + self.summonerName.setAlignment(Qt.AlignVCenter | Qt.AlignLeft) + self.summonerName.setSizePolicy( + QSizePolicy.Expanding, QSizePolicy.Minimum) + self.runeIcon.setPixmap(QPixmap(summoner["runeIcon"]).scaled( 23, 23, Qt.KeepAspectRatio, Qt.SmoothTransformation)) self.spell1Icon.setFixedSize(18, 18) @@ -833,10 +838,10 @@ def __initLayout(self): self.hBoxLayout.addLayout(self.spellsLayout) self.hBoxLayout.addWidget(self.levelLabel) self.hBoxLayout.addWidget(self.championIconLabel) - self.hBoxLayout.addWidget(self.summonerName) - self.hBoxLayout.addSpacing(10) + self.hBoxLayout.addWidget(self.summonerName, alignment=Qt.AlignVCenter) + self.hBoxLayout.addSpacing(4) self.hBoxLayout.addSpacerItem(QSpacerItem( - 1, 1, QSizePolicy.Expanding, QSizePolicy.Minimum)) + 1, 1, QSizePolicy.Minimum, QSizePolicy.Minimum)) self.hBoxLayout.addSpacing(5) self.hBoxLayout.addWidget(self.rankIcon) self.hBoxLayout.addSpacing(5)