Class: Rabbit::ThemeBrowser::Page
- Inherits:
-
Object
- Object
- Rabbit::ThemeBrowser::Page
- Extended by:
- Forwardable
- Defined in:
- lib/rabbit/theme-browser/page.rb
Instance Attribute Summary collapse
-
#widget ⇒ Object
readonly
Returns the value of attribute widget.
Instance Method Summary collapse
- #change_document(name, type) ⇒ Object
- #change_tree(name, type) ⇒ Object
- #default_size_changed(width, height) ⇒ Object
-
#initialize(browser) ⇒ Page
constructor
A new instance of Page.
- #reload ⇒ Object
- #themes ⇒ Object
Constructor Details
#initialize(browser) ⇒ Page
Returns a new instance of Page.
18 19 20 21 22 23 24 25 |
# File 'lib/rabbit/theme-browser/page.rb', line 18 def initialize(browser) super() @browser = browser @back_paths = [] @forward_paths = [] @forwarding = true init_gui end |
Instance Attribute Details
#widget ⇒ Object (readonly)
Returns the value of attribute widget.
16 17 18 |
# File 'lib/rabbit/theme-browser/page.rb', line 16 def @widget end |
Instance Method Details
#change_document(name, type) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rabbit/theme-browser/page.rb', line 27 def change_document(name, type) prev_name = @document.name unless prev_name.nil? paths = @forwarding ? @back_paths : @forward_paths paths.push([prev_name, @document.type]) end @document.change_buffer(name, type) @up.sensitive = @document.type == "theme" end |
#change_tree(name, type) ⇒ Object
38 39 40 |
# File 'lib/rabbit/theme-browser/page.rb', line 38 def change_tree(name, type) @tree.select(name, type) end |
#default_size_changed(width, height) ⇒ Object
46 47 48 |
# File 'lib/rabbit/theme-browser/page.rb', line 46 def default_size_changed(width, height) @hpaned.position = width * 0.25 end |
#reload ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/rabbit/theme-browser/page.rb', line 50 def reload position = @hpaned.position name, type = @document.name, @document.type @widget.remove(@hpaned) @browser.load_themes Tag.reload_tag_infos init_view @hpaned.position = position @hpaned.show_all change_tree(name, type) if name and type end |
#themes ⇒ Object
42 43 44 |
# File 'lib/rabbit/theme-browser/page.rb', line 42 def themes @browser.themes end |