-# $Id: playlist-background.rb 15 2005-04-25 21:46:52Z tilman $
+# $Id: playlist-background.rb 16 2005-04-25 22:01:53Z tilman $
c = EDJE.collection("playlist")
root = c.part("root")
p.description do |d|
d.rel[0].set_to(c.part("playlist.background.middle"))
d.rel[1].set_to(c.part("playlist.background.middle"))
+
+ # leave some space for the scrollbar
+ d.rel[1].set_offset(-19, -1)
end
end
--- /dev/null
+# $Id: playlist-scrollbar.rb 16 2005-04-25 22:01:53Z tilman $
+
+c = EDJE.collection("playlist")
+
+c.part("playlist.scrollbar.trough", :rect) do |p|
+ p.description do |d|
+ d.rel[0].set_to(c.part("playlist.container"))
+ d.rel[1].set_to(c.part("playlist.background.middle"))
+
+ d.rel[0].set_rel(1.0, 0.0)
+ d.rel[0].set_offset(5, 0)
+
+ d.color = "#00000000"
+ end
+end
+
+c.part("playlist.scrollbar.handle", :image) do |p|
+ p.dragable.enabled[1] = true
+ p.dragable.step[1] = 1
+ p.dragable.count[1] = 1
+ p.dragable.confine = c.part("playlist.scrollbar.trough")
+
+ ["normal", "hover", "down"].each do |state|
+ s = state == "normal" ? "default" : state
+
+ p.description(s) do |d|
+ d.set_size(13, 41)
+ d.image = "images/scroll-grip-#{state}.png"
+ end
+ end
+end
+
+{"in" => "hover", "out" => "default",
+ "down,1" => "down", "up,1" => "hover"}.each do |(ev, state)|
+ c.program("playlist.scrollbar.handle.#{ev}", :set_state) do |p|
+ p.signal = "mouse,#{ev}"
+ p.source = "playlist.scrollbar.handle"
+ p.state = state
+ p.time = 0.1
+ p.targets << ProgramTarget.new(c.part(p.source))
+ end
+end
-# $Id: playlist.rb 13 2005-04-24 19:56:20Z tilman $
+# $Id: playlist.rb 16 2005-04-25 22:01:53Z tilman $
EDJE.collection("playlist") do |c|
c.set_min(300, 250)
load "src/playlist-background.rb"
load "src/playlist-buttons.rb"
+ load "src/playlist-scrollbar.rb"
end