Class SliceLayouts
- Namespace
- Whim.SliceLayout
- Assembly
- Whim.SliceLayout.dll
Methods to create common slice layouts.
public static class SliceLayouts
- Inheritance
-
SliceLayouts
- Inherited Members
Methods
CreateColumnLayout(IContext, ISliceLayoutPlugin, LayoutEngineIdentity)
Creates a column layout, where windows are stacked vertically.
public static ILayoutEngine CreateColumnLayout(IContext context, ISliceLayoutPlugin plugin, LayoutEngineIdentity identity)
Parameters
context
IContextplugin
ISliceLayoutPluginidentity
LayoutEngineIdentity
Returns
Examples
Usage:context.Store.Dispatch(
new SetCreateLayoutEnginesTransform(
() => new CreateLeafLayoutEngine[]
{
(id) => SliceLayouts.CreateColumnLayout(context, sliceLayoutPlugin, id)
}
)
);
Layout:
---------------------------------------------------------
| |
| |
| |
| |
| | |
| | |
| Overflow | |
| | |
| ↓ |
| |
| |
| |
| |
| |
| |
---------------------------------------------------------
CreateMultiColumnLayout(IContext, ISliceLayoutPlugin, LayoutEngineIdentity, params uint[])
Creates a multi-column layout with the given number of windows in each column.
For example, new
For example, new
uint[] { 2, 1, 0 }
will create a layout with 3 columns, where the
first column has 2 rows, the second column has 1 row, and the third column has infinite rows.public static ILayoutEngine CreateMultiColumnLayout(IContext context, ISliceLayoutPlugin plugin, LayoutEngineIdentity identity, params uint[] capacities)
Parameters
context
IContext- The IContext to use
plugin
ISliceLayoutPlugin- The ISliceLayoutPlugin to use
identity
LayoutEngineIdentity- The identity of the layout engine
capacities
uint[]- The number of rows in each column
Returns
Examples
Usage:context.Store.Dispatch(
new SetCreateLayoutEnginesTransform(
() => new CreateLeafLayoutEngine[]
{
(id) => SliceLayouts.CreateMultiColumnLayout(context, sliceLayoutPlugin, id)
}
)
);
Layout:
-------------------------------------------------------------------------------------------------
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | | |
| | | | | |
| Slice 1 | | Slice 2 | Overflow | |
| 2 windows | | 1 window | | |
| ↓ | | ↓ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
-------------------------------------------------------------------------------------------------
CreatePrimaryStackLayout(IContext, ISliceLayoutPlugin, LayoutEngineIdentity)
Creates a primary stack layout, where the first window takes up half the screen, and the
remaining windows are stacked vertically on the other half.
public static ILayoutEngine CreatePrimaryStackLayout(IContext context, ISliceLayoutPlugin plugin, LayoutEngineIdentity identity)
Parameters
context
IContextplugin
ISliceLayoutPluginidentity
LayoutEngineIdentity
Returns
Examples
Usage:context.Store.Dispatch(
new SetCreateLayoutEnginesTransform(
() => new CreateLeafLayoutEngine[]
{
(id) => SliceLayouts.CreatePrimaryStackLayout(context, sliceLayoutPlugin, id)
}
)
);
Layout:
----------------------------------------------------------------
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
| | | |
| Primary | Overflow | |
| 1 window | | |
| | ↓ |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
----------------------------------------------------------------
CreateRowLayout(IContext, ISliceLayoutPlugin, LayoutEngineIdentity)
Creates a row layout, where windows are stacked horizontally.
public static ILayoutEngine CreateRowLayout(IContext context, ISliceLayoutPlugin plugin, LayoutEngineIdentity identity)
Parameters
context
IContextplugin
ISliceLayoutPluginidentity
LayoutEngineIdentity
Returns
Examples
Usage:context.Store.Dispatch(
new SetCreateLayoutEnginesTransform(
() => new CreateLeafLayoutEngine[]
{
(id) => SliceLayouts.CreateRowLayout(context, sliceLayoutPlugin, id)
}
)
);
Layout:
---------------------------------------------------------
| |
| |
| |
| |
| |
| |
| Overflow |
| -------→ |
| |
| |
| |
| |
| |
| |
| |
---------------------------------------------------------
CreateSecondaryPrimaryLayout(IContext, ISliceLayoutPlugin, LayoutEngineIdentity, uint, uint)
Creates a three-column layout, where the primary column is in the middle, the secondary
column is on the left, and the overflow column is on the right.
The middle column takes up 50% of the screen, and the left and right columns take up 25%.
public static ILayoutEngine CreateSecondaryPrimaryLayout(IContext context, ISliceLayoutPlugin plugin, LayoutEngineIdentity identity, uint primaryColumnCapacity = 1, uint secondaryColumnCapacity = 2)
Parameters
context
IContextplugin
ISliceLayoutPluginidentity
LayoutEngineIdentityprimaryColumnCapacity
uint- The number of rows in the primary column. This must be a non-negative integer.
secondaryColumnCapacity
uint- The number of rows in the secondary column. This must be a non-negative integer.
Returns
Examples
Usage:context.Store.Dispatch(
new SetCreateLayoutEnginesTransform(
() => new CreateLeafLayoutEngine[]
{
(id) => SliceLayouts.CreateSecondaryPrimaryLayout(context, sliceLayoutPlugin, id)
}
)
);
Layout:
------------------------------------------------------------------------
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | | |
| | | | | |
| Slice 2 | | Slice 1 | Overflow | |
| 2 windows | | 1 window | | |
| ↓ | | ↓ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
------------------------------------------------------------------------