add button bindings
Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>
This commit is contained in:
parent
50e3c81eb3
commit
b0c17209ed
1 changed files with 21 additions and 0 deletions
|
@ -19,6 +19,12 @@ public class Extension.Player : Gtk.Box {
|
|||
private unowned Gtk.Label title;
|
||||
[GtkChild]
|
||||
private unowned Gtk.Label artist;
|
||||
[GtkChild]
|
||||
private unowned Gtk.Button pause;
|
||||
[GtkChild]
|
||||
private unowned Gtk.Button back;
|
||||
[GtkChild]
|
||||
private unowned Gtk.Button next;
|
||||
|
||||
private string id = Uuid.string_random ();
|
||||
private Gtk.CssProvider css_provider = new Gtk.CssProvider ();
|
||||
|
@ -175,6 +181,21 @@ public class Extension.Player : Gtk.Box {
|
|||
}
|
||||
|
||||
private void bind_to_control_box (Gtk.Box box) {
|
||||
foreach (var child in box.get_children ()) {
|
||||
switch (child.get_name ()) {
|
||||
case "btn_play":
|
||||
pause.clicked.connect (() => ((Gtk.Button) child).clicked ());
|
||||
break;
|
||||
case "btn_prev":
|
||||
back.clicked.connect (() => ((Gtk.Button) child).clicked ());
|
||||
break;
|
||||
case "btn_next":
|
||||
next.clicked.connect (() => ((Gtk.Button) child).clicked ());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void bind_to_duration_box (Gtk.Box box) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue