X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fplaylist_item.rb;h=cec85721a5cc82a1ff7a892bbe40d0feabb8909d;hb=HEAD;hp=3931a7a4685b7d1878509d197ec8af356991a49f;hpb=ba495b9b0c946836ad5c4eda8ab1b1d1b9666351;p=multipass-eu.git diff --git a/src/playlist_item.rb b/src/playlist_item.rb index 3931a7a..cec8572 100644 --- a/src/playlist_item.rb +++ b/src/playlist_item.rb @@ -1,22 +1,25 @@ -# $Id: playlist_item.rb 11 2005-04-24 18:00:39Z tilman $ - TEXT_COLOR_HILIGHT = "#f0fafd" EDJE.collection("playlist_item") do |c| c.set_size(150, 10) - ["title", "length"].each do |name| + c.part("background", :rect) do |p| + p.description.color = "#00000000" + p.description("selected").color = "#414141" + end + + ["title", "duration"].each do |name| c.part(name, :text) do |p| p.effect = :outline {"default" => TEXT_COLOR, - "selected" => TEXT_COLOR_HILIGHT}.each do |(state, color)| + "hilighted" => TEXT_COLOR_HILIGHT}.each do |(state, color)| p.description(state) do |d| d.color = color d.outline_color = OUTLINE_COLOR - d.font = "fonts/acknowledge2.ttf" - d.font_size = 12 + d.font = "slkscrb.ttf" + d.font_size = 8 d.text = "Dark Tranquillity - Through Smudged Lenses" d.set_text_align(0.0) end @@ -24,24 +27,51 @@ EDJE.collection("playlist_item") do |c| end end - ["default", "selected"].each do |state| - c.part("length").description(state) do |d| + ["default", "hilighted"].each do |state| + c.part("title").description(state) do |d| + d.rel[1].set_to(c.part("duration"), nil) + d.rel[1].set_rel(0.0, 1.0) + + #d.rel[0].set_offset(0, 0) + d.rel[1].set_offset(5, 0) + end + + c.part("duration").description(state) do |d| + d.rel[0].set_rel(1.0, 0.0) + d.rel[0].set_offset(-35, 0) + d.text = "04:11" d.set_text_align(1.0) end end - ["selected", "unselected"].each do |state| + ["hilighted", "unhilighted"].each do |state| c.program("playlist_item.#{state}", :set_state) do |p| p.signal = "playlist_item.#{state}" + p.source = "*" p.state = state == "unselected" ? "default" : state p.mode = state == "selected" ? :accelerate : :decelerate p.time = 0.5 p.targets << ProgramTarget.new(c.part("title")) - p.targets << ProgramTarget.new(c.part("length")) + p.targets << ProgramTarget.new(c.part("duration")) end end + ["selected", "unselected"].each do |state| + c.program("playlist_item.#{state}", :set_state) do |p| + p.signal = "playlist_item.#{state}" + p.source = "*" + p.state = state + p.targets << ProgramTarget.new(c.part("background")) + end + end + + c.program("playlist_item.click", :emit_signal) do |p| + p.signal = "mouse,clicked,1" + p.source = "*" + p.emission_signal = "playlist_item.selected" + end + c.program("playlist_item.doubleclick", :emit_signal) do |p| p.signal = "mouse,down,1,double" p.source = "*"