Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

library: add protocol SupportsDiscoveryToplist #827

Merged
merged 5 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add comments
  • Loading branch information
cosven committed May 7, 2024
commit e2259e518756410decfe9dabbe4db43a56d6127a
5 changes: 5 additions & 0 deletions feeluown/gui/components/avatar.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ def __init__(self, app: 'GuiApp', *args, **kwargs):

self._app = app
self._avatar_drawer = None
# In order to make the avatar/icon align to the left edge,
# translate the painter to -self._padding and set different padding
# for avatar-icon and avatar-image.
self._avatar_padding = self._padding // 2
# Leave 1px to draw line itself.
# Theoretically, the line itself costs 1.5px and only 0.75px is needed.
self._translate_x = 1 - self._padding
self._avatar_translate_x = -self._avatar_padding
self._icon_drawer = AvatarIconDrawer(self.height(), self._padding)
Expand Down
7 changes: 2 additions & 5 deletions feeluown/gui/pages/recommendation.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,5 @@ async def render(self):
filter_model.setSourceModel(model)
self.playlist_list_view.setModel(filter_model)

if not isinstance(provider, SupportsRecListDailySongs):
self.daily_songs_btn.setDisabled(True)

if not isinstance(provider, SupportsToplist):
self.rank_btn.setDisabled(True)
self.daily_songs_btn.setEnabled(isinstance(provider, SupportsRecListDailySongs))
self.rank_btn.setEnabled(isinstance(provider, SupportsToplist))
Loading