mgarin / weblaf

WebLaF is a fully open-source Look & Feel and component library written in pure Java for cross-platform desktop Swing applications.
http://weblookandfeel.com
GNU General Public License v3.0
1.14k stars 235 forks source link

WebCollapsiblePane expand doesn't work #527

Closed husker-dev closed 5 years ago

husker-dev commented 5 years ago

Hello, After updating from 1.28 to 1.2.9 I got issue: WebCollapsiblePane doesn't hide but it looks like it needs to be updated or something else because head loses line under title.

image

Here is example:

add(new WebCollapsiblePane("group example", new WebPanel() {{
    setLayout(new VerticalFlowLayout());
    setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));

    add(new WebToolBar() {{
        setFloatable(false);
        setPreferredHeight(40);

        add(new WebButton(getIcon("add")));
        add(new WebButton(getIcon("edit")));

        addToEnd(WebSeparator.createVertical());
        addToEnd(new WebButton(getIcon("delete")));
    }});
}}) {{
        setExpanded(need_expand);
}});
mgarin commented 5 years ago

Thanks for reporting this! There is indeed an issue when collapsible pane is changed to collapsed state like shown in the example. I'll fix it tomorrow and push a v1.2.10 snapshot build with it.

A simplified example that reproduces the issue:

import com.alee.extended.collapsible.WebCollapsiblePane;
import com.alee.extended.window.TestFrame;
import com.alee.laf.WebLookAndFeel;

import javax.swing.*;

public class CollapsibleTest
{
    public static void main ( final String[] args )
    {
        SwingUtilities.invokeLater ( new Runnable ()
        {
            @Override
            public void run ()
            {
                WebLookAndFeel.install ();

                TestFrame.show (
                        50, false, 50,
                        createCollapsible ( true ),
                        createCollapsible ( false ),
                        createCollapsible ( true )
                );
            }

            protected WebCollapsiblePane createCollapsible ( final boolean exp )
            {
                final WebCollapsiblePane sample = new WebCollapsiblePane ( "group example", new JLabel ( "Sample" ) );
                sample.setExpanded ( exp );
                return sample;
            }
        } );
    }
}
mgarin commented 5 years ago

I've fixed this issue, new snapshot artifacts will soon be available.

Final v1.2.10 update release is planned for the end of this week and it's coming along well so most probably it will be out on Friday or Saturday.