mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
small cleanup
This commit is contained in:
parent
06f0c0804f
commit
6f2d6e797f
18
bin/mpdevil
18
bin/mpdevil
@ -517,9 +517,9 @@ class ClientHelper():
|
|||||||
base_song[tag]=song[tag][0]
|
base_song[tag]=song[tag][0]
|
||||||
return base_song
|
return base_song
|
||||||
|
|
||||||
def calc_display_length(songs):
|
def calc_display_duration(songs):
|
||||||
length=sum([float(song.get("duration", 0.0)) for song in songs])
|
duration=sum([float(song.get("duration", 0.0)) for song in songs])
|
||||||
return ClientHelper.seconds_to_display_time(int(length))
|
return ClientHelper.seconds_to_display_time(int(duration))
|
||||||
|
|
||||||
def binary_to_pixbuf(binary, size):
|
def binary_to_pixbuf(binary, size):
|
||||||
loader=GdkPixbuf.PixbufLoader.new()
|
loader=GdkPixbuf.PixbufLoader.new()
|
||||||
@ -936,14 +936,6 @@ class Settings(Gio.Settings):
|
|||||||
array[pos]=value
|
array[pos]=value
|
||||||
self.set_value(key, GLib.Variant(vtype, array))
|
self.set_value(key, GLib.Variant(vtype, array))
|
||||||
|
|
||||||
def get_gtk_icon_size(self, key):
|
|
||||||
icon_size=self.get_int(key)
|
|
||||||
sizes=[(48, Gtk.IconSize.DIALOG), (32, Gtk.IconSize.DND), (24, Gtk.IconSize.LARGE_TOOLBAR), (16, Gtk.IconSize.BUTTON)]
|
|
||||||
for pixel_size, gtk_size in sizes:
|
|
||||||
if icon_size >= pixel_size:
|
|
||||||
return gtk_size
|
|
||||||
return Gtk.IconSize.INVALID
|
|
||||||
|
|
||||||
def get_artist_type(self):
|
def get_artist_type(self):
|
||||||
if self.get_boolean("use-album-artist"):
|
if self.get_boolean("use-album-artist"):
|
||||||
return ("albumartist")
|
return ("albumartist")
|
||||||
@ -2362,7 +2354,7 @@ class AlbumWindow(FocusFrame):
|
|||||||
def display_albums():
|
def display_albums():
|
||||||
for i, album in enumerate(albums):
|
for i, album in enumerate(albums):
|
||||||
# tooltip
|
# tooltip
|
||||||
duration=ClientHelper.calc_display_length(album["songs"])
|
duration=ClientHelper.calc_display_duration(album["songs"])
|
||||||
length=len(album["songs"])
|
length=len(album["songs"])
|
||||||
discs=album["songs"][-1].get("disc", 1)
|
discs=album["songs"][-1].get("disc", 1)
|
||||||
if type(discs) == list:
|
if type(discs) == list:
|
||||||
@ -3552,7 +3544,7 @@ class OutputPopover(Gtk.Popover):
|
|||||||
|
|
||||||
class VolumeButton(Gtk.VolumeButton):
|
class VolumeButton(Gtk.VolumeButton):
|
||||||
def __init__(self, client, settings):
|
def __init__(self, client, settings):
|
||||||
super().__init__(use_symbolic=True, size=settings.get_gtk_icon_size("icon-size"), can_focus=False)
|
super().__init__(use_symbolic=True, can_focus=False)
|
||||||
self._client=client
|
self._client=client
|
||||||
self._popover=None
|
self._popover=None
|
||||||
self._adj=self.get_adjustment()
|
self._adj=self.get_adjustment()
|
||||||
|
@ -51,11 +51,6 @@
|
|||||||
<summary>Size of icons in main control bar</summary>
|
<summary>Size of icons in main control bar</summary>
|
||||||
<description></description>
|
<description></description>
|
||||||
</key>
|
</key>
|
||||||
<key type="i" name="icon-size-sec">
|
|
||||||
<default>16</default>
|
|
||||||
<summary>Size of icons in secondary control bars</summary>
|
|
||||||
<description></description>
|
|
||||||
</key>
|
|
||||||
<key type="b" name="use-csd">
|
<key type="b" name="use-csd">
|
||||||
<default>true</default>
|
<default>true</default>
|
||||||
<summary>Use Client-side decoration</summary>
|
<summary>Use Client-side decoration</summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user