Sha256: fb550a3e57b7b5e453c1bb007c5d91e08776af3ffe38587378956ed76d4023e4

Contents?: true

Size: 692 Bytes

Versions: 16

Compression:

Stored size: 692 Bytes

Contents

# frozen_string_literal: true

module Vedeu

  module Borders

    # When a {Vedeu::Borders::Border} has a caption, truncate it if
    # the caption is longer than the interface is wide, and pad with a
    # space either side.
    #
    # The caption is displayed within the bottom border of the
    # interface/view.
    #
    # @api private
    #
    class Caption < Vedeu::Borders::Title

      private

      # @return [Fixnum]
      # @see Vedeu::Borders::Title#start_index
      def start_index
        (width - size) - 1
      end

      # @return [Fixnum]
      # @see Vedeu::Borders::Title#y
      def y
        geometry.yn
      end

    end # Caption

  end # Borders

end # Vedeu

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
vedeu-0.8.32 lib/vedeu/borders/caption.rb
vedeu-0.8.31 lib/vedeu/borders/caption.rb
vedeu-0.8.30 lib/vedeu/borders/caption.rb
vedeu-0.8.29 lib/vedeu/borders/caption.rb
vedeu-0.8.28 lib/vedeu/borders/caption.rb
vedeu-0.8.27 lib/vedeu/borders/caption.rb
vedeu-0.8.26 lib/vedeu/borders/caption.rb
vedeu-0.8.25 lib/vedeu/borders/caption.rb
vedeu-0.8.24 lib/vedeu/borders/caption.rb
vedeu-0.8.23 lib/vedeu/borders/caption.rb
vedeu-0.8.22 lib/vedeu/borders/caption.rb
vedeu-0.8.21 lib/vedeu/borders/caption.rb
vedeu-0.8.20 lib/vedeu/borders/caption.rb
vedeu-0.8.19 lib/vedeu/borders/caption.rb
vedeu-0.8.18 lib/vedeu/borders/caption.rb
vedeu-0.8.17 lib/vedeu/borders/caption.rb