christmo / macwidgets

Automatically exported from code.google.com/p/macwidgets
0 stars 0 forks source link

Unified titlebar/toolbar does not look unified in Mac OS X 10.6 running with Java 6 32 bit mode #119

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run Java 6 32 bit mode (this is available in Mac OS X 10.6)
2. Add a UnifiedToolBar to the JFrame. I have the following code:

public class Main {

    public static void main(String[] args){
        JFrame frame = new JFrame();

        UnifiedToolBar toolBar =  new UnifiedToolBar();
        JButton button = new JButton("My Button");
        button.putClientProperty("JButton.buttonType", "textured");
        toolBar.addComponentToLeft(button);

        BottomBar bottomBar = new BottomBar(BottomBarSize.LARGE);

bottomBar.addComponentToCenter(MacWidgetFactory.createEmphasizedLa
bel("My Label"));

        frame.getContentPane().add(toolBar.getComponent(), 
BorderLayout.NORTH);
        frame.getContentPane().add(bottomBar.getComponent(), 
BorderLayout.SOUTH);

        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(500,400);
        frame.setVisible(true);
    }
}

What is the expected output? What do you see instead?
The toolbar/titlebar looks like one component. It currently looks like two: 
the title and toolbar are not unified.

What version of the product are you using? On what operating system?
mac-wdigets0.9.5 and Mac OS X 10.6 Java 6 32 bit mode.

Please provide any additional information below.

Are you planning to fix this anytime soon? This widgets are really cool and i 
would love to use them in the commercial App i develop for.

thanks,

Original issue reported on code.google.com by meli.amo...@gmail.com on 13 Aug 2009 at 1:51

GoogleCodeExporter commented 8 years ago

Original comment by kenneth....@gmail.com on 16 Aug 2009 at 7:24

GoogleCodeExporter commented 8 years ago
Hi Meli,

Can you let me know if you still see this issue against the latest build? 
You'll find the latest Mac Widgets for 
Java build here:

http://www.macwidgetsforjava.com/downloads/latest/mac_widgets.jar

Thanks,
-Ken

Original comment by kenneth....@gmail.com on 21 Aug 2009 at 10:59

GoogleCodeExporter commented 8 years ago
Hi Ken, 

thanks for the update. I tried the new jar with the following code attached as 
Main.java 
and it still does not look unified (see picture attached).

Thanks, 
Melissa

Original comment by meli.amo...@gmail.com on 21 Aug 2009 at 2:10

Attachments:

GoogleCodeExporter commented 8 years ago
Hi Melissa,

It looks like your missing this call:

MacUtils.makeWindowLeopardStyle(frame.getRootPane());

Let me know if that fixes it.

-Ken

Original comment by kenneth....@gmail.com on 21 Aug 2009 at 2:33

GoogleCodeExporter commented 8 years ago
It looks better but still not unified. Here is a screenshot so you can compare.

thanks,

Original comment by meli.amo...@gmail.com on 27 Aug 2009 at 12:43

Attachments:

GoogleCodeExporter commented 8 years ago
I am facing the same problem with the unified toolbar. It can be avoided by 
setting
System.setProperty("apple.awt.brushMetalLook", "true");
and not using the UnifiedToolbar afterwards. 
One can still use the unifiedToolBarButtons though.

Example:
JPanel toolBar = new JPanel(new FlowLayout(FlowLayout.LEFT));
toolBar.add(MacButtonFactory
                    .makeUnifiedToolBarButton(myButton));

Unfortunately, the property apple.awt.brushMetalLook seems to be not working 
correctly in 10.5 and the 
latest Java 1.6 version. 

Original comment by dra...@gmail.com on 31 Aug 2009 at 11:22

GoogleCodeExporter commented 8 years ago
I turned on custom background painting, but it sounds like I can let OS X do 
the Unified Toolbar painting. I'll 
look at this as soon as I install Snow Leopard.

Original comment by kenneth....@gmail.com on 31 Aug 2009 at 1:54

GoogleCodeExporter commented 8 years ago
Issue 124 has been merged into this issue.

Original comment by kenneth....@gmail.com on 31 Aug 2009 at 5:24

GoogleCodeExporter commented 8 years ago
I found out it's also possible to just use 
MacUtils.makeWindowLeopardStyle(this.getRootPane()) instead of the Apple 
System Property awt.brushMetalLook. The following code creates a toolbar which 
fits nicely into the Snow Leopard l&f:

MacUtils.makeWindowLeopardStyle(this.getRootPane());
JPanel toolBar = new JPanel(new FlowLayout(FlowLayout.LEFT));
toolBar.add(MacButtonFactory.makeUnifiedToolBarButton(myButton));   
this.add(toolBar, BorderLayout.NORTH);

Original comment by dra...@gmail.com on 31 Aug 2009 at 9:29

GoogleCodeExporter commented 8 years ago
The fix for this is available here:

http://www.macwidgetsforjava.com/downloads/latest/mac_widgets.jar

Please let me know if there are any issues.

Original comment by kenneth....@gmail.com on 5 Sep 2009 at 6:49

GoogleCodeExporter commented 8 years ago
It works, I've tested it on 10.6 and 10.5. 
Thanks for the fast bugfix, keep up the good work!

Original comment by dra...@gmail.com on 7 Sep 2009 at 7:17

GoogleCodeExporter commented 8 years ago
Great, thanks for the feedback.

Original comment by kenneth....@gmail.com on 7 Sep 2009 at 11:39