Module layout

Module layout 

Source
Expand description

Helix-style layout calculations for microscope

Layout is bottom-anchored with horizontal split:

  • Results panel (40% width) on the left
  • Preview panel (60% width) on the right
  • Picker takes 40% of screen height, anchored to bottom
+---------------------------------------------------------------+
|                      Editor Content                            |
+------------------ y = screen_height - picker_height -----------+
| Results (40%)                    | Preview (60%)               |
| +-----------------------------+  | +---------------------------+|
| | > query_                [I] |  | | Preview: filename         ||
| | --------------------------- |  | | -------------------------  ||
| | > selected_item.rs          |  | | 1  fn main() {            ||
| |   another_file.rs           |  | | 2      ...                 ||
| |   third_file.rs             |  | | 3  }                       ||
| +-----------------------------+  | +---------------------------+||
+----------------------------------+------------------------------+
| 4/128 files                          <CR> Open | <Esc> Close   |
+---------------------------------------------------------------+

Structs§

LayoutBounds
Calculated layout bounds for microscope panels
LayoutConfig
Layout configuration for microscope
PanelBounds
Bounds for a single panel

Functions§

calculate_layout
Calculate layout bounds for microscope
visible_item_count
Number of visible items based on panel height