imawizard / MiguruWM

A tiling window manager for Windows
BSD 2-Clause "Simplified" License
36 stars 3 forks source link

[outdated] feat: add new layouts: threeColumns and spiral #14

Closed Fuann-Kinoko closed 1 year ago

Fuann-Kinoko commented 1 year ago

add two new layouts

layout 1: ThreeColumns If there are only two windows, the master pane takes up most of the space.

If there are more than two windows, the master pane moves to the middle, while the other windows are tiled on the left and right sides.

Specifically, the last salveCount // 2 windows will move to the right side and tile in Tall, and the previous slave windows will move to the left side and tile in Tall.

layout2: Spiral tile windows in a spiral (clockwise) direcion.

sorry for my poor coding style, but i think these two layouts should work fine

imawizard commented 1 year ago

Hey Fuann-Kinoko, thanks for your contribution! I haven't got around testing it but will do so in the next few days.

imawizard commented 1 year ago

I've tested your code and it works fine, however, I'm not sure about the window order. In three-columns I would have expected that – when on master – focusing the next window puts you on the window to the left I'd regard as second window, not last. Likewise in spiral if you have 4 windows that the last window is the one in the lower right corner, not the one to its left.

It's probably a matter of personal preference, but when checking back with Amethyst on macOS the window order was like I was expecting it to be. Are you actually using your three-columns or spiral layout and is it intuitive for you?

Fuann-Kinoko commented 1 year ago

The logic of threeColumns is intuitive to me, but yes, it's just a matter of preference and the best way to do it is probably to provide an option to toggle this and let the user make the final decision.

As for the spiral layout, I was referring to the layout in Xmonad, so it is split clockwise. I'm guessing the layout Amethyst has is BSP? I can add it with some minor tweaks.

btw, if I want add an new option for layouts, should I place them here

https://github.com/imawizard/MiguruWM/blob/ff09d5274dca28dd3b93de3d5b2aea3423db1ecd/lib/miguru/miguru.ahk#L169-L196

or make more specific layouts like threeColumnsLeft and threeColumnsRight?

Since these options are completely layout specific, I'm not sure if I should put them in the general options.

imawizard commented 1 year ago

Visual xmonad Layouts Guide

Ah, I see. I didn't know XMonad.Layout.Spiral.

btw, if I want add an new option for layouts, should I place them here [...] or make more specific layouts like threeColumnsLeft and threeColumnsRight?

That's a good question. The current layout-functions should probably get refactored into classes, so that such options can be passed to their constructors, something like

a := ThreeColumnsLayout({ master: "left", singledOutSlave: "last" })
b := ThreeColumnsLayout({ master: "middle", singledOutSlave: "first" })
mwm.Set("layout", { value: a })