class Fidgit::FileDialog

A simple dialog that manages a message with a set of buttons beneath it.

Public Class Methods

new(type, options = {}, &block) click to toggle source
Calls superclass method Fidgit::DialogState::new
# File lib/fidgit/states/file_dialog.rb, line 4
def initialize(type, options = {}, &block)
  options = {
    show: true,
    background_color: DEFAULT_BACKGROUND_COLOR,
    border_color: DEFAULT_BORDER_COLOR,
  }.merge! options

  super(options)

  vertical align: :center, padding: 0 do |packer|
    FileBrowser.new(type, { parent: packer }.merge!(options)) do |sender, result, file_name|
      hide
      block.call result, file_name if block
    end
  end

  show if options[:show]
end