| Summary: | Need a way to turn on/off the focus ring | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Andre Weinand <andre_weinand> | ||||||||
| Component: | SWT | Assignee: | Silenio Quarti <Silenio_Quarti> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | major | ||||||||||
| Priority: | P2 | CC: | boris, bpasero, bugzilla, channingwalton, cmlenz, grant_gayed, kai-uwe_maetzel, michaelvanmeekeren, Mike_Wilson, paulslau | ||||||||
| Version: | 2.1 | ||||||||||
| Target Milestone: | 3.3 M6 | ||||||||||
| Hardware: | Macintosh | ||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 52030, 56476, 170259 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Andre Weinand
reassign to SN One idea of getting rid of the focus ring without requiring new API would be to display the focus ring only in modal dialogs. Other than the Mac Finder, can you show fnid another example or the doc that describes this. For example, the project builder shows a focus ring (the wrong color) and it's not a dialog. Is the problem that the compare viewer looks ugly? Apple Tools: The Project Builder shows the focus ring in the tree only. Never in any text editors. FileMerge doesn't do it in main windows, but in dialogs. JavaBrowser has a focus ring for the class pane, but not for text. Apple Mail uses a focus rings only in the search field of the main window, but not for the table and text views. Apple's Script Editor uses focus ring only in toolbar Search field and in Open Dictionary dialog but not around text area in main window. Property List Editor uses focus ring for Table's Cell Editor (!) but not for the Table view itself. BTW: Our cell editors don't support this!? Addressbook: no focus border iCal: focus border only for search field in main window iTunes, iPhoto: focus border only for search field in main window, browser uses different selection color for focus/unfocus panes (like Finder) Non-Apple Tools: MetroWerks CodeWarrior doesn't have a focus ring in top-level windows but uses a filled /hollow selection. RealBasic IDE doesn't have focus rings at all. Bottom Line: I've found no application that uses a focus ring the same we do. In most cases focus ring is used: - in dialogs - in toolbar text fields (search) - in overlay cell editors It is never used for the main text editor area. Yes, the focus ring makes compare viewer ugly. However, it makes all text editors noisy because you get another blue line next to our vertical ruler/scrollbar/overview rulers. (Performance consideration (without measuring it :-) : how expensive is the focus ring? Do we invalidate the ring only, or do we invalidate the rectangular area inside the ring too?) We probably won't get to this but we did fix a performance problem associated with it. *** Bug 34627 has been marked as a duplicate of this bug. *** Since the Mac's focus ring seem to make more troubles in the new look,
I think we should find a way to make it optional.
4 options:
- new SWT flag: SWT.FOCUS_RING
problem: applications developed on non-Mac platforms will forget to use this flag
-> there will be no focus ring at all.
- new SWT flag: SWT.NO_FOCUS_RING
problem: applications developed on non-Mac platforms will forget to use this flag
-> double focus ring won't go away.
- automatic 1: hide focus ring for controls in "normal" windows; show it in dialog" windows
problem: too clever...
- automatic 2: Text shows focus ring by default; StyledText (and all other controls) hide
focus ring by default (and we can provide a flag SWT.FOCUS_RING for turning it on);
problem: none obvious :-)
A few tables and trees in dialogs will loose their focus ring.
Not a big deal since Apple itself does not use the focus ring consequently.
Steve, do you think option 3 makes sense and is feasable?
[oops, I meant option 4 (automatic 2)] I have no idea of this is of any help because I don't know much about SWT's inner workings, but here's my expectation of when the focus ring should appear and when it shouldn't: If I can take focus away from the control that currently has keyboard focus using the tab key, then it should display the focus ring. On the other hand, if pressing tab has no effect, or does not move keyboard focus to the next control, no focus ring should be displayed. Based on this definition, neither the text editor area nor the view part content areas should have a focus ring, because I can't "tab out" of them. *** Bug 55452 has been marked as a duplicate of this bug. *** SN this has been identified as an important OS X item, so I've updated its priority. Can you revisit it before M9? Created attachment 9426 [details]
Double Focus ring problem
Nicely shows the double focus ring problem with the new look.
Downgraded ... sorry about that but Eclipse doesn't think this is "stop ship". PMC have indicated that this is stop ship (wow). Upgrading to P1. As a temporary fix, you can define the system property "org.eclipse.swt.internal.carbon.noFocusRing". If this system property is defined when the display is created and the control is not in a dialog, the Tree/Table/List/Composite/Text controls will not have the focus ring. Fixed in HEAD. Andre, Without the focus ring, in-place editing in the Navigator looks bad since there is no border around the text field. I guess there is Mac specific code somewhere that removes the one pixel black border. I've added a check for the system property. See bug #38412 Lowering priority since there is a temporary fix in place. This will be addressed again after R3.0 ships. Can we try to address this issue for 3.1? Right now almost everything works OK with the exception of Compare views in dialogs. In dialogs the focus ring isn't turned off, so we still see the odd behavior shown in the second attached screenshot. Created attachment 15555 [details]
Focus Ring runs through compare viewer selection
I would like to remove the focusring from dialogs too. Why not have a "SWT.NO_FOCUS_RING" style hint? Peoples forgetting about it, will get the same result as now, and those that find it annoying will use it in their applications. Ben Can you provide an update on this defect? Please increase the severity to major and priority to P1 since it is required to resolve a blocking TPTP defect (https://bugs.eclipse.org/bugs/show_bug.cgi?id=126575) and has been on the books for nearly 4 years. I increased the severity, since this reflects your point of view about the important of the problem. It's clearly not P1 from the SDK's point of view. Note to SWT: 126575 can be unblocked by just declaring the existence of that property as part of the SWT API. We have decided to use the SWT.BORDER style to determine if the focus ring should appear. Mac trees and tables tie the focus ring and border together, you can either have both of them or none. Tree/tables/editors in the eclipse views (Package Explorer, etc) do not specify the SWT.BORDER style, so they won't have double borders (comment#12). The tables in the MANIFEST.MF forms (bug#173572) will have borders as expected. The org.eclipse.swt.internal.carbon.noFocusRing property is no longer used in SWT. Created attachment 61191 [details]
No border around preferences tree
I expected to see a focus ring around the tree in the preferences dialog, but did not get one. Am I just confused, or is this a problem?
That is working as expected. If the SWT.BORDER bit is removed, both the border and the focus ring will not show. |