Skip to content

Commit ad055f3

Browse files
committed
PICARD-1488: Custom icons for play toolbar
1 parent 6e8b074 commit ad055f3

36 files changed

+14707
-12611
lines changed

AUTHORS.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Sambhav Kothari <[email protected]>
55

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

8-
Picard v2.0 interface icons made by Sambhav Kothari <[email protected]> and Madebyoliver, Pixel Buddha, Nikita Golubev, Maxim Basinski from www.flaticon.com
8+
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

picard/resources.py

+14,042-12,602
Large diffs are not rendered by default.

picard/ui/options/about.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ def load(self):
7474
and <a href="http://www.flaticon.com/authors/madebyoliver">Madebyoliver</a>,
7575
<a href="http://www.flaticon.com/authors/pixel-buddha">Pixel Buddha</a>,
7676
<a href="http://www.flaticon.com/authors/nikita-golubev">Nikita Golubev</a>,
77-
<a href="http://www.flaticon.com/authors/maxim-basinski">Maxim Basinski</a>
77+
<a href="http://www.flaticon.com/authors/maxim-basinski">Maxim Basinski</a>,
78+
<a href="https://www.flaticon.com/authors/smashicons">Smashicons</a>
7879
from <a href="www.flaticon.com">www.flaticon.com</a>""")
7980

8081
text = _("""<p align="center"><span style="font-size:15px;font-weight:bold;">MusicBrainz Picard</span><br/>

picard/ui/playertoolbar.py

+19-7
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
config,
3232
log,
3333
)
34-
from picard.util import format_time
34+
from picard.util import (
35+
format_time,
36+
icontheme,
37+
)
3538

3639

3740
try:
@@ -159,14 +162,12 @@ def __init__(self, parent, player):
159162
self.player = player
160163
self.media_name = ''
161164

162-
self.play_action = QtWidgets.QAction(self.style().standardIcon(
163-
QtWidgets.QStyle.SP_MediaPlay), _("Play"), self)
165+
self.play_action = QtWidgets.QAction(icontheme.lookup('play'), _("Play"), self)
164166
self.play_action.setStatusTip(_("Play selected files in an internal player"))
165167
self.play_action.setEnabled(False)
166168
self.play_action.triggered.connect(self.play)
167169

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

377378
def __init__(self, parent, volume):
378379
super().__init__(parent)
379-
icon = self.style().standardIcon(QtWidgets.QStyle.SP_MediaVolume)
380-
self.setIcon(icon)
381380
self.set_volume(volume)
382381
margins = self.getContentsMargins()
383382
button_margin = self.style().pixelMetric(QtWidgets.QStyle.PM_ButtonMargin)
@@ -400,6 +399,19 @@ def set_volume(self, volume):
400399
self.volume = volume
401400
label = _('%d%%') % volume
402401
self.setText(label)
402+
self.update_icon()
403+
404+
def update_icon(self):
405+
if self.volume == 0:
406+
icon = 'speaker-0'
407+
elif self.volume <= 33:
408+
icon = 'speaker-33'
409+
elif self.volume <= 66:
410+
icon = 'speaker-66'
411+
else:
412+
icon = 'speaker-100'
413+
icon = icontheme.lookup(icon)
414+
self.setIcon(icon)
403415

404416
def event(self, event):
405417
if event.type() == QtCore.QEvent.Wheel:

resources/images/16x16/pause.png

357 Bytes
Loading
999 Bytes
Loading

resources/images/16x16/play.png

389 Bytes
Loading
1.19 KB
Loading

resources/images/16x16/speaker-0.png

278 Bytes
Loading
601 Bytes
Loading
459 Bytes
Loading
1.63 KB
Loading

resources/images/16x16/speaker-33.png

338 Bytes
Loading
918 Bytes
Loading

resources/images/16x16/speaker-66.png

385 Bytes
Loading
1.26 KB
Loading

resources/images/22x22/pause.png

476 Bytes
Loading
1.33 KB
Loading

resources/images/22x22/play.png

556 Bytes
Loading
1.58 KB
Loading

resources/images/22x22/speaker-0.png

295 Bytes
Loading
726 Bytes
Loading
554 Bytes
Loading
1.86 KB
Loading

resources/images/22x22/speaker-33.png

397 Bytes
Loading
1.17 KB
Loading

resources/images/22x22/speaker-66.png

466 Bytes
Loading
1.62 KB
Loading

resources/img-src/pause.svg

+44
Loading

resources/img-src/play.svg

+109
Loading

resources/img-src/speaker-0.svg

+100
Loading

0 commit comments

Comments
 (0)