]> git.decadent.org.uk Git - ion3.git/blob - etc/cfg_layouts.lua
Update cfg_kludge_flash for Flash 10
[ion3.git] / etc / cfg_layouts.lua
1 --
2 -- Layouts for Ion
3 --
4
5 --
6 -- Helper routines and structures
7 --
8
9 -- Tiled frame template for the layouts below
10 local a_frame = {
11     type="WSplitRegion",
12     regparams = {
13         type = "WFrame", 
14         frame_style = "frame-tiled"
15     }
16 }
17
18 -- Helper function for generating splits for layouts
19 local function mksplit(dir, tl, br, float)
20     return {
21         type = (float and "WSplitFloat" or "WSplitSplit"),
22         dir = dir,
23         tls = 1,
24         brs = 1,
25         tl = tl,
26         br = br,
27     }
28 end
29
30 local function mktiling(split_tree)
31     return {
32         managed = {
33             {
34                 type = "WTiling",
35                 bottom = true, -- Make it the bottom of the group
36                 split_tree = split_tree,
37             }
38         }
39     }
40 end
41
42 --
43 -- The layouts
44 --
45
46 -- Tiling with single 1:1 horizontal split
47 local tmp=mktiling(mksplit("horizontal", a_frame, a_frame))
48 ioncore.deflayout("hsplit", tmp)
49 ioncore.deflayout("default", tmp)
50
51 -- Tiling with single 1:1 vertical split
52 ioncore.deflayout("vsplit",
53     mktiling(mksplit("vertical", a_frame, a_frame))
54 )
55
56 -- Tiling with single 1:1 floating horizontal split
57 ioncore.deflayout("hfloat", 
58     mktiling(mksplit("horizontal", a_frame, a_frame, true))
59 )
60
61 -- Tiling with single 1:1 floating vertical split
62 ioncore.deflayout("vfloat", 
63     mktiling(mksplit("vertical", a_frame, a_frame, true))
64 )
65
66 -- Tiling with horizontal and then vertical splits
67 ioncore.deflayout("2x2",
68     mktiling(mksplit("horizontal", 
69                      mksplit("vertical", a_frame, a_frame),
70                      mksplit("vertical", a_frame, a_frame))
71     )
72 )
73
74 -- Tiling with single full screen frame
75 ioncore.deflayout("full", mktiling(a_frame))