Commit 2aa733b7 authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko Committed by Marinus Schraal

Use tabular numbers for song duration

Essentially force monospace for digits if the font supports it. This allows
durations to stay aligned with each other and prevents seekbar changing
size each second.
parent 10862ca0
......@@ -204,6 +204,9 @@
<property name="halign">start</property>
<property name="valign">center</property>
<property name="label">0:00</property>
<attributes>
<attribute name="font-features" value="tnum=1"/>
</attributes>
</object>
<packing>
<property name="position">0</property>
......@@ -228,6 +231,9 @@
<property name="halign">start</property>
<property name="valign">center</property>
<property name="label">0:00</property>
<attributes>
<attribute name="font-features" value="tnum=1"/>
</attributes>
</object>
<packing>
<property name="position">2</property>
......
......@@ -146,6 +146,9 @@
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="single_line_mode">True</property>
<attributes>
<attribute name="font-features" value="tnum=1"/>
</attributes>
</object>
</child>
</object>
......
......@@ -128,7 +128,9 @@ class SongsView(BaseView):
column_album.props.expand = True
self._view.append_column(column_album)
duration_renderer = Gtk.CellRendererText(xalign=1.0)
attrs = Pango.AttrList()
attrs.insert(Pango.AttrFontFeatures.new("tnum=1"))
duration_renderer = Gtk.CellRendererText(xalign=1.0, attributes=attrs)
column_duration = Gtk.TreeViewColumn(
"Duration", duration_renderer, text=5)
self._view.append_column(column_duration)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment