1 c = EDJE.collection("playlist")
3 right = c.part("playlist.background.titlebar.right")
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?
14 buttons << (sig.nil? ? Button : SignalButton).new(*args).part
17 c.part("playlist.buttons.top.clip", :rect) do |p|
19 d.rel[0].set_to(c.part("playlist.background.titlebar.left"))
20 d.rel[1].set_to(c.part("playlist.background.titlebar.right"))
23 buttons.each { |b| b.clip = p }
28 root = c.part("playlist.background.footer.left")
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?
38 md = name.match(/playlist.button\.(.*)$/)
39 args[3] = "button-pl-" + md.captures.first.gsub(".", "-")
41 buttons << (sig.nil? ? Button : SignalButton).new(*args).part
44 c.part("playlist.buttons.footer.clip", :rect) do |p|
46 d.rel[0].set_to(c.part("playlist.background.footer.left"))
47 d.rel[1].set_to(c.part("playlist.background.footer.right"))
50 buttons.each { |b| b.clip = p }