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

TitlePane does not respond to full-width events #569

Closed
insengrim opened this issue Jul 19, 2022 · 4 comments
Closed

TitlePane does not respond to full-width events #569

insengrim opened this issue Jul 19, 2022 · 4 comments
Milestone

Comments

@insengrim
Copy link

insengrim commented Jul 19, 2022

This is our title pane with embedded menu bar. Menu bar contains JLabel with additional informations and button with user name (show popup). Application title is on left side (Glue in JMenuBar), support from FlatLaf 2.4.
image
Left side with titleLabel react on every events (maximize, minimize and window move). But righ side doesn't. From jmenubar (without menu) right side (additional information) all events are consumed (maximize, minimize and window move).

image
Are we doing something wrong? Or is it a bug?
We used window decorations. System.setProperty("flatlaf.useWindowDecorations", Boolean.TRUE.toString());
JMenuBar code (adding components):

		description = new JLabel();
		user = new FlatTitlePaneButton();
		add(Box.createGlue() `);'
		add(description);
               add(user);

Setting JMenu bar:

        JMenuBar mb= new FlatLafMenuBar();  
        WindowManager.getDefault().getMainWindow().setJMenuBar(mb);
@DevCharly
Copy link
Collaborator

This is normal behavior. Only the title label (the glue) allows moving the window (WM_NCHITTEST returns HTCAPTION). The components left and right to the glue are assumed to be components that need mouse events (e.g. menus or buttons; WM_NCHITTEST returns HTCLIENT).

ATM there is no way to change this.

Maybe I can extend this a little bit and check children of JMenuBar for a special client property (e.g. FlatLaf.isTitleBarCaption)...

@insengrim
Copy link
Author

That's a very good idea and we would use the feature right away.

DevCharly added a commit that referenced this issue Aug 20, 2022
@DevCharly
Copy link
Collaborator

This is now implemented in latest snapshot: https://github.com/JFormDesigner/FlatLaf#snapshots

Set following client property:

description.putClientProperty( FlatClientProperties.COMPONENT_TITLE_BAR_CAPTION, true );

@DevCharly DevCharly added this to the 2.5 milestone Aug 22, 2022
@insengrim
Copy link
Author

We tried this property in snapshot and it's great. Thank You.

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

2 participants