| Summary: | [Theming] Make focus appearance themeable | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Ralf Sternberg <rsternberg> | ||||||||||||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||||
| Severity: | enhancement | ||||||||||||||||
| Priority: | P3 | CC: | tbuschto | ||||||||||||||
| Version: | 1.3 | ||||||||||||||||
| Target Milestone: | 1.3 M3 | ||||||||||||||||
| Hardware: | All | ||||||||||||||||
| OS: | All | ||||||||||||||||
| Whiteboard: | |||||||||||||||||
| Bug Depends on: | |||||||||||||||||
| Bug Blocks: | 239793 | ||||||||||||||||
| Attachments: |
|
||||||||||||||||
|
Description
Ralf Sternberg
Created attachment 148406 [details]
Hides focus-frame by default
This patch demonstrates how to disable the default focus-frame for all widgets. This works by manipulating the hideFocus-property in Widget.js, but the property can still be re-enabled by the appearance.
Another possibility would by to set the property from outside the widget. This would not have to change Widget.js, however the property can then not be re-enabled by the appearance, only by calling setHideFocus.
A general solution for this could be as follows: - The browser-native focus-frame is disabled for all Widgets. (See patch above) - A singleton-widget is implemented, which (like the tooltip) floates above all other widgets and can display a themeable frame. - This widget is notified from a central point when the focus changes. - It checks the focused widget for a function, e.g. "getFocusFrameBounds" - If the function exists, it will be called, otherwise the frame-widget will be hidden. - The function shall return either valid coordinates which will be used to position the frame-widget. Ot it does not return valid values (e.g. -1,-1), then the frame-widget will also be hidden. Created attachment 148880 [details]
Custom frame for buttons
- Buttons have custom focus-frame
- All other widgets have no focus-frame
- Needs to rebuild qx.js
- Includes a test
- Frame is not (yet) themeable
- Focusing widgets that are not yet created will have no effect
- Unlike the previous implementation (and SWT/winxp), there is no difference in the visualization of the focus depending on the method used to focus (keyboard or mouse).
Created attachment 148882 [details]
Custom Frame 2
Some optimizations for rounded corners. See previous patch for notes.
Created attachment 150614 [details]
Themeable Focus Indicator
This patch contains several changes:
- The default focus-frame is disabled by default. qx.js must be rebuild for this.
- A themeable (border, background-color, layout) FocusIndicator is introduced.
- Currently only used for Button.
- Other than the old focus-frame, this indicator is displayed everytime a widget is focused, not only when using tab.
- Opacity and rounded borders are not yet supported.
- Tests are included.
- Some changes have also been made to TestRunner.js that are helpfull finding dom-level (like the focus-frame) problems, but are not needed for the tests to succeed.
- RAPThemeSupport is updated.
- Since the there is no more focus-frame for Slider and Scale, the "focused" state is introduced in CSS to enable some sort of focus-visualization. It is not used by default.
Created attachment 150716 [details]
Themeable Focus Indicator v2
Some refactoring based on RĂ¼digers specifications. All notes still valid.
Created attachment 150717 [details]
Themeable Focus Indicator v3
(Commited old version.)
Applied patch to CVS HEAD |