Switch icons to Material via QtAwesome

This commit is contained in:
Raoul Snyman 2021-06-16 22:59:53 -07:00
parent 10ac48b6b9
commit b9666a0f61
No known key found for this signature in database
GPG Key ID: 423F9B322D9BEF2C
3 changed files with 37 additions and 17 deletions

16
setup.cfg Normal file
View File

@ -0,0 +1,16 @@
[metadata]
name = Playtypus
version = 0.1.0
description = A desktop client for Funkwhale
[options]
packages = find:
= src
install_requirements =
PyQt5
requests
funksnake
QtAwesome
[flake8]
max-line-length = 120

3
setup.py Normal file
View File

@ -0,0 +1,3 @@
from setuptools import setup
setup()

View File

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
import qtawesome as qta
from PyQt5 import QtCore, QtWidgets
LIST_WIDGET_STYLES = """
QListWidget {
@ -32,22 +33,22 @@ class UiMainWindow(object):
self.playbackLayout.setSpacing(0)
self.playbackLayout.setObjectName("playbackLayout")
self.toggleButton = QtWidgets.QToolButton(self.playbackWidget)
self.toggleButton.setIcon(QtGui.QIcon.fromTheme("expand"))
self.toggleButton.setIcon(qta.icon("mdi.chevron-down"))
self.toggleButton.setAutoRaise(True)
self.toggleButton.setObjectName("toggleButton")
self.playbackLayout.addWidget(self.toggleButton)
self.previousButton = QtWidgets.QToolButton(self.playbackWidget)
self.previousButton.setIcon(QtGui.QIcon.fromTheme("media-skip-backward"))
self.previousButton.setIcon(qta.icon("mdi.skip-previous"))
self.previousButton.setAutoRaise(True)
self.previousButton.setObjectName("previousButton")
self.playbackLayout.addWidget(self.previousButton)
self.playButton = QtWidgets.QToolButton(self.playbackWidget)
self.playButton.setIcon(QtGui.QIcon.fromTheme("media-playback-start"))
self.playButton.setIcon(qta.icon("mdi.play"))
self.playButton.setAutoRaise(True)
self.playButton.setObjectName("playButton")
self.playbackLayout.addWidget(self.playButton)
self.nextButton = QtWidgets.QToolButton(self.playbackWidget)
self.nextButton.setIcon(QtGui.QIcon.fromTheme("media-skip-forward"))
self.nextButton.setIcon(qta.icon("mdi.skip-next"))
self.nextButton.setAutoRaise(True)
self.nextButton.setObjectName("nextButton")
self.playbackLayout.addWidget(self.nextButton)
@ -60,17 +61,17 @@ class UiMainWindow(object):
self.positionSlider.setObjectName("positionSlider")
self.playbackLayout.addWidget(self.positionSlider)
self.shuffleButton = QtWidgets.QToolButton(self.playbackWidget)
self.shuffleButton.setIcon(QtGui.QIcon.fromTheme("media-playlist-normal"))
self.shuffleButton.setIcon(qta.icon("mdi.shuffle"))
self.shuffleButton.setAutoRaise(True)
self.shuffleButton.setObjectName("shuffleButton")
self.playbackLayout.addWidget(self.shuffleButton)
self.repeatButton = QtWidgets.QToolButton(self.playbackWidget)
self.repeatButton.setIcon(QtGui.QIcon.fromTheme("media-repeat-none"))
self.repeatButton.setIcon(qta.icon("mdi.repeat"))
self.repeatButton.setAutoRaise(True)
self.repeatButton.setObjectName("repeatButton")
self.playbackLayout.addWidget(self.repeatButton)
self.muteButton = QtWidgets.QToolButton(self.playbackWidget)
self.muteButton.setIcon(QtGui.QIcon.fromTheme("player-volume"))
self.muteButton.setIcon(qta.icon("mdi.volume-high"))
self.muteButton.setCheckable(True)
self.muteButton.setAutoRaise(True)
self.muteButton.setObjectName("muteButton")
@ -80,7 +81,7 @@ class UiMainWindow(object):
self.volumeSlider.setObjectName("volumeSlider")
self.playbackLayout.addWidget(self.volumeSlider)
self.menuButton = QtWidgets.QToolButton(self.playbackWidget)
self.menuButton.setIcon(QtGui.QIcon.fromTheme("application-menu"))
self.menuButton.setIcon(qta.icon("mdi.menu"))
self.menuButton.setPopupMode(QtWidgets.QToolButton.DelayedPopup)
self.menuButton.setAutoRaise(True)
self.menuButton.setObjectName("menuButton")
@ -116,7 +117,7 @@ class UiMainWindow(object):
self.albumPageTitleLayout.setObjectName("albumPageTitleLayout")
self.albumPageIconLabel = QtWidgets.QLabel(self.albumPage)
self.albumPageIconLabel.setPixmap(
QtGui.QIcon.fromTheme('view-media-album-cover').pixmap(self.albumPageIconLabel.geometry().height()))
qta.icon('mdi.album').pixmap(self.albumPageIconLabel.geometry().height()))
self.albumPageTitleLayout.addWidget(self.albumPageIconLabel)
self.albumPageTitleLabel = QtWidgets.QLabel(self.albumPage)
self.albumPageTitleLayout.addWidget(self.albumPageTitleLabel)
@ -124,10 +125,10 @@ class UiMainWindow(object):
self.albumListWidget = QtWidgets.QListWidget(self.albumPage)
self.albumListWidget.setObjectName("albumListWidget")
self.albumListWidget.setSortingEnabled(True)
self.albumListWidget.setViewMode(QtWidgets.QListView.IconMode)
self.albumListWidget.setMovement(QtWidgets.QListView.Static)
# self.albumListWidget.setViewMode(QtWidgets.QListView.IconMode)
# self.albumListWidget.setMovement(QtWidgets.QListView.Static)
self.albumListWidget.setIconSize(QtCore.QSize(100, 100))
self.albumListWidget.setGridSize(QtCore.QSize(128, 128))
# self.albumListWidget.setGridSize(QtCore.QSize(128, 128))
self.albumPageLayout.addWidget(self.albumListWidget)
self.stackedWidget.addWidget(self.albumPage)
self.artistPage = QtWidgets.QWidget()
@ -172,11 +173,11 @@ class UiMainWindow(object):
self.actionPlay.setObjectName("actionPlay")
self.mainMenu = QtWidgets.QMenu(self)
self.settingsAction = self.mainMenu.addAction(QtGui.QIcon.fromTheme('configure'), '')
self.settingsAction = self.mainMenu.addAction(qta.icon('mdi.application-settings'), '')
self.albumsListItem = QtWidgets.QListWidgetItem(QtGui.QIcon.fromTheme('view-media-album-cover'), '')
self.artistsListItem = QtWidgets.QListWidgetItem(QtGui.QIcon.fromTheme('view-media-artist'), '')
self.tracksListItem = QtWidgets.QListWidgetItem(QtGui.QIcon.fromTheme('view-media-track'), '')
self.albumsListItem = QtWidgets.QListWidgetItem(qta.icon('mdi.album'), '')
self.artistsListItem = QtWidgets.QListWidgetItem(qta.icon('mdi.account'), '')
self.tracksListItem = QtWidgets.QListWidgetItem(qta.icon('mdi.music'), '')
for item in [self.albumsListItem, self.artistsListItem, self.tracksListItem]:
self.viewListWidget.addItem(item)