Skip to content

Commit

Permalink
PICARD-1488: Custom icons for play toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
phw committed Aug 13, 2019
1 parent 6e8b074 commit ad055f3
Show file tree
Hide file tree
Showing 36 changed files with 14,707 additions and 12,611 deletions.
2 changes: 1 addition & 1 deletion AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Sambhav Kothari <[email protected]>

Picard logo by <http://monkeydo.digital>, © 2015 MetaBrainz Foundation

Picard v2.0 interface icons made by Sambhav Kothari <[email protected]> and Madebyoliver, Pixel Buddha, Nikita Golubev, Maxim Basinski from www.flaticon.com
Picard v2.0 interface icons made by Sambhav Kothari <[email protected]> and Madebyoliver, Pixel Buddha, Nikita Golubev, Maxim Basinski and Smashicons from www.flaticon.com
26,644 changes: 14,042 additions & 12,602 deletions picard/resources.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion picard/ui/options/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def load(self):
and <a href="http://www.flaticon.com/authors/madebyoliver">Madebyoliver</a>,
<a href="http://www.flaticon.com/authors/pixel-buddha">Pixel Buddha</a>,
<a href="http://www.flaticon.com/authors/nikita-golubev">Nikita Golubev</a>,
<a href="http://www.flaticon.com/authors/maxim-basinski">Maxim Basinski</a>
<a href="http://www.flaticon.com/authors/maxim-basinski">Maxim Basinski</a>,
<a href="https://www.flaticon.com/authors/smashicons">Smashicons</a>
from <a href="www.flaticon.com">www.flaticon.com</a>""")

text = _("""<p align="center"><span style="font-size:15px;font-weight:bold;">MusicBrainz Picard</span><br/>
Expand Down
26 changes: 19 additions & 7 deletions picard/ui/playertoolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
config,
log,
)
from picard.util import format_time
from picard.util import (
format_time,
icontheme,
)


try:
Expand Down Expand Up @@ -159,14 +162,12 @@ def __init__(self, parent, player):
self.player = player
self.media_name = ''

self.play_action = QtWidgets.QAction(self.style().standardIcon(
QtWidgets.QStyle.SP_MediaPlay), _("Play"), self)
self.play_action = QtWidgets.QAction(icontheme.lookup('play'), _("Play"), self)
self.play_action.setStatusTip(_("Play selected files in an internal player"))
self.play_action.setEnabled(False)
self.play_action.triggered.connect(self.play)

self.pause_action = QtWidgets.QAction(self.style().standardIcon(
QtWidgets.QStyle.SP_MediaPause), _("Pause"), self)
self.pause_action = QtWidgets.QAction(icontheme.lookup('pause'), _("Pause"), self)
self.pause_action.setToolTip(_("Pause/resume"))
self.pause_action.setStatusTip(_("Pause or resume playing with an internal player"))
self.pause_action.setCheckable(True)
Expand Down Expand Up @@ -376,8 +377,6 @@ class VolumeControlButton(QtWidgets.QToolButton):

def __init__(self, parent, volume):
super().__init__(parent)
icon = self.style().standardIcon(QtWidgets.QStyle.SP_MediaVolume)
self.setIcon(icon)
self.set_volume(volume)
margins = self.getContentsMargins()
button_margin = self.style().pixelMetric(QtWidgets.QStyle.PM_ButtonMargin)
Expand All @@ -400,6 +399,19 @@ def set_volume(self, volume):
self.volume = volume
label = _('%d%%') % volume
self.setText(label)
self.update_icon()

def update_icon(self):
if self.volume == 0:
icon = 'speaker-0'
elif self.volume <= 33:
icon = 'speaker-33'
elif self.volume <= 66:
icon = 'speaker-66'
else:
icon = 'speaker-100'
icon = icontheme.lookup(icon)
self.setIcon(icon)

def event(self, event):
if event.type() == QtCore.QEvent.Wheel:
Expand Down
Binary file added resources/images/16x16/pause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/16x16/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/16x16/play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/16x16/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/16x16/speaker-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/16x16/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/16x16/speaker-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/16x16/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/16x16/speaker-33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/16x16/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/16x16/speaker-66.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/16x16/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/22x22/pause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/22x22/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/22x22/play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/22x22/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/22x22/speaker-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/22x22/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/22x22/speaker-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/22x22/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/22x22/speaker-33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/22x22/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/22x22/speaker-66.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/22x22/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions resources/img-src/pause.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions resources/img-src/play.svg
100 changes: 100 additions & 0 deletions resources/img-src/speaker-0.svg
Loading

0 comments on commit ad055f3

Please sign in to comment.