Class: QTimetrap::Views::MainWindowLayoutBuilder
- Inherits:
-
Object
- Object
- QTimetrap::Views::MainWindowLayoutBuilder
- Includes:
- MainWindowSplitterToggleHelpers
- Defined in:
- app/views/main_window_layout_builder.rb
Overview
Builds main window layout and returns initialized component instances.
Constant Summary collapse
- SIDEBAR_WIDTH =
220- SIDEBAR_MIN_WIDTH =
180- SIDEBAR_MAX_WIDTH =
520
Constants included from MainWindowSplitterToggleHelpers
QTimetrap::Views::MainWindowSplitterToggleHelpers::SIDEBAR_TOGGLE_H, QTimetrap::Views::MainWindowSplitterToggleHelpers::SIDEBAR_TOGGLE_W, QTimetrap::Views::MainWindowSplitterToggleHelpers::SIDEBAR_TOGGLE_ZONE_H, QTimetrap::Views::MainWindowSplitterToggleHelpers::SIDEBAR_TOGGLE_ZONE_W
Constants included from MainWindowSplitterToggleHoverHelpers
QTimetrap::Views::MainWindowSplitterToggleHoverHelpers::SIDEBAR_TOGGLE_HIDE_DELAY_MS
Constants included from MainWindowSplitterToggleLayoutHelpers
QTimetrap::Views::MainWindowSplitterToggleLayoutHelpers::SIDEBAR_TOGGLE_H, QTimetrap::Views::MainWindowSplitterToggleLayoutHelpers::SIDEBAR_TOGGLE_W
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(window:, callbacks:) ⇒ MainWindowLayoutBuilder
constructor
A new instance of MainWindowLayoutBuilder.
Constructor Details
#initialize(window:, callbacks:) ⇒ MainWindowLayoutBuilder
Returns a new instance of MainWindowLayoutBuilder.
13 14 15 16 |
# File 'app/views/main_window_layout_builder.rb', line 13 def initialize(window:, callbacks:) @window = window @callbacks = callbacks end |
Instance Method Details
#build ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'app/views/main_window_layout_builder.rb', line 18 def build root = QHBoxLayout.new(window) root.set_contents_margins(0, 0, 0, 0) root.spacing = 0 splitter, , controls, entries = build_splitter_and_content root.(splitter) { sidebar: , controls: controls, entries: entries } end |