3
public class SettingRow : Gtk.ListBoxRow {
4
public Metronome.Setting setting { get; set; }
6
private Gtk.Label title_label;
7
private Gtk.Label tempo_label;
8
private Gtk.Label beat_label;
10
public SettingRow (Metronome.Setting setting) {
11
this.setting = setting;
12
this.setting.beat_changed.connect ((new_beat) => {
13
beat_label.label = "%d Beat".printf((int)new_beat);
15
this.setting.tempo_changed.connect ((new_tempo) => {
16
tempo_label.label = "%d BPM".printf((int)new_tempo);
19
var grid = new Gtk.Grid ();
25
title_label = new Gtk.Label (setting.title);
26
title_label.halign = Gtk.Align.START;
27
title_label.get_style_context ().add_class ("h3");
28
title_label.expand = true;
29
title_label.margin_left = 4;
31
tempo_label = new Gtk.Label ("%d BPM".printf((int)setting.tempo));
32
tempo_label.use_markup = true;
33
tempo_label.halign = Gtk.Align.END;
34
tempo_label.opacity = 0.6;
35
tempo_label.margin_right = 4;
37
beat_label = new Gtk.Label ("%d Beat".printf((int)setting.beat));
38
beat_label.use_markup = true;
39
beat_label.halign = Gtk.Align.END;
40
beat_label.opacity = 0.6;
41
beat_label.margin_right = 4;
43
grid.attach (title_label, 0, 0, 2, 1);
44
grid.attach (tempo_label, 0, 1, 1, 1);
45
grid.attach (beat_label, 1, 1, 1, 1);
46
grid.attach (new Gtk.Separator (Gtk.Orientation.HORIZONTAL), 0, 2, 2, 1);