Class: Fidgit::MenuPane::Separator

Inherits:
Label show all
Defined in:
lib/fidgit/elements/menu_pane.rb

Constant Summary

Constants inherited from Label

Label::VALID_JUSTIFICATION

Constants inherited from Element

Element::DEFAULT_SCHEMA_FILE, Element::VALID_ALIGN_H, Element::VALID_ALIGN_V

Instance Attribute Summary

Attributes inherited from Label

#background_color, #border_color, #color, #icon, #text

Attributes inherited from Element

#align_h, #align_v, #background_color, #border_thickness, #font_size, #padding_bottom, #padding_left, #padding_right, #padding_top, #parent, #tip, #z

Instance Method Summary collapse

Methods inherited from Label

#draw_foreground

Methods inherited from Element

#default, #drag?, #draw, #draw_frame, #draw_rect, #enabled=, #enabled?, #font, #height, #height=, #hit?, #max_height, #max_width, #min_height, #min_width, new, original_new, #outer_height, #outer_width, #recalc, schema, #update, #width, #width=, #with, #x, #x=, #y, #y=

Methods included from Event

#events, included, #publish, #subscribe

Constructor Details

#initialize(options = {}) ⇒ Separator

Returns a new instance of Separator.

Options Hash (options):

  • :shortcut_text (String) — default: ''
  • :shortcut (Symbol) — default: nil

    Adds a shortcut key for this element, that activates it. :auto takes the first letter of the text.

  • :icon (Fidgit::Thumbnail, Gosu::Image, nil) — default: nil
  • :justify (:left, :right, :center) — default: :left

    Text justification.



48
49
50
51
52
53
54
55
56
# File 'lib/fidgit/elements/menu_pane.rb', line 48

def initialize(options = {})
  options = {
    height: default(:line_height),
    background_color: default(:background_color),
    padding: 0,
  }.merge! options

  super '', options
end