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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41ba8e31de38b062a75bd8df10affb28a0ce1a8c
4
- data.tar.gz: 31b5a31846691cc2c60d5f5b9c273c6ab08e094f
3
+ metadata.gz: 98cf0b69c109f76d79c81a28871d2e565f65759f
4
+ data.tar.gz: 37dd71c150b46b051f88286d985bb4a2afe29bae
5
5
  SHA512:
6
- metadata.gz: 864be2fed0f632c05b98a8a498fd1a50040297973f780155f96eee75d32d7eba10e7d2f8d856f193384a203f53159210f1a22e89f4ece7d561b47a8e59980855
7
- data.tar.gz: b1c2b8e3907d6a6e3867e44a2675f2d08be9dd9853f0ff8727d433a4e4a4fd612704125ebb5d3b5538bf893e738a727c04e7f50b4cabad7a451e96b264006d0c
6
+ metadata.gz: 3fe6d3f4dc1ed908f3e1d5296c5bbe69bfea14ca5fcc98e9f108aeb529ebfdd36a7d69dc593b68024b2dfe2e2f3887aff648c924b11ba9b71d3259292970d917
7
+ data.tar.gz: b45031d37c2c66e0c8a1e2349c2d667cd4823484b226f366b475de7b53820ba84be9a4e580534657cccf0f86b7964dff1b9f8c6709150fe5c8b76c813c3f84c1
data/.gitignore CHANGED
@@ -7,3 +7,5 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ .*.swp
11
+ /vendor/
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.show_all
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
- @window = Gtk::Window.new
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
- @tabbar_down.pack_start(@add_tab_buttong, false)
209
- @tabbar_down.pack_start(@close_tab_button, false)
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
- @window_box.pack_start(@tabbar, false)
215
- @window_box.pack_start(@notebook)
216
- @window_box.pack_start(@search_entry, false)
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
- @window.show_all
220
+ @browser_box.show_all
227
221
  end
228
222
 
229
223
 
230
224
  def add_page(uri)
231
- newpage = BrowserPage.new(uri)
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)
@@ -1,3 +1,3 @@
1
1
  module TinyWebBrowser
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-10-31 00:00:00.000000000 Z
11
+ date: 2016-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler