aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorToshiaki Asai <toshi.alternative@gmail.com>2016-10-12 07:06:08 +0900
committerToshiaki Asai <toshi.alternative@gmail.com>2016-10-12 07:06:08 +0900
commit146fa3dc4de97ba9801fa11790cb37f8f20f32cb (patch)
treecd14fe7681f9dfad1285b0f6322eb30f81377cc4 /core
parent9f88954ff550ab8327b4037ce962eab7b3257a32 (diff)
downloadmikutter-146fa3dc4de97ba9801fa11790cb37f8f20f32cb.tar.gz
entityにcallbackを指定しなくてもintentを使ってリンクを開く機能 refs #870
Diffstat (limited to 'core')
-rw-r--r--core/mui/cairo_miracle_painter.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/mui/cairo_miracle_painter.rb b/core/mui/cairo_miracle_painter.rb
index 35f3a0e3..c3251dc3 100644
--- a/core/mui/cairo_miracle_painter.rb
+++ b/core/mui/cairo_miracle_painter.rb
@@ -150,7 +150,12 @@ class Gdk::MiraclePainter < Gtk::Object
index = main_pos_to_index(x, y)
if index and message.links.respond_to?(:segment_by_index)
l = message.links.segment_by_index(index)
- l[:callback].call(l) if l and l[:callback] end end
+ if l
+ case
+ when l[:callback]
+ l[:callback].call(l)
+ when l[:open]
+ Plugin.call(:open, l[:open]) end end end end
when 3
@tree.get_ancestor(Gtk::Window).set_focus(@tree)
Plugin::GUI::Command.menu_pop