repo.or.cz
/
kaya.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Implemented layouting.
[kaya.git]
/
lib
/
item.rb
blob
c90d92c1bd4f08edcfef16ad097d7f9b1e573907
1
require 'qtutils'
2
3
class Item < Qt::GraphicsPixmapItem
4
attr_reader :name, :item
5
attr_reader :opacity
6
7
def initialize(name, pixmap, parent, scene)
8
super pixmap, parent, scene
9
@name = name
10
@opacity = 1.0
11
end
12
13
def paint(p, options, widget)
14
p.saving do |p|
15
p.opacity = @opacity
16
super p, options, widget
17
end
18
end
19
20
def opacity=(value)
21
@opacity = value
22
update
23
end
24
25
def remove
26
scene.remove_item self
27
end
28
end