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

Tooltips have a weird incorrect shadow #224

Closed
Bios-Marcel opened this issue Dec 14, 2020 · 2 comments
Closed

Tooltips have a weird incorrect shadow #224

Bios-Marcel opened this issue Dec 14, 2020 · 2 comments
Milestone

Comments

@Bios-Marcel
Copy link
Contributor

Bios-Marcel commented Dec 14, 2020

Happens on Java 11 with flatlaf 0.45:

grafik

I am assuming the thing on the right is a shadow.

I've added the tooltips via the Action.SHORT_DESCRIPTION of an action.
Weirdly this only happens if the tooltip is rendered inside the window. Try both the top left and the bottom right corner of the button:

Demo:

package com.isp.examples.table;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.WindowConstants;

import com.formdev.flatlaf.FlatLightLaf;

public class Bug
{
  public static void main( final String[] args )
  {
    FlatLightLaf.install();
    final JFrame frame = new JFrame();
    final JButton jButton = new JButton();
    jButton.setAction( new AbstractAction()
    {
      {
        putValue( Action.NAME, "Test" );
        putValue( Action.SHORT_DESCRIPTION, "LOOOOOOOOOOOOOONG TEXT" );
      }

      @Override
      public void actionPerformed( final ActionEvent e )
      {
      }
    } );
    frame.add( jButton );
    frame.setSize( 400, 400 );
    frame.setLocationRelativeTo( null );
    frame.setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE );
    frame.setVisible( true );
  }
}
DevCharly added a commit that referenced this issue Dec 15, 2020
@DevCharly
Copy link
Collaborator

Good catch. The drop shadow looks good, but the tooltip is too small. Fixed in master branch.

Weirdly this only happens if the tooltip is rendered inside the window

That's because light weight popups are used if tooltip fit into window.
If partly outside of window, heavy weight popups are used.

@DevCharly DevCharly added this to the 0.46 milestone Dec 15, 2020
@Bios-Marcel
Copy link
Contributor Author

Thanks

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