diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/design.md | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/docs/design.md b/docs/design.md index 4152bb93..87fc5847 100644 --- a/docs/design.md +++ b/docs/design.md | |||
@@ -296,3 +296,46 @@ Various parts of the system are context sensitive. I.e. the currently selected a | |||
296 | In future iterations that context can be expanded i.e. with projects that affect prioritization of various data items. | 296 | In future iterations that context can be expanded i.e. with projects that affect prioritization of various data items. |
297 | 297 | ||
298 | The application context is globally available, although it may be altered locally. | 298 | The application context is globally available, although it may be altered locally. |
299 | |||
300 | ## Focus handling | ||
301 | This section lines out how we deal with focus throughout the application. | ||
302 | The aim is to have consistent behaviour across controls and other elements. | ||
303 | |||
304 | The focus handling needs to take into account: | ||
305 | |||
306 | * Mouse navigation | ||
307 | * Keyboard navigation | ||
308 | * Touch input | ||
309 | |||
310 | The primary indicator for focus is the "activeFocus" property (or if available, "visualFocus"). The "focus" property is used for requesting focus and thus not what should be used for detecting focus. | ||
311 | |||
312 | There are the following different focus states: | ||
313 | * An element can be selected (if selectable). This includes i.e. a text editor that has focus, or a selectable element in a list view. | ||
314 | * An element can be hovered. This is only available with mouse pointers and indicates that the element can be clicked. | ||
315 | * An element can have keyboard focus. This is only available with keyboard navigation and indicates which element currently has keyboard focus. | ||
316 | |||
317 | With touch input only the selected state is relevant. | ||
318 | |||
319 | The following indicators are available to visualize selection: | ||
320 | * Highlight: A blue overlay over the item. | ||
321 | * Glow: A blue glow around the borders. | ||
322 | * Underlined text | ||
323 | |||
324 | It is important that a selected element can still show focus, otherwise the focus during keyboard navigation simply disappears if it moves to the selected element. | ||
325 | |||
326 | The following controls need to deal with focus: | ||
327 | * Buttons, IconButtons | ||
328 | * ListView, TreeView, GridView | ||
329 | * TextFields | ||
330 | * Copyable elements | ||
331 | |||
332 | We're indicating focus as follows: | ||
333 | * Active focus is indicated with a glow. This is used for both hovering and keyboard focus. | ||
334 | * A selected element is highlighted. | ||
335 | * Keyboard focus is additionally to the glow indicated with underlined text. | ||
336 | |||
337 | ### FocusScope | ||
338 | In order to be able to deal with focus on a local scope (which is important for reusable components), a FocusScope is required to establish a border for focus handling. Internally you can set the focus as required within the focus scope, and externally you can just give focus to the FocusScope, ignoring what's going to happen internally. The FocusScope will automatically forward focus (when it receives it), to whatever element requested focus internally. | ||
339 | |||
340 | ### Tab focus chain | ||
341 | Set "activeFocusOnTab: true" on all elements that should be included in the tab focus chain. | ||