summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-07-21 22:42:11 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-07-21 22:42:11 +0200
commit0c0dffd4a62a35fea489954fb14b7d53869a6103 (patch)
treedcddf7140859e7ca94b1cc7dd02137d40af72b8e /docs
parent2e0fbe4ba93fda2f90d4ddef56c35ab6ab9c3f0e (diff)
downloadkube-0c0dffd4a62a35fea489954fb14b7d53869a6103.tar.gz
kube-0c0dffd4a62a35fea489954fb14b7d53869a6103.zip
Focus handling documentation
Diffstat (limited to 'docs')
-rw-r--r--docs/design.md43
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
296In future iterations that context can be expanded i.e. with projects that affect prioritization of various data items. 296In future iterations that context can be expanded i.e. with projects that affect prioritization of various data items.
297 297
298The application context is globally available, although it may be altered locally. 298The application context is globally available, although it may be altered locally.
299
300## Focus handling
301This section lines out how we deal with focus throughout the application.
302The aim is to have consistent behaviour across controls and other elements.
303
304The focus handling needs to take into account:
305
306* Mouse navigation
307* Keyboard navigation
308* Touch input
309
310The 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
312There 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
317With touch input only the selected state is relevant.
318
319The 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
324It 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
326The following controls need to deal with focus:
327* Buttons, IconButtons
328* ListView, TreeView, GridView
329* TextFields
330* Copyable elements
331
332We'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
338In 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
341Set "activeFocusOnTab: true" on all elements that should be included in the tab focus chain.