Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support resizing the main pane in custom layouts #1694

Open
adambossy opened this issue Nov 9, 2024 · 0 comments
Open

Support resizing the main pane in custom layouts #1694

adambossy opened this issue Nov 9, 2024 · 0 comments

Comments

@adambossy
Copy link

Is your feature request related to a problem? Please describe.
I've created a custom layout that's similar to the 3-Column Middle layout that ships with Amethyst, except that it lays out secondary windows as columns instead of rows on either side of the main, central pane. I would like to support resizing the main pane in the same way I can the 3-Column Middle layout.

It seems that the way this is done in ThreeColumnLayout.swift is by reading mainPaneRatio from the decoder that's passed to the constructor, but this does not seem to be supported in the custom layout API.

Describe the solution you'd like
I would like to be able to implement the equivalent of this Swift code in a JavaScript layout extension in order to support main pane resizing:

    required init(from decoder: Decoder) throws {
        let values = try decoder.container(keyedBy: CodingKeys.self)
        self.mainPaneCount = try values.decode(Int.self, forKey: .mainPaneCount)
        self.mainPaneRatio = try values.decode(CGFloat.self, forKey: .mainPaneRatio)
        super.init()
    }

Describe alternatives you've considered
I've looked into whether updateState or any other methods could support my desired behavior but it's not clear that they'd work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant