Class: MittensUi::HeaderBar
Instance Attribute Summary
Attributes inherited from Core
Instance Method Summary collapse
-
#initialize(widgets, options = {}) ⇒ HeaderBar
constructor
A new instance of HeaderBar.
- #render ⇒ Object
Methods inherited from Core
#hidden?, #hide, #remove, #show
Methods included from Helpers
#icon_map, #list_system_icons, #set_margin_from_opts_for
Constructor Details
#initialize(widgets, options = {}) ⇒ HeaderBar
Returns a new instance of HeaderBar.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/mittens_ui/header_bar.rb', line 5 def initialize(, = {}) title = [:title].nil? ? "" : [:title] position = [:position].nil? ? :left : [:position] box = Gtk::Box.new(:horizontal, 0) box.style_context.add_class("linked") @header = Gtk::HeaderBar.new @header. = true @header.title = title @header.has_subtitle = false .each do |w| w.remove case position when :left box.pack_start(w.) when :right box.pack_end(w.) else box.pack_start(w.) end end if position == :left @header.pack_start(box) end if position == :right @header.pack_end(box) end super(@header, ) end |
Instance Method Details
#render ⇒ Object
40 41 42 43 |
# File 'lib/mittens_ui/header_bar.rb', line 40 def render $app_window. = @header return self end |