taoujouti / macwidgets

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

Wrong textured Color under Snow Leopard #126

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install the latest develeoper build of MacWidgets (pre-0.9.6) from Sep, 6th
2. Start your application that uses MacWidgets with e.g. Unified Toolbar

What is the expected output? What do you see instead?
The expected output would be a correct textured color of the Unified Toolbar.
Instead, I see slightly differences between the toolbar and the title bar. 
Furthermore, when the 
application's window loses the focus, the Unified Toolbar does not change its 
color (maybe due 
to the deprecated method "createAndInstallRepaintWindowFocusListener"?).

What version of the product are you using? On what operating system?
The dev-build of MacWidgets from Sep, 6th, as announced in the Exploding Pixels 
blog.
My system configuration:
MacBook Air
Mac OS X 10.6 (x86_64)
Java-Version 1.6.0_15 (Apple Inc.)
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home

Neither in Leopard nor in Snow Leopard I calibrated my monitor (the notebook's 
built-in LCD-
Display) 

Please provide any additional information below.
Screenshot sl1.png show the described bug, sl2.png shows the 
lost-focus-behaviour.

Original issue reported on code.google.com by m...@danielluedecke.de on 9 Sep 2009 at 12:42

Attachments:

GoogleCodeExporter commented 9 years ago
"Neither in Leopard nor in Snow Leopard I calibrated my monitor (the notebook's 
built-in LCD-
Display)" - that means, I use the default settings for color and brightness 
display.

Original comment by m...@danielluedecke.de on 9 Sep 2009 at 12:44

GoogleCodeExporter commented 9 years ago
Can you tell me what the value of this is:

System.out.println(MacUtils.shouldManuallyPaintTexturedWindowBackground());

Original comment by kenneth....@gmail.com on 9 Sep 2009 at 10:01

GoogleCodeExporter commented 9 years ago
After initialization of all components (end of constructor), when the frame 
loses or gains focus (window(de-
)activated event), it always says "false"...

Original comment by m...@danielluedecke.de on 10 Sep 2009 at 6:53

GoogleCodeExporter commented 9 years ago
Can you try creating a plain JWindow and then directly install the brushed 
metal client property on it to verify 
that that works:

rootPane.putClientProperty("apple.awt.brushMetalLook", Boolean.TRUE);

Original comment by kenneth....@gmail.com on 10 Sep 2009 at 9:32

GoogleCodeExporter commented 9 years ago
I've update the latest dev build -- not sure if it will fix this, but it should 
ensure that the Unified Toolbar is 
always synced up with the window state:

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

Original comment by kenneth....@gmail.com on 10 Sep 2009 at 10:13

GoogleCodeExporter commented 9 years ago
Hi Ken,

I saw no difference according to the unified toolbar. The bottom bar renders 
well, but the unified toolbar 
behaviour is the same: it does not exactly match the title bar's colour when in 
focus, and when the frame loses 
the focus, the toolbar doesn't change the colour.

I tested both rootPane.putClientProperty("apple.awt.brushMetalLook", 
Boolean.TRUE); and 
System.setProperty("apple.awt.brushMetalLook", "true"); on a JDialog and 
JWindow, but that doesn't seem to 
make any difference...

This is what I use when initiating my application:
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", 
"Zettelkasten");
System.setProperty("apple.awt.brushMetalLook", "true");
MacUtils.makeWindowLeopardStyle(ZettelkastenView.super.getFrame().getRootPane())
;
// 
WindowUtils.createAndInstallRepaintWindowFocusListener(ZettelkastenView.super.ge
tFrame());
WindowUtils.installJComponentRepainterOnWindowFocusChanged(ZettelkastenView.supe
r.getFrame().getRootPan
e());

Though I formerly used createAndInstallRepaint..., which is now deprecated.

This is the way I create the UnifiedToolbar (which worked on Leopard):

UnifiedToolBar mactoolbar = new UnifiedToolBar();
mactoolbar.addComponentToLeft(MacButtonFactory.makeUnifiedToolBarButton(tb_newEn
try));
// ... and more buttons ...
mactoolbar.installWindowDraggerOnWindow(ZettelkastenView.super.getFrame());
mainPanel.add(mactoolbar.getComponent(),BorderLayout.PAGE_START);

Original comment by m...@danielluedecke.de on 11 Sep 2009 at 7:33

GoogleCodeExporter commented 9 years ago
Hi Daniel,

Try taking Mac Widgets for Java out of the picture -- try the following on a 
simple JFrame:

System.setProperty("apple.awt.brushMetalLook", "true");

By the way, theres no need to install the brushMetalLook client property when 
using 
MacUtils.makeWindowLeopardStyle (that's what it's doing for you).

-Ken

Original comment by kenneth....@gmail.com on 11 Sep 2009 at 9:36

GoogleCodeExporter commented 9 years ago
Hi Ken,

sorry, I didn't mention: I was trying both 

rootPane.putClientProperty("apple.awt.brushMetalLook", Boolean.TRUE);
System.setProperty("apple.awt.brushMetalLook", "true");

on a new JDialog and JWindow, which does not use Mac Widget (i.e. I created a 
new, "empty" project)

And I tried both in my application that uses the Mac Widgets... No difference...

Original comment by m...@danielluedecke.de on 11 Sep 2009 at 9:46

GoogleCodeExporter commented 9 years ago
Hi Ken,

two screenshots of my application that uses Mac WIdgets:
One without 
"MacUtils.makeWindowLeopardStyle(ZettelkastenView.super.getFrame().getRootPane()
);" command, 
the other one with that code-line enabled.

Original comment by m...@danielluedecke.de on 11 Sep 2009 at 10:00

Attachments:

GoogleCodeExporter commented 9 years ago
What were the results of taking Mac Widgets for Java out of the picture? Did 
you still observe the issue? If so, this 
sounds like an Apple bug. I'm not sure why this would only happen on your 
MacBook Air though. I can try it on 
my MacBook.

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

GoogleCodeExporter commented 9 years ago
In you screen shot labeled without_macwidget.png, it doesn't appear that you've 
installed the brushedMetal 
client property on the root pane.

Original comment by kenneth....@gmail.com on 11 Sep 2009 at 10:40

GoogleCodeExporter commented 9 years ago
When I replace
MacUtils.makeWindowLeopardStyle(ZettelkastenView.super.getFrame().getRootPane())
;
with
System.setProperty("apple.awt.brushMetalLook", "true");

it looks like on the screenshot "without". When I replace

MacUtils.makeWindowLeopardStyle(ZettelkastenView.super.getFrame().getRootPane())
;
with
ZettelkastenView.super.getFrame().getRootPane().putClientProperty("apple.awt.bru
shMetalLook", 
Boolean.TRUE);

it looks like the screenshot "with", thus no visible difference to the 
makeWindowsLeopardStyle-method.

What do you mean by "taking Mac Widgets for Java out of the picture"?

Original comment by m...@danielluedecke.de on 11 Sep 2009 at 11:05

GoogleCodeExporter commented 9 years ago
By taking Mac Widgets for Java out of the picture, I mean create a simple test 
app that doesn't use any of Mac 
Widgets for Java, including the Unified Toolbar. Something like the following 
would work:

        JFrame frame = new JFrame();
        frame.getRootPane().putClientProperty("apple.awt.brushMetalLook", Boolean.TRUE);
        frame.setSize(500, 350);
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        frame.setVisible(true);

I want to see if this properly renders -- if it does, then that means I'm doing 
something wrong.

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

GoogleCodeExporter commented 9 years ago
Ah, ok. See attached screenshot...

Original comment by m...@danielluedecke.de on 11 Sep 2009 at 4:01

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks. I'll compare this to running the same code snippet on my machine.

Original comment by kenneth....@gmail.com on 11 Sep 2009 at 4:42

GoogleCodeExporter commented 9 years ago
Ok, please delete this issue respectively set it to "solved"... I use many 
split panes, and since the brushed background 
color was too dark in my opinion, I changed their background colors manually to 
a lighter grey. In Leopard, I also had 
to change the background color of my main panel. This, however, did not work on 
Snow Leopard and caused the 
troubles I had...

        mainPanel.setBackground(CConstants.cnormalgray);
        jPanelMainRight.setBackground(CConstants.cnormalgray);
        jSplitPaneMain1.setBackground(CConstants.cnormalgray);
        jSplitPaneMain2.setBackground(CConstants.cnormalgray);
        jSplitPaneMain3.setBackground(CConstants.cnormalgray);
        jSplitPaneMain4.setBackground(CConstants.cnormalgray);
        jSplitPaneLinks.setBackground(CConstants.cnormalgray);
        jSplitPaneAuthors.setBackground(CConstants.cnormalgray);

When I remove the first line:
        mainPanel.setBackground(CConstants.cnormalgray);

my app renders well on Snow Leopard 10.6!

Original comment by m...@danielluedecke.de on 11 Sep 2009 at 7:56

GoogleCodeExporter commented 9 years ago

Original comment by kenneth....@gmail.com on 12 Sep 2009 at 10:43