2
public class Audience.Widgets.TimeWidget : Gtk.Grid {
3
public Gtk.Label progression_label;
4
public Gtk.Label time_label;
5
public Gtk.ProgressBar progress_bar;
6
public signal void seeked (double val);
9
orientation = Gtk.Orientation.HORIZONTAL;
11
progression_label = new Gtk.Label ("");
12
time_label = new Gtk.Label ("");
13
progress_bar = new Gtk.ProgressBar ();
14
progress_bar.hexpand = true;
15
add (progression_label);
20
public override void get_preferred_width (out int minimum_width, out int natural_width) {
21
base.get_preferred_width (out minimum_width, out natural_width);
23
var width = parent.get_window ().get_width ();
24
if (width > 0 && width >= minimum_width) {
25
natural_width = width;
29
public void set_progression_time (double current_time, double total_time) {
30
progress_bar.fraction = current_time/total_time;
31
progression_label.label = seconds_to_time ((int)(current_time / 1000000000));
32
time_label.label = "-%s".printf (seconds_to_time ((int)((total_time - current_time) / 1000000000)));
b'\\ No newline at end of file'