-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
focus.txt
65 lines (51 loc) · 1.56 KB
/
focus.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--devel-focus
Window->focus
need Window->operation()
on Dialog.run(), main loop could compile array of event "receivers"
recursive descent of Window tree
start at focus, breadth-first search
focus on Pager: focus list is
- Pager
- Index
- Sidebar
- CmdWin
- NeoMutt
PBar, IBar, HelpBar, containers are passive
CmdWin handles ":"!
Sidebar manages its own commands, uses dlg functions to change state
Index controls whether Pager is visible - Next Email, etc
Pager handles 'q', hides self, restores focus to Index
NeoMutt handles 'V' version and other globals
CmdWin: <what-key>
NeoMutt catches ":" unless overridden by the Dialog
e.g. a backgrounded compose
--------------------------------------------------------------------------------
define functions to move focus between windows
<focus-left>
<focus-right>
<focus-up>
<focus-down>
the primary window will still need to run the event loop
index: op = km_dokey(MENU_MAIN);
pager: ch = km_dokey(MENU_PAGER);
need functions to navigate between sibling windows
index <--> sidebar
sidebar
Generic -> Sidebar
<next-entry> -> <sidebar-next>
<previous-entry> -> <sidebar-prev>
<select-entry> -> <sidebar-open>
how is the focus shown to the user?
background colour?
dimming other windows?
terminal cursor
extra colour for hightlight/selection?
on loss of focus:
selection becomes highlight-coloured
highlight loses colour
on gaining focus
selection regains selection colour
highlight regains highlight colour
Events handled by Window.event()
requires wdata
separation of calc/paint useful too