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

Lua API for manipulating the window layout #5978

Open
3 tasks done
Mm2PL opened this issue Feb 23, 2025 · 0 comments
Open
3 tasks done

Lua API for manipulating the window layout #5978

Mm2PL opened this issue Feb 23, 2025 · 0 comments
Labels
enhancement Feature: EXPERIMENTAL Plugins Stuff related to EXPERIMENTAL Lua plugin support

Comments

@Mm2PL
Copy link
Collaborator

Mm2PL commented Feb 23, 2025

Checklist

  • I've verified that I'm running the most recent nightly build or stable release
  • I've looked for my problem on the wiki
  • I've searched the issues and pull requests for similar looking reports

Describe your issue

This API should be able to give plugins the ability to:

  • open new tabs
  • rename tabs
  • move tabs around
  • close tabs
  • add/remove splits
  • ideally also move splits between containers
  • ideally also change the width and height constraints on splits
  • get currently selected split, tab
  • ideally also get the last selected window

The easy option seems to be presenting a tree of objects like:

Window
+-- Tab1
|   +-- SplitContainer1 (horizontal)
|       +-- SplitContainer1 (vertical)
|       |   +-- Split1
|       |   +-- SplitContainer2 (horizontal)
|       |       +-- Split2
|       |       +-- Split3
|       +-- SplitContainer3
|           ...
+-- Tab2
    ...

Which would correspond to something like:

Image

I am still not convinced that this is the best way to achieve our goals because this will leak the internal structure of a window to plugins. Should we want to change that or clean it up somehow this API will be in the way.

Screenshots

No response

OS and Chatterino Version

Chatterino 2.5.2 DEBUG (commit 9afd605 modified) built with Qt 6.8.2 Running on Arch Linux, kernel: 6.13.2-arch1-1

@Mm2PL Mm2PL added enhancement Feature: EXPERIMENTAL Plugins Stuff related to EXPERIMENTAL Lua plugin support labels Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature: EXPERIMENTAL Plugins Stuff related to EXPERIMENTAL Lua plugin support
Projects
None yet
Development

No branches or pull requests

1 participant