tiny_web_browser 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/exe/tiny_web_browser +6 -1
- data/lib/tiny_web_browser/browser.rb +12 -20
- data/lib/tiny_web_browser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98cf0b69c109f76d79c81a28871d2e565f65759f
|
4
|
+
data.tar.gz: 37dd71c150b46b051f88286d985bb4a2afe29bae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fe6d3f4dc1ed908f3e1d5296c5bbe69bfea14ca5fcc98e9f108aeb529ebfdd36a7d69dc593b68024b2dfe2e2f3887aff648c924b11ba9b71d3259292970d917
|
7
|
+
data.tar.gz: b45031d37c2c66e0c8a1e2349c2d667cd4823484b226f366b475de7b53820ba84be9a4e580534657cccf0f86b7964dff1b9f8c6709150fe5c8b76c813c3f84c1
|
data/.gitignore
CHANGED
data/exe/tiny_web_browser
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
require 'tiny_web_browser'
|
4
4
|
|
5
|
+
window = Gtk::Window.new
|
6
|
+
window.signal_connect('destroy') do
|
7
|
+
Gtk.main_quit
|
8
|
+
end
|
5
9
|
browser = TinyWebBrowser::Browser.new('https://google.com')
|
6
|
-
browser.
|
10
|
+
window.add(browser.get_widget)
|
11
|
+
window.show_all
|
7
12
|
Gtk.main
|
@@ -6,12 +6,7 @@ module TinyWebBrowser
|
|
6
6
|
class Browser
|
7
7
|
|
8
8
|
def initialize(uri)
|
9
|
-
@
|
10
|
-
@window.signal_connect('destroy') do
|
11
|
-
Gtk.main_quit
|
12
|
-
end
|
13
|
-
|
14
|
-
@window_box = Gtk::VBox.new
|
9
|
+
@browser_box = Gtk::VBox.new
|
15
10
|
@notebook = Gtk::Notebook.new
|
16
11
|
|
17
12
|
@shift_pressed = false
|
@@ -20,7 +15,6 @@ module TinyWebBrowser
|
|
20
15
|
|
21
16
|
@tabbar = Gtk::VBox.new
|
22
17
|
@tabbar_up = Gtk::HBox.new
|
23
|
-
@tabbar_down = Gtk::HBox.new
|
24
18
|
@go_back_button = Gtk::Button.new('戻る')
|
25
19
|
@go_forward_button = Gtk::Button.new('進む')
|
26
20
|
@uri_entry = Gtk::Entry.new
|
@@ -38,7 +32,7 @@ module TinyWebBrowser
|
|
38
32
|
end
|
39
33
|
|
40
34
|
@notebook.signal_connect('key-press-event') do |widget, event|
|
41
|
-
puts "notebook #{Gdk::Keyval.to_name(event.keyval)} pressed"
|
35
|
+
#puts "notebook #{Gdk::Keyval.to_name(event.keyval)} pressed"
|
42
36
|
#puts "notebook #{Gdk::Keyval.to_unicode(event.keyval)} pressed"
|
43
37
|
case event.keyval
|
44
38
|
when Gdk::Keyval::GDK_KEY_minus
|
@@ -205,32 +199,30 @@ module TinyWebBrowser
|
|
205
199
|
@tabbar_up.pack_start(@go_forward_button, false)
|
206
200
|
@tabbar_up.pack_start(@uri_entry)
|
207
201
|
@tabbar_up.pack_start(@open_uri_button, false)
|
208
|
-
@
|
209
|
-
@
|
202
|
+
@tabbar_up.pack_start(@add_tab_buttong, false)
|
203
|
+
@tabbar_up.pack_start(@close_tab_button, false)
|
210
204
|
|
211
205
|
@tabbar.pack_start(@tabbar_up)
|
212
|
-
@tabbar.pack_start(@tabbar_down)
|
213
206
|
|
214
|
-
@
|
215
|
-
@
|
216
|
-
@
|
217
|
-
|
218
|
-
@window.add(@window_box)
|
207
|
+
@browser_box.pack_start(@tabbar, false)
|
208
|
+
@browser_box.pack_start(@notebook)
|
209
|
+
@browser_box.pack_start(@search_entry, false)
|
219
210
|
|
220
211
|
@pages = []
|
221
212
|
add_page(uri)
|
222
213
|
end
|
223
214
|
|
215
|
+
def get_widget
|
216
|
+
@browser_box
|
217
|
+
end
|
224
218
|
|
225
219
|
def show_all
|
226
|
-
@
|
220
|
+
@browser_box.show_all
|
227
221
|
end
|
228
222
|
|
229
223
|
|
230
224
|
def add_page(uri)
|
231
|
-
|
232
|
-
@pages << newpage
|
233
|
-
#@notebook.append_page(@pages[@pages.length - 1].get_page_widget, @pages[@pages.length - 1].get_label_widget)
|
225
|
+
@pages << BrowserPage.new(uri)
|
234
226
|
@notebook.append_page(@pages[@pages.length - 1].get_widget)
|
235
227
|
@notebook.show_all
|
236
228
|
@notebook.set_page(@notebook.n_pages - 1)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiny_web_browser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- trorornmn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|