diff --git a/feeluown/gui/drawers.py b/feeluown/gui/drawers.py index 3813aa9da..c4eec2755 100644 --- a/feeluown/gui/drawers.py +++ b/feeluown/gui/drawers.py @@ -476,11 +476,13 @@ def __init__(self, emoji: str, length: int, padding: int): self._length = length self._padding = padding + self._emoji_width = self._length - 2 * self._padding + def paint(self, painter: QPainter): + width = self._emoji_width with painter_save(painter): painter.translate(self._padding, self._padding) - width = self._length - 2 * self._padding font = painter.font() - font.setPixelSize(width) + font.setPixelSize(width - 3) painter.setFont(font) painter.drawText(0, 0, width, width, Qt.AlignCenter, self._emoji) diff --git a/feeluown/gui/widgets/selfpaint_btn.py b/feeluown/gui/widgets/selfpaint_btn.py index ae55972b0..8f8598d18 100644 --- a/feeluown/gui/widgets/selfpaint_btn.py +++ b/feeluown/gui/widgets/selfpaint_btn.py @@ -546,8 +546,10 @@ def paintEvent(self, _): with simple_layout(QVBoxLayout) as layout: l1 = QHBoxLayout() l2 = QHBoxLayout() + l3 = QVBoxLayout() layout.addLayout(l1) layout.addLayout(l2) + layout.addLayout(l3) l1.addWidget(LeftArrowButton(length=length)) right = RightArrowButton(length=length) @@ -556,13 +558,9 @@ def paintEvent(self, _): l1.addWidget(SearchSwitchButton(length=length)) l1.addWidget(SettingsButton(length=length)) l1.addWidget(RecentlyPlayedButton(height=length)) - l1.addWidget(HomeButton(height=length)) - l1.addWidget(DiscoveryButton(height=length)) l1.addWidget(TriagleButton(length=length, direction='up')) l1.addWidget(CalendarButton(height=length)) - l1.addWidget(RankButton(height=length)) - l1.addWidget(StarButton(height=length)) l2.addWidget(PlayPreviousButton(length=length)) l2.addWidget(PlayPauseButton(length=100)) @@ -570,5 +568,12 @@ def paintEvent(self, _): volume_button = VolumeButton(length=length) volume_button.set_volume(60) l2.addWidget(volume_button) - l2.addWidget(HotButton(height=100)) l2.addStretch(0) + + l3.addWidget(HotButton(height=length)) + l3.addWidget(HomeButton(height=length)) + l3.addWidget(DiscoveryButton(height=length)) + l3.addWidget(RankButton(height=length)) + l3.addWidget(StarButton(height=length)) + l3.addWidget(EmojiButton('😁', '开心', height=length)) + l3.addStretch(0)