/* Change the size and location of this layout. */
virtual void apply (int x, int y, int width, int height) = 0;
- /* Return the minimum and maximum height of this layout. */
- virtual void get_sizes (int *min_height, int *max_height) = 0;
+ /* Return the minimum and maximum height or width of this layout.
+ HEIGHT is true to fetch height, false to fetch width. */
+ virtual void get_sizes (bool height, int *min_value, int *max_value) = 0;
/* True if the topmost item in this layout is boxed. */
virtual bool top_boxed_p () const = 0;
protected:
- void get_sizes (int *min_height, int *max_height) override;
+ void get_sizes (bool height, int *min_value, int *max_value) override;
private:
{
public:
- tui_layout_split () = default;
+ /* Create a new layout. If VERTICAL is true, then windows in this
+ layout will be arranged vertically. */
+ explicit tui_layout_split (bool vertical = true)
+ : m_vertical (vertical)
+ {
+ }
DISABLE_COPY_AND_ASSIGN (tui_layout_split);
protected:
- void get_sizes (int *min_height, int *max_height) override;
+ void get_sizes (bool height, int *min_value, int *max_value) override;
private:
/* The splits. */
std::vector<split> m_splits;
+ /* True if the windows in this split are arranged vertically. */
+ bool m_vertical;
+
/* True if this layout has already been applied at least once. */
bool m_applied = false;
};