lib/mdv/markdown_viewer.rb in mdv-0.2.2 vs lib/mdv/markdown_viewer.rb in mdv-0.3.0
- old
+ new
@@ -1,7 +1,6 @@
-require 'gir_ffi-gtk3'
-GirFFI.setup :WebKit2, '4.0'
+require 'webkit2-gtk'
module MDV
# Markdown viewer window class
class MarkdownViewer
attr_reader :file
@@ -25,11 +24,11 @@
@win.signal_connect('destroy') { Gtk.main_quit }
end
def connect_key_press_event_signal
@win.signal_connect 'key-press-event' do |_wdg, evt, _ud|
- handle_key(evt) if evt.state[:control_mask]
+ handle_key(evt) if evt.state.control_mask?
false
end
end
def handle_key(evt)
@@ -53,10 +52,10 @@
it.add web_view
end
end
def web_view
- @wv ||= WebKit2::WebView.new
+ @wv ||= WebKit2Gtk::WebView.new
end
def fullpath
@fullpath ||= File.expand_path(file, Dir.pwd)
end