sublime_music.ui.common package

Module contents

class sublime_music.ui.common.AlbumWithSongs(album, cover_art_size=200, show_artist_name=True)[source]

Bases: gi.overrides.Gtk.Box

Parameters
__init__(album, cover_art_size=200, show_artist_name=True)[source]

Initializer for a GObject based classes with support for property sets through the use of explicit keyword arguments.

Parameters
deselect_all()[source]
offline_mode = True
on_download_all_click(btn)[source]
Parameters

btn (Any) –

on_song_activated(treeview, idx, column)[source]
Parameters
  • treeview (Any) –

  • idx (gi.overrides.Gtk.TreePath) –

  • column (Any) –

on_song_button_press(tree, event)[source]
Parameters
  • tree (Any) –

  • event (gi.overrides.Gdk.EventButton) –

Return type

bool

on_song_selection_change(event)[source]
Parameters

event (Any) –

play_btn_clicked(btn)[source]
Parameters

btn (Any) –

set_loading(loading)[source]
Parameters

loading (bool) –

shuffle_btn_clicked(btn)[source]
Parameters

btn (Any) –

update(app_config=None, force=False)[source]
Parameters
update_album_songs(album, app_config, force=False, order_token=None, is_partial=False)[source]
Parameters
class sublime_music.ui.common.IconButton(icon_name, tooltip_text='', relief=False, icon_size=<enum GTK_ICON_SIZE_BUTTON of type Gtk.IconSize>, label=None, **kwargs)[source]

Bases: gi.overrides.Gtk.Button

Parameters
  • icon_name (Optional[str]) –

  • tooltip_text (str) –

  • relief (bool) –

  • icon_size (gi.repository.Gtk.IconSize) –

  • label (str | None) –

__init__(icon_name, tooltip_text='', relief=False, icon_size=<enum GTK_ICON_SIZE_BUTTON of type Gtk.IconSize>, label=None, **kwargs)[source]
Parameters
set_icon(icon_name)[source]
Parameters

icon_name (Optional[str]) –

class sublime_music.ui.common.IconMenuButton(icon_name=None, tooltip_text='', relief=True, icon_size=<enum GTK_ICON_SIZE_BUTTON of type Gtk.IconSize>, label=None, popover=None, **kwargs)[source]

Bases: gi.repository.Gtk.MenuButton

Parameters
  • icon_name (Optional[str]) –

  • tooltip_text (str) –

  • relief (bool) –

  • icon_size (gi.repository.Gtk.IconSize) –

  • label (str | None) –

  • popover (Any) –

__init__(icon_name=None, tooltip_text='', relief=True, icon_size=<enum GTK_ICON_SIZE_BUTTON of type Gtk.IconSize>, label=None, popover=None, **kwargs)[source]
Parameters
set_from_file(icon_file)[source]
Parameters

icon_file (Optional[str]) –

set_icon(icon_name)[source]
Parameters

icon_name (Optional[str]) –

class sublime_music.ui.common.IconToggleButton(icon_name, tooltip_text='', relief=False, icon_size=<enum GTK_ICON_SIZE_BUTTON of type Gtk.IconSize>, label=None, **kwargs)[source]

Bases: gi.repository.Gtk.ToggleButton

Parameters
  • icon_name (Optional[str]) –

  • tooltip_text (str) –

  • relief (bool) –

  • icon_size (gi.repository.Gtk.IconSize) –

  • label (str | None) –

__init__(icon_name, tooltip_text='', relief=False, icon_size=<enum GTK_ICON_SIZE_BUTTON of type Gtk.IconSize>, label=None, **kwargs)[source]
Parameters
get_active(self) bool[source]
Return type

bool

set_active(self, is_active: bool)[source]
Parameters

active (bool) –

set_icon(icon_name)[source]
Parameters

icon_name (Optional[str]) –

class sublime_music.ui.common.LoadError(entity_name, action, has_data, offline_mode)[source]

Bases: gi.overrides.Gtk.Box

Parameters
  • entity_name (str) –

  • action (str) –

  • has_data (bool) –

  • offline_mode (bool) –

__init__(entity_name, action, has_data, offline_mode)[source]

Initializer for a GObject based classes with support for property sets through the use of explicit keyword arguments.

Parameters
  • entity_name (str) –

  • action (str) –

  • has_data (bool) –

  • offline_mode (bool) –

class sublime_music.ui.common.RatingButtonBox(icon_rated='star-full', icon_unrated='star-empty', **kwargs)[source]

Bases: gi.overrides.Gtk.Box

A simple GtkBox containing buttons that allow rating something. It doesn’t know what it’s rating just what the rating is when it changed

Parameters
  • icon_rated (str) –

  • icon_unrated (str) –

MAX_VALUE = 5
__init__(icon_rated='star-full', icon_unrated='star-empty', **kwargs)[source]

Initializer for a GObject based classes with support for property sets through the use of explicit keyword arguments.

Parameters
  • icon_rated (str) –

  • icon_unrated (str) –

property rating: int | None
validate_rating(rating)[source]
Parameters

rating (int | None) –

class sublime_music.ui.common.SongListColumn(header, text_idx, bold=False, align=0, width=None)[source]

Bases: gi.overrides.Gtk.TreeViewColumn

Parameters
  • header (str) –

  • text_idx (int) –

  • bold (bool) –

  • align (float) –

  • width (int | None) –

__init__(header, text_idx, bold=False, align=0, width=None)[source]

Represents a column in a song list.

Parameters
class sublime_music.ui.common.SpinnerImage(loading=True, image_name=None, spinner_name=None, image_size=None, **kwargs)[source]

Bases: gi.repository.Gtk.Overlay

Parameters
  • loading (bool) –

  • image_name (str | None) –

  • spinner_name (str | None) –

  • image_size (int | None) –

__init__(loading=True, image_name=None, spinner_name=None, image_size=None, **kwargs)[source]

An image with a loading overlay.

Parameters
set_from_file(filename)[source]

Set the image to the given filename.

Parameters

filename (Optional[str]) –

set_image_size(size)[source]
Parameters

size (int) –

set_loading(loading_status)[source]
Parameters

loading_status (bool) –