playlist_item now has a background part.
authorTilman Sauerbeck <tilman@code-monkey.de>
Sat, 28 May 2005 19:59:03 +0000 (19:59 +0000)
committerTilman Sauerbeck <tilman@code-monkey.de>
Sat, 28 May 2005 19:59:03 +0000 (19:59 +0000)
Also, it can be selected/unselected next to being hilighted/unhilighted.

src/playlist_item.rb

index cbf35014fe692665c88b432aa77cba51ab7d4441..c3ab305a980774f93c9d25dfeae1e5372ed03005 100644 (file)
@@ -1,16 +1,21 @@
-# $Id: playlist_item.rb 14 2005-04-24 20:38:32Z tilman $
+# $Id: playlist_item.rb 23 2005-05-28 19:59:03Z tilman $
 
 TEXT_COLOR_HILIGHT = "#f0fafd"
 
 EDJE.collection("playlist_item") do |c|
        c.set_size(150, 10)
 
+       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
@@ -24,7 +29,7 @@ EDJE.collection("playlist_item") do |c|
                end
        end
 
-       ["default", "selected"].each do |state|
+       ["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)
@@ -42,7 +47,7 @@ EDJE.collection("playlist_item") do |c|
                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.state = state == "unselected" ? "default" : state
@@ -53,6 +58,20 @@ EDJE.collection("playlist_item") do |c|
                end
        end
 
+       ["selected", "unselected"].each do |state|
+               c.program("playlist_item.#{state}", :set_state) do |p|
+                       p.signal = "playlist_item.#{state}"
+                       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 = "*"