Sha256: 769e00bba2e38fcacaf66adf69591ee941db5f87298c6ea9394cef6ba85195a4
Contents?: true
Size: 672 Bytes
Versions: 4
Compression:
Stored size: 672 Bytes
Contents
# frozen_string_literal: true class Shoes module Swt class TextBlock # Presently centering always takes the whole line, so this class easily # allows us to keep those alternate overrides separate from the main # flowing text definitions for a segment. class CenteredTextSegment < TextSegment def initialize(dsl, width) super(dsl, dsl.text, width) # Centered text always takes all the width it's given layout.width = width end # Overrides to not allow for flowing on final line--whole width only def last_line_width layout.width end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems