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

Fix double title bars with grouped floating frames #4264

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented Aug 27, 2023

Identify the Bug or Feature request

Fixes #2455

Description of the Change

This is a workaround for some strange JIDE behaviour for floating frames that are docked together. The containing dialog was being decorated (via this.setUndecorated(false)), and its root pane was being decorated as a dialog (via this.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG)), resulting in two separate title bars.

The new behaviour is found in the SingleTitleBarDialogFloatingContainer class which overrides the updateUndecorated() method responsible for setting the decorations on these dialogs. It always sets the dialog itself as undecorated and will set the root pane as decorated when decorations are needed.

I could just as well have done the opposite (decorate the dialog itself, not the root pane), but I preferred these aesthetics and also liked that the docked frames would be a distinguished from "normal" dialogs. For reference, this is what it would have looked like (compare with images further below):
image

Possible Drawbacks

There is some inconsistency with decorations on different systems, so it's possible this particular solution could run afoul of some system's expectations.

Documentation Notes

Prior to MT 1.14.0, docking floating frames together would result in multiple title bars:
image

Now that no longer happens, so docking just has the one title bar:
image

Release Notes

  • Fixed a bug where docking floating frames together would create a dialog with multiple title bars.

This change is Reviewable

A new `DialogFloatingContainer` implementation (`SingleTitleBarDialogFloatingContainer`) is provided which always leaves
itself undecorated, but which will decorate the root pane with dialog decorations when needed. The border is also always
set to a resize border rather than sometimes having it and sometimes not. A new `DockingManager`
implementation (`MapToolDockingManager`) is needed just to instantiate `SingleTitleBarDialogFloatingContainer`.
@kwvanderlinde kwvanderlinde force-pushed the bugfix/2455-decorated-jide-floating-containers branch from 339d417 to 5fd2038 Compare August 27, 2023 06:14
@cwisniew cwisniew added this pull request to the merge queue Aug 30, 2023
Merged via the queue into RPTools:develop with commit bcde2a6 Aug 30, 2023
4 checks passed
@cwisniew cwisniew added the bug label Aug 30, 2023
@kwvanderlinde kwvanderlinde deleted the bugfix/2455-decorated-jide-floating-containers branch August 31, 2023 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

Weird frame appearance - undocked, grouped panels.
2 participants