機能 #1197 » 1197.patch
core/mui/cairo_miracle_painter.rb | ||
---|---|---|
177 | 177 |
def point_moved(x, y) |
178 | 178 |
point_moved_main_icon(x, y) |
179 | 179 |
signal_emit(:motion_notify_event, x, y) |
180 |
textselector_select(*main_pos_to_index_forclick(x, y)[1..2]) end |
|
180 |
textselector_select(*main_pos_to_index_forclick(x, y)[1..2]) |
|
181 | ||
182 |
# change cursor shape |
|
183 |
index = main_pos_to_index(x, y) |
|
184 |
c = if index # the cursor is placed on text |
|
185 |
if message.links.respond_to?(:segment_by_index) \ |
|
186 |
&& message.links.segment_by_index(index) |
|
187 |
# the cursor is placed on link |
|
188 |
Gdk::Cursor.new(Gdk::Cursor::HAND1) |
|
189 |
else |
|
190 |
Gdk::Cursor.new(Gdk::Cursor::XTERM) |
|
191 |
end |
|
192 |
else |
|
193 |
Gdk::Cursor.new(Gdk::Cursor::LEFT_PTR) |
|
194 |
end |
|
195 |
@tree.get_ancestor(Gtk::Window).window.set_cursor(c) |
|
196 |
end |
|
181 | 197 | |
182 | 198 |
# leaveイベントを発生させる |
183 | 199 |
def point_leaved(x, y) |
184 | 200 |
iob_main_leave |
185 | 201 |
signal_emit(:leave_notify_event) |
186 | 202 |
# textselector_release |
203 | ||
204 |
# restore cursor shape |
|
205 |
c = Gdk::Cursor.new(Gdk::Cursor::LEFT_PTR) |
|
206 |
@tree.get_ancestor(Gtk::Window).window.set_cursor(c) |
|
187 | 207 |
end |
188 | 208 | |
189 | 209 |
# MiraclePainterが選択解除されたことを通知する |