Removed RCS-style IDs.
[multipass-eu.git] / src / playlist-buttons.rb
1 c = EDJE.collection("playlist")
2 root = c.part("root")
3 right = c.part("playlist.background.titlebar.right")
4
5 buttons = []
6
7 h = {"playlist.button.close" => ["close", [right, -10, 5]],
8      "playlist.button.switch" => [nil, [right, -30, 5]],
9      "playlist.button.system" => [nil, [root, 5, 5]]}
10 h.each do |name, (sig, (rel, x, y))|
11         args = [c, name, rel, image_from_name(name), x, y]
12         args << sig unless sig.nil?
13
14         buttons << (sig.nil? ? Button : SignalButton).new(*args).part
15 end
16
17 c.part("playlist.buttons.top.clip", :rect) do |p|
18         p.description do |d|
19                 d.rel[0].set_to(c.part("playlist.background.titlebar.left"))
20                 d.rel[1].set_to(c.part("playlist.background.titlebar.right"))
21         end
22
23         buttons.each { |b| b.clip = p }
24 end
25
26 buttons.clear
27
28 root = c.part("playlist.background.footer.left")
29
30 h = {"playlist.button.add" => ["file_dialog.open", [5, 5]],
31      "playlist.button.rem" => ["playlist_item.remove", [35, 5]],
32      "playlist.button.sel" => [nil, [65, 5]],
33      "playlist.button.misc" => [nil, [95, 5]]}
34 h.each do |name, (sig, (x, y))|
35         args = [c, name, root, nil, x, y]
36         args << sig unless sig.nil?
37
38         md = name.match(/playlist.button\.(.*)$/)
39         args[3] = "button-pl-" + md.captures.first.gsub(".", "-")
40
41         buttons << (sig.nil? ? Button : SignalButton).new(*args).part
42 end
43
44 c.part("playlist.buttons.footer.clip", :rect) do |p|
45         p.description do |d|
46                 d.rel[0].set_to(c.part("playlist.background.footer.left"))
47                 d.rel[1].set_to(c.part("playlist.background.footer.right"))
48         end
49
50         buttons.each { |b| b.clip = p }
51 end