Sha256: a5d8d4c4ef93262a43d2d9459820d702bfd94c1a75d0fb59ace4f6ee9dc977b0

Contents?: true

Size: 1.29 KB

Versions: 1

Compression:

Stored size: 1.29 KB

Contents

# frozen_string_literal: true

class Shoes
  module DSL
    module Element
      def border(color, styles = {})
        create Shoes::Border, pattern(color), styles
      end

      def background(color, styles = {})
        create Shoes::Background, pattern(color), style_normalizer.normalize(styles)
      end

      def edit_line(*args, &blk)
        style = pop_style(args)
        text  = args.first || ''
        create Shoes::EditLine, text, style, blk
      end

      def edit_box(*args, &blk)
        style = pop_style(args)
        text  = args.first || ''
        create Shoes::EditBox, text, style, blk
      end

      def progress(opts = {}, &blk)
        create Shoes::Progress, opts, blk
      end

      def check(opts = {}, &blk)
        create Shoes::Check, opts, blk
      end

      def radio(*args, &blk)
        style = pop_style(args)
        group = args.first
        create Shoes::Radio, group, style, blk
      end

      def list_box(opts = {}, &blk)
        create Shoes::ListBox, opts, blk
      end

      def flow(opts = {}, &blk)
        create Shoes::Flow, opts, blk
      end

      def stack(opts = {}, &blk)
        create Shoes::Stack, opts, blk
      end

      def button(text = nil, opts = {}, &blk)
        create Shoes::Button, text, opts, blk
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoes-core-4.0.0.rc1 lib/shoes/dsl/element.rb