Getting layout combinators the right way around

Hi, I've been trying to produce a layout that works something like TwoPane/DragPane (I don't really understand the difference between these two), but with tabs for the slave windows. I.e. if there's only one window, it takes up the full screen; if there are two windows, the master window is always in the left pane, the slave on the right; if there are more than two windows, the master is on the left, one slave is displayed on the right, and there are tabs (as in e.g. simpleTabbed) showing the slave windows. I've achieved something very close to what I want using: reflectHoriz $ combineTwo (TwoPane 0.03 0.5) simpleTabbed Full I needed the reflectHoriz because with combineTwo (TwoPane 0.03 0.5) Full simpleTabbed hidden slave windows ended up in the left pane, rather than appearing as tabs in the right pane. But the (minor) annoyance with using reflectHoriz is that the focusDown/focusUp and Shrink/Expand key bindings go the opposite way to every other workspace (I use PerWorkspace layouts, so simply switching the bindings won't work). Somehow I feel I'm missing something, and it should be possible to achieve this without the reflectHoriz. Is there a better way? Thanks, Toby -- Dr T. S. Cubitt Quantum Information Theory group Department of Mathematics University of Bristol United Kingdom email: tsc25@cantab.net web: www.dr-qubit.org

I've been trying to produce a layout that works something like TwoPane/DragPane (I don't really understand the difference between these two),
IIRC on DragPane you can use the mouse to move/resize the layout division.
but with tabs for the slave windows. I.e. if there's only one window, it takes up the full screen; if there are two windows, the master window is always in the left pane, the slave on the right; if there are more than two windows, the master is on the left, one slave is displayed on the right, and there are tabs (as in e.g. simpleTabbed) showing the slave windows.
You've probably missed X.L.Master at contrib, which does just that. layout = mastered 0.03 0.5 simpleTabbed
I've achieved something very close to what I want using:
reflectHoriz $ combineTwo (TwoPane 0.03 0.5) simpleTabbed Full
I needed the reflectHoriz because with
combineTwo (TwoPane 0.03 0.5) Full simpleTabbed
hidden slave windows ended up in the left pane, rather than appearing as tabs in the right pane. But the (minor) annoyance with using reflectHoriz is that the focusDown/focusUp and Shrink/Expand key bindings go the opposite way to every other workspace (I use PerWorkspace layouts, so simply switching the bindings won't work).
when using combineTwo that's what you get, the new windows go to the first layout by default. you could set a manageHook that tests if it's in the right workspace and move the window to the second layout. It's not very difficult, but since X.L.Master does exactly what you understood you want... Thanks,
you're welcome :) Henrique Abreu

On Mon, May 03, 2010 at 05:41:51PM -0300, Henrique G. Abreu wrote:
I've been trying to produce a layout that works something like TwoPane/DragPane (I don't really understand the difference between these two),
IIRC on DragPane you can use the mouse to move/resize the layout division.
Ah, I so rarely use the the mouse in xmonad that I'd missed that :) Maybe it would be worth adding this to the Haddock description of DragPane, since at present its description is essentially identical to that of TwoPane.
but with tabs for the slave windows. I.e. if there's only one window, it takes up the full screen; if there are two windows, the master window is always in the left pane, the slave on the right; if there are more than two windows, the master is on the left, one slave is displayed on the right, and there are tabs (as in e.g. simpleTabbed) showing the slave windows.
You've probably missed X.L.Master at contrib, which does just that. layout = mastered 0.03 0.5 simpleTabbed
You're quite right, and it does indeed do exactly what I want!
I've achieved something very close to what I want using:
reflectHoriz $ combineTwo (TwoPane 0.03 0.5) simpleTabbed Full
I needed the reflectHoriz because with
combineTwo (TwoPane 0.03 0.5) Full simpleTabbed
hidden slave windows ended up in the left pane, rather than appearing as tabs in the right pane. But the (minor) annoyance with using reflectHoriz is that the focusDown/focusUp and Shrink/Expand key bindings go the opposite way to every other workspace (I use PerWorkspace layouts, so simply switching the bindings won't work).
when using combineTwo that's what you get, the new windows go to the first layout by default. you could set a manageHook that tests if it's in the right workspace and move the window to the second layout. It's not very difficult,
...if you do your homework and learn some proper Haskell, which I haven't had time / have been too lazy to so far...
but since X.L.Master does exactly what you understood you want...
The X.L.Master solution is perfect. Once again, I'm astounded by the speed at which posts to this list get a helpful and friendly answer in return! Thanks very much, Toby -- Dr T. S. Cubitt Quantum Information Theory group Department of Mathematics University of Bristol United Kingdom email: tsc25@cantab.net web: www.dr-qubit.org
participants (2)
-
Henrique G. Abreu
-
Toby Cubitt