Skip to content

WineFix: keep the sub-tool panel's columns across a studio switch - #66

Open
jfacemyer wants to merge 1 commit into
noahc3:devfrom
jfacemyer:winefix-sub-tool-columns
Open

jfacemyer wants to merge 1 commit into
noahc3:devfrom
jfacemyer:winefix-sub-tool-columns

Conversation

@jfacemyer

Copy link
Copy Markdown

After a studio switch, the sub-tool panel (the shape tools, for example) comes back as a single column running the height of the window, and goes back to two columns only on the next tool change. This fixes it.

The sub-tool panel is a ToolTray, like the main tool pane. SubToolPanel.ToggleVisibility sets its column count on every tool change: two for more than ten sub-tools, otherwise one. But a studio switch raises CurrentWorkspaceChanged, and every ToolTray handles that by setting Columns to the main tool pane's ToolPaneColumns. With a one-column tool pane, the shape tools end up in one column.

A postfix on ToolTray.WorkspaceService_CurrentWorkspaceChanged applies the sub-tool panel's own rule again when the tray is the tool host's SubToolRoot. The main tool pane is left alone. Everything is reached by reflection, so the patch skips itself if those members change.

It is a new setting, "Sub-tool panel: Keep its columns across studio switches", on by default, and it's in the configuration docs. It's one commit on dev, independent of #61, #62, #64 and #65.

Tested with Affinity 3.3 on Wine 11.19: three Pixel/Layout round trips kept two columns each time; before, one Pixel → Layout switch gave one column.

The sub-tool panel is a ToolTray like the main tool pane. Its column
count comes from SubToolPanel.ToggleVisibility on every tool change (two
for more than ten sub-tools), but a studio switch raises
CurrentWorkspaceChanged, and every ToolTray handles that by setting
Columns to the main tool pane's ToolPaneColumns. With a one-column tool
pane, the shape tools came back as a single column running the height of
the window until the next tool change.

After that handler, the sub-tool panel's tray gets its own rule back; the
main tool pane is left alone. Checked with three Pixel/Layout round trips:
two columns each time, one before.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant