From b9666a0f61cad0cee52046b0459ad0897145a273 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 16 Jun 2021 22:59:53 -0700 Subject: [PATCH] Switch icons to Material via QtAwesome --- setup.cfg | 16 ++++++++++++++++ setup.py | 3 +++ ui_mainwindow.py | 35 ++++++++++++++++++----------------- 3 files changed, 37 insertions(+), 17 deletions(-) create mode 100644 setup.cfg create mode 100644 setup.py diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..230aaad --- /dev/null +++ b/setup.cfg @@ -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 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..6068493 --- /dev/null +++ b/setup.py @@ -0,0 +1,3 @@ +from setuptools import setup + +setup() diff --git a/ui_mainwindow.py b/ui_mainwindow.py index b059d88..d27e479 100644 --- a/ui_mainwindow.py +++ b/ui_mainwindow.py @@ -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)