Skip to content

Commit

Permalink
test on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
cosven committed Nov 19, 2024
1 parent 4454eea commit e8d4929
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 4 additions & 2 deletions feeluown/gui/drawers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
15 changes: 10 additions & 5 deletions feeluown/gui/widgets/selfpaint_btn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -556,19 +558,22 @@ 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))
l2.addWidget(PlayNextButton(length=length))
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)

0 comments on commit e8d4929

Please sign in to comment.