-# $Id: multipass.rb 6 2005-04-24 09:36:27Z tilman $
+# $Id: multipass.rb 7 2005-04-24 10:46:14Z tilman $
require "src/slider.rb"
require "src/button.rb"
end
load "src/playlist-background.rb"
+ load "src/playlist-buttons.rb"
end
EDJE.collection("playlist_item") do |c|
-# $Id: player-main-buttons.rb 4 2005-04-23 16:06:34Z tilman $
+# $Id: player-main-buttons.rb 7 2005-04-24 10:46:14Z tilman $
c = EDJE.collection("euphoria")
root = c.part("root")
buttons = []
def image_from_name(name)
- md = name.match(/^player\.(.*)$/)
+ md = name.match(/\.(.*)$/)
md.nil? ? name : md.captures.first.gsub(".", "-")
end
--- /dev/null
+# $Id: playlist-buttons.rb 7 2005-04-24 10:46:14Z tilman $
+
+c = EDJE.collection("playlist")
+root = c.part("root")
+right = c.part("playlist.background.titlebar.right")
+
+buttons = []
+
+h = {"playlist.button.close" => ["close", [right, -10, 5]],
+ "playlist.button.switch" => [nil, [right, -30, 5]],
+ "playlist.button.system" => [nil, [root, 5, 5]]}
+h.each do |name, (sig, (rel, x, y))|
+ args = [c, name, rel, image_from_name(name), x, y]
+ args << sig unless sig.nil?
+
+ buttons << (sig.nil? ? Button : SignalButton).new(*args).part
+end