1 # $Id: playlist_item.rb 12 2005-04-24 19:51:18Z tilman $
3 TEXT_COLOR_HILIGHT = "#f0fafd"
5 EDJE.collection("playlist_item") do |c|
8 ["title", "length"].each do |name|
9 c.part(name, :text) do |p|
12 {"default" => TEXT_COLOR,
13 "selected" => TEXT_COLOR_HILIGHT}.each do |(state, color)|
14 p.description(state) do |d|
16 d.outline_color = OUTLINE_COLOR
18 d.font = "fonts/acknowledge2.ttf"
20 d.text = "Dark Tranquillity - Through Smudged Lenses"
27 ["default", "selected"].each do |state|
28 c.part("title").description(state) do |d|
29 d.rel[1].set_to(c.part("length"), nil)
30 d.rel[1].set_rel(0.0, 1.0)
32 #d.rel[0].set_offset(0, 0)
33 d.rel[1].set_offset(5, 0)
36 c.part("length").description(state) do |d|
37 d.rel[0].set_rel(1.0, 0.0)
38 d.rel[0].set_offset(-35, 0)
45 ["selected", "unselected"].each do |state|
46 c.program("playlist_item.#{state}", :set_state) do |p|
47 p.signal = "playlist_item.#{state}"
48 p.state = state == "unselected" ? "default" : state
49 p.mode = state == "selected" ? :accelerate : :decelerate
51 p.targets << ProgramTarget.new(c.part("title"))
52 p.targets << ProgramTarget.new(c.part("length"))
56 c.program("playlist_item.doubleclick", :emit_signal) do |p|
57 p.signal = "mouse,down,1,double"
59 p.emission_signal = "playlist_item.play"