The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

DESCRIPTION

The idea behind this module lays in arranging the windows in a proper order. There is a kind of "default" layout for any tag. Each time user starts using a tag (i.e. creates first window on it), the layout for this tag is being copied from the default one to a "working" one. Then user can either close all windows on a tag resulting in this working layout disposal, or change the layout sizes in several ways.

Working layout depends on the number of tiled windows in it: layout for a single window differs with layout for many of them.

Based on number of windows, we need to get a "layout object", which could be either altered in edge sizes, or handle a list of windows, configuring them one by one to match the selected scheme.

Layout relies on grid division of the screen. Firstly it divides the screen into number of rows, then into columns. "default" layout for 5 windows looks like:

    {
        'cols' => [
            '0.5',
            '0.5'
        ],
        'ncols' => 2,
        'nrows' => 3,
        'rows' => [
            '0.333333333333333',
            '0.333333333333333',
            '0.333333333333333'
        ]
    };

Then it's being translated into a grid, first element of each array is column's weight. Other elements -- rows weights inside this column. For 5 windows the grid will look like:

    [
        [
            '0.5',
            '0.5',
            '0.5'
        ],
        [
            '0.5',
            '0.333333333333333',
            '0.333333333333333',
            '0.333333333333333'
        ]
    ];

User *maybe* will be able to change weights in their local copy of grid and everything will work in the same way.