[go: up one dir, main page]

File: disk_element.py

package info (click to toggle)
cozy 1.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,140 kB
  • sloc: python: 8,014; xml: 392; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 719 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from gi.repository import Gtk


class DiskElement(Gtk.Box):
    """
    This class represents a small disk number header for the book overview track list.
    """

    def __init__(self, disc_number):
        super().__init__()
        self.add_css_class("dim-label")

        if disc_number > 1:
            self.set_margin_top(18)
        self.set_margin_bottom(3)
        self.set_margin_start(6)

        image = Gtk.Image.new_from_icon_name("media-optical-cd-audio-symbolic")
        self.append(image)

        label = Gtk.Label(margin_start=5)
        text = _("Disc") + " " + str(disc_number)  # TODO: use formatted translation string here
        label.set_markup(f"<b>{text}</b>")
        self.append(label)