Skip to content

Implement multiple window layouts#1188

Open
Lwmte wants to merge 11 commits intodevelopfrom
lwmte/multiple_layouts
Open

Implement multiple window layouts#1188
Lwmte wants to merge 11 commits intodevelopfrom
lwmte/multiple_layouts

Conversation

@Lwmte
Copy link
Copy Markdown
Collaborator

@Lwmte Lwmte commented Apr 11, 2026

Allows to save multiple window layouts and bind them to hotkeys.

@Lwmte Lwmte added this to the Version 2.0 milestone Apr 11, 2026
@Lwmte Lwmte added the enhancement A task which adds something new or improves on existing features. label Apr 11, 2026
@Lwmte Lwmte requested a review from Copilot April 12, 2026 07:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for multiple saved window layouts in Tomb Editor and binds switching between saved layouts to hotkeys, while also adjusting panel initialization and some UI visibility/statistics update logic.

Changes:

  • Added configuration support for named custom dock layouts and an “active layout” concept.
  • Added Window → Layouts dynamic menu to switch/save/delete layouts and introduced hotkey commands to switch to layouts 1–9.
  • Refactored initialization timing for Panel3D / Panel2DMap and tweaked rendering/panel visibility update behavior.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
TombLib/TombLib.Forms/Controls/RenderingPanel.cs Presents a cleared frame on resize to avoid stale visuals after resize.
TombEditor/ToolWindows/MainView.cs Initializes panels during rendering init; refactors bottom panel visibility logic and stats update flow.
TombEditor/Forms/FormMain.Designer.cs Replaces “Restore default layout” menu item with a “Layouts” submenu hook.
TombEditor/Forms/FormMain.cs Implements Layouts menu population and layout switch/save/delete logic; handles hotkey-driven layout switching events.
TombEditor/Editor.cs Adds SwitchLayoutEvent and SwitchLayout(int) API to raise layout switch requests.
TombEditor/Controls/Panel3D/Panel3DInit.cs Moves runtime initialization logic into a new Initialize() method.
TombEditor/Controls/Panel3D/Panel3DDraw.cs Minor cleanup (whitespace).
TombEditor/Controls/Panel3D/Panel3DCameraMovement.cs Updates key filter field name usage.
TombEditor/Controls/Panel3D/Panel3D.cs Adjusts fields to allow deferred initialization (no longer initialized in ctor).
TombEditor/Controls/Panel2DMap.cs Moves runtime initialization logic into a new Initialize() method and makes dispose unsubscription conditional.
TombEditor/Configuration.cs Adds Window_CustomLayouts, Window_ActiveLayoutName, and NamedLayout type.
TombEditor/Command.cs Adds SwitchLayout1..9 commands that raise layout switch requests.
Installer/Changes.txt Documents the new multi-layout feature in release notes.
Files not reviewed (1)
  • TombEditor/Forms/FormMain.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread TombEditor/ToolWindows/MainView.cs
Comment thread TombEditor/ToolWindows/MainView.cs Outdated
Comment thread TombEditor/Controls/Panel3D/Panel3D.cs Outdated
Comment thread TombLib/TombLib.Forms/Controls/RenderingPanel.cs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 6 comments.

Files not reviewed (1)
  • TombEditor/Forms/FormMain.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread TombLib/TombLib.Forms/Controls/RenderingPanel.cs Outdated
Comment thread TombEditor/Forms/FormMain.cs Outdated
Comment thread TombEditor/Forms/FormMain.cs Outdated
Comment thread TombEditor/Forms/FormMain.cs Outdated
Comment thread TombEditor/Command.cs Outdated
// They will be loaded and saved automatically.
public class Configuration : ConfigurationBase
{
public const int MaxWindowLayouts = 10;
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MaxWindowLayouts is introduced but not enforced when adding new layouts (Window_CustomLayouts can grow without bound), and other code uses separate hard-coded limits (e.g., 9 hotkey entries). Consider enforcing this limit when saving/adding layouts and using the constant consistently across command registration/menu display to prevent unbounded config growth and mismatched UI behavior.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

@Nickelony Nickelony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, just some nitpicks. Please review Copilot comments and check whether any of them are valid.

Comment thread TombEditor/Controls/Panel3D/Panel3D.cs Outdated
Comment thread TombEditor/Controls/Panel2DMap.cs Outdated
Comment thread TombEditor/Forms/FormMain.cs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • TombEditor/Forms/FormMain.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread TombLib/TombLib.Forms/Controls/RenderingPanel.cs
Comment thread TombEditor/ToolWindows/MainView.cs
Comment thread TombEditor/Forms/FormMain.cs
Comment thread TombEditor/Forms/FormMain.cs
@Lwmte
Copy link
Copy Markdown
Collaborator Author

Lwmte commented Apr 17, 2026

There is currently an issue with floating toolboxes snapping to the bottom right corner after switching layout.
Not ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement A task which adds something new or improves on existing features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants