Amethyst icon indicating copy to clipboard operation
Amethyst copied to clipboard

add Two Pane Right layout

Open TypicalFence opened this issue 2 years ago • 9 comments

Is your feature request related to a problem? Please describe. I really like the two pane layout, but I'd like to have the main window to be on the right and cycle thru the other windows on the left. What I am looking for is basically similar to the Tall Right layout.

Describe the solution you'd like Basically the addition of said layout. I have seen some work been done on the ability to add custom layouts, but this request is rather basic as its just flipped. I might implement it if I ever figure out how to build this software myself.

Describe alternatives you've considered To wait for the before mentioned custom layout feature.

TypicalFence avatar Mar 08 '22 14:03 TypicalFence

This would also work well for a multi-monitor setup where you may want to keep the main window closer to the center.

diocletiann avatar Apr 17 '22 15:04 diocletiann

This would also work well for a multi-monitor setup where you may want to keep the main window closer to the center.

Or a multi monitor setup where you want to keep the main window to the end. Depending on how you have your multiple monitors setup. My main monitor is on the right, so a main pane on the left of my right monitor puts it in the center, which I don't prefer.

BlairCurrey avatar Sep 06 '22 20:09 BlairCurrey

+1 for this, here's my current workaround with custom layout. But it doesn't work with native shrink/expand commands and mouse resizing though.

function layout() {
    return {
        name: "Two Pane Right",
        initialState: {
            mainPaneCount: 1,
            mainPaneRatio: 0.5
        },
        commands: {
            command1: {
                description: "Shrink main pane",
                updateState: (state) => {
                    return { ...state, mainPaneRatio: Math.max(0.1, state.mainPaneRatio - 0.05) };
                }
            },
            command2: {
                description: "Expand main pane",
                updateState: (state) => {
                    return { ...state, mainPaneRatio: Math.min(0.9, state.mainPaneRatio + 0.05) };
                }
            }
        },
        getFrameAssignments: (windows, screenFrame, state) => {
            const mainPaneCount = Math.min(state.mainPaneCount, windows.length);
            const secondaryPaneCount = windows.length - mainPaneCount;
            const hasSecondaryPane = secondaryPaneCount > 0;

            const mainPaneWindowHeight = screenFrame.height / mainPaneCount;
            const secondaryPaneWindowHeight = screenFrame.height;

            const mainPaneWindowWidth = hasSecondaryPane? Math.round(screenFrame.width * state.mainPaneRatio) : screenFrame.width;
            const secondaryPaneWindowWidth = screenFrame.width - mainPaneWindowWidth

            return windows.reduce((frames, window, index) => {
                const isMain = index < mainPaneCount;
                let frame;
                if (isMain) {
                    frame = {
                        x: screenFrame.x + secondaryPaneWindowWidth,
                        y: screenFrame.y,
                        width: mainPaneWindowWidth,
                        height: mainPaneWindowHeight
                    };
                } else {
                    frame = {
                        x: screenFrame.x,
                        y: screenFrame.y,
                        width: secondaryPaneWindowWidth,
                        height: secondaryPaneWindowHeight
                    }
                }
                return { ...frames, [window.id]: frame };
            }, {});
        }
    };
}

mattbui avatar Nov 22 '22 15:11 mattbui

@mattbui

native shrink/expand commands

Is there a way to add that via custom layouts or not?

TypicalFence avatar Dec 07 '22 13:12 TypicalFence

@TypicalFence not that I know of, currently I set separate shortcuts for custom command 1 and custom command 2

mattbui avatar Dec 07 '22 14:12 mattbui

I would also love to have the Two Pane Right layout.

Will this ever be achieved?

Fau818 avatar Mar 16 '23 14:03 Fau818

+1, I would also love to have a "Two Pane Right" layout :)

sw-tracker avatar Apr 03 '23 09:04 sw-tracker

I would also love to have the 'Two Pane Right' layout.

maxim-uvarov avatar Jul 26 '23 08:07 maxim-uvarov

@mattbui Thank you for the custom layout. Do you happen to have any updates for it? The version from your comment (https://github.com/ianyh/Amethyst/issues/1216#issuecomment-1323830680) won't work with Amethyst 0.19.0.

maxim-uvarov avatar Jul 26 '23 08:07 maxim-uvarov