Sha256: cda099bed0dc25f1e67a38f56b33e55f95105efae529bb39cc782394fdf4c272

Contents?: true

Size: 908 Bytes

Versions: 4

Compression:

Stored size: 908 Bytes

Contents

# frozen_string_literal: true
class Shoes
  module Swt
    class Background
      extend Forwardable
      include Common::Fill
      include Common::Stroke
      include Common::Remove
      include Common::Visibility
      include Common::Translate
      include BackendDimensionsDelegations

      def_delegators :dsl, :angle

      attr_reader :dsl, :app, :transform, :painter

      def initialize(dsl, app)
        @dsl = dsl
        @app = app

        # fill is potentially a pattern that needs disposing, so hold onto it
        @fill = dsl.fill

        @painter = Painter.new(self)
        @app.add_paint_listener @painter
      end

      def corners
        dsl.curve
      end

      def dispose
        @fill.gui.dispose if @fill && @fill.respond_to?(:gui)
      end

      class Painter < RectPainter
        def draw_setup(_gc)
          # don't draw
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
shoes-swt-4.0.0.pre12 lib/shoes/swt/background.rb
shoes-swt-4.0.0.pre11 lib/shoes/swt/background.rb
shoes-swt-4.0.0.pre10 lib/shoes/swt/background.rb
shoes-swt-4.0.0.pre9 lib/shoes/swt/background.rb