Class: RSpecTelemetry::Trace::Viewer::PaneResizer
- Inherits:
-
Object
- Object
- RSpecTelemetry::Trace::Viewer::PaneResizer
- Defined in:
- lib/rspec_telemetry/trace/viewer/pane_resizer.rb
Overview
Owns mouse drag state and reports plain clicks back as focus targets.
Constant Summary collapse
- DEFAULT_SOURCE_ROWS =
10
Instance Attribute Summary collapse
-
#source_rows ⇒ Object
readonly
Returns the value of attribute source_rows.
-
#split_ratio ⇒ Object
readonly
Returns the value of attribute split_ratio.
Instance Method Summary collapse
- #handle(event, region) ⇒ Object
-
#initialize(split_ratio: 0.5, source_rows: DEFAULT_SOURCE_ROWS) ⇒ PaneResizer
constructor
A new instance of PaneResizer.
Constructor Details
#initialize(split_ratio: 0.5, source_rows: DEFAULT_SOURCE_ROWS) ⇒ PaneResizer
Returns a new instance of PaneResizer.
14 15 16 17 18 |
# File 'lib/rspec_telemetry/trace/viewer/pane_resizer.rb', line 14 def initialize(split_ratio: 0.5, source_rows: DEFAULT_SOURCE_ROWS) @split_ratio = split_ratio @source_rows = source_rows @dragging = false end |
Instance Attribute Details
#source_rows ⇒ Object (readonly)
Returns the value of attribute source_rows.
12 13 14 |
# File 'lib/rspec_telemetry/trace/viewer/pane_resizer.rb', line 12 def source_rows @source_rows end |
#split_ratio ⇒ Object (readonly)
Returns the value of attribute split_ratio.
12 13 14 |
# File 'lib/rspec_telemetry/trace/viewer/pane_resizer.rb', line 12 def split_ratio @split_ratio end |
Instance Method Details
#handle(event, region) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rspec_telemetry/trace/viewer/pane_resizer.rb', line 20 def handle(event, region) case event.action when :press return press(event, region) when :drag drag(event, region) when :release @dragging = false end nil end |