Sha256: 7df77554c250da5142e0d1aee0330ab8574e2a6a5752db9558df015d1513dc85

Contents?: true

Size: 1.02 KB

Versions: 11

Compression:

Stored size: 1.02 KB

Contents

module Marty
  module Extras
    module Layout

      def hbox(*args)
        params = args.pop
        params.merge(layout: { type: :hbox, align: :stretch },
                     items: args,
                     )
      end

      def vbox(*args)
        params = args.pop
        params.merge(layout: { type: :vbox, align: :stretch },
                     items: args,
                     )
      end

      def fieldset(title, *args)
        params = args.pop
        params.merge(items: args,
                     xtype: 'fieldset',
                     defaults: { anchor: '100%' },
                     title: title,
                     )
      end

      def dispfield(params={})
        {
          attr_type: :displayfield,
          hide_label: !params[:field_label],
          read_only: true,
        }.merge(params)
      end

      def vspacer(params={})
        vbox({flex: 1, border: false}.merge(params))
      end

      def hspacer(params={})
        hbox({flex: 1, border: false}.merge(params))
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
marty-0.5.23 app/components/marty/extras/layout.rb
marty-0.5.21 app/components/marty/extras/layout.rb
marty-0.5.20 app/components/marty/extras/layout.rb
marty-0.5.19 app/components/marty/extras/layout.rb
marty-0.5.18 app/components/marty/extras/layout.rb
marty-0.5.17 app/components/marty/extras/layout.rb
marty-0.5.16 app/components/marty/extras/layout.rb
marty-0.5.15 app/components/marty/extras/layout.rb
marty-0.5.14 app/components/marty/extras/layout.rb
marty-0.5.13 app/components/marty/extras/layout.rb
marty-0.5.12 app/components/marty/extras/layout.rb