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

How to remove floating window title bars #136

Open
SingleKey opened this issue Nov 28, 2023 · 19 comments
Open

How to remove floating window title bars #136

SingleKey opened this issue Nov 28, 2023 · 19 comments

Comments

@SingleKey
Copy link

I need to drag the panel out of the original window and use a window style without a title bar for the panel, but I don't know how to set it up. Please give me a suggestion. Thank you.

@andrewauclair
Copy link
Owner

I'm not sure I follow. The titlebar is always displayed. That's how things are displayed unless you use top tabs.

@tlf30
Copy link

tlf30 commented Nov 28, 2023

Perhaps they want the jframe title bar to function as the dockable's title bar when it is popped out.

Edit: the close button would have to close only the focused tab unless only one tab is remaining, then close the window.

@andrewauclair
Copy link
Owner

That could be interesting. It would have to revert to individual titlebars if there is more than 1 dockable in the window.

@SingleKey
Copy link
Author

I'm not sure I follow. The titlebar is always displayed. That's how things are displayed unless you use top tabs.

I want to drag the panel out of the window, and it will become a floating window~

@SingleKey
Copy link
Author

That could be interesting. It would have to revert to individual titlebars if there is more than 1 dockable in the window.

I want to use jFrame. setUndecorated(true);

@andrewauclair
Copy link
Owner

That should already be allowed by default. The method responsible is here: https://github.com/andrewauclair/ModernDocking/blob/main/docking-api/src/ModernDocking/Dockable.java#L95.

As long as your Dockable returns true for this method then you should be able to drag and drop outside of the frame to float the Dockable.

@SingleKey
Copy link
Author

That could be interesting. It would have to revert to individual titlebars if there is more than 1 dockable in the window.

I think allowing customization would be better~

@andrewauclair
Copy link
Owner

An example of floating can be seen here: https://github.com/andrewauclair/ModernDocking/blob/main/img/floating_panel.gif

@SingleKey
Copy link
Author

An example of floating can be seen here: https://github.com/andrewauclair/ModernDocking/blob/main/img/floating_panel.gif

This example includes the window title bar, which is duplicated with the panel title bar. I don't need the window title bar, but I couldn't find the relevant settings~

@andrewauclair
Copy link
Owner

Let me see if I understand now. You want the new frame to be undecorated?

@SingleKey
Copy link
Author

Let me see if I understand now. You want the new frame to be undecorated?

Yes, because the window title bar is the same as the panel title bar, I would like to use the panel title bar instead of the window title bar, similar to how panels in similar to Visual Studio or IDEA are dragged out of the window.

@SingleKey
Copy link
Author

SingleKey commented Nov 30, 2023

Let me see if I understand now. You want the new frame to be undecorated?

The solution manager panel and code editor panel of Visual Studio have two different effects when being moved out of the window.

test1

test2

I need the first effect.

@SingleKey
Copy link
Author

SingleKey commented Nov 30, 2023

Let me see if I understand now. You want the new frame to be undecorated?

I found the relevant code:
test

I don't know if this is feasible, but if window transparency is set, kidney damage may occur...

@andrewauclair
Copy link
Owner

I'll look into adding a setting. This will be more involved than simply calling setUndecorated(true); The resulting frame cannot be resized without additional changes.

@NebelNidas
Copy link

Not sure if this is what's being requested here, but it would be nice if windows with only one dockable would use the window titlebar instead of the custom panel header. E.g. putting the Inheritance here into the title bar:
image

The three-dot menu would have to be hidden, but in this state it contains no useful elements anyway

@andrewauclair
Copy link
Owner

Doing that would mean losing the ability to drag the dockable again as that titlebar is the drag source.

@SingleKey
Copy link
Author

Doing that would mean losing the ability to drag the dockable again as that titlebar is the drag source.

Perhaps modifying the window style is not very reasonable. Since the window cannot be modified, can you customize the title bar? I have found the following examples:

https://stackoverflow.com/questions/12822037/how-to-create-customize-title-bar-with-close-button-on-jframe
https://copyprogramming.com/howto/how-to-change-the-color-of-the-title-bar-in-javax-swing
https://www.codespeedy.com/how-to-change-the-color-of-title-bar-in-jframe-in-java/

@SingleKey
Copy link
Author

Doing that would mean losing the ability to drag the dockable again as that titlebar is the drag source.

Because this feature is different from typical dockable windows, I think it's possible to add a button for docking.

@SingleKey
Copy link
Author

Not sure if this is what's being requested here, but it would be nice if windows with only one dockable would use the window titlebar instead of the custom panel header. E.g. putting the Inheritance here into the title bar: image

The three-dot menu would have to be hidden, but in this state it contains no useful elements anyway

I think in this situation, the title of the panel can be set to the window, including those three points.

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

4 participants