# HG changeset patch
# User Jan Vrany <jan.vrany@fit.cvut.cz>
# Date 1521413527 0
# Sun Mar 18 22:52:07 2018 +0000
# Node ID ba0bfcd8ab1822c1dab933414765822e869baf9c
# Parent 031924a79f90e2289fe3e75823ad7bc8466d8e5a
Issue #176: fix "disappearing" completon view when pointer moves out of it
...by making it a popup view (which it is, of sorts) and opening it modally.
While this changes the behavior a little, should behave better on windows
with "focus-follows-mouse".
diff -r 031924a79f90 -r ba0bfcd8ab18 SmallSense__CompletionController.st
a
|
b
|
|
498 | 498 | movePos y: (movePos y - windowExtent y - editView font maxHeight - 5). |
499 | 499 | ]. |
500 | 500 | topView origin:movePos. |
| 501 | topView |
| 502 | bePopUpView; |
| 503 | beSlave. |
501 | 504 | "/ topView resizeToFit. |
502 | 505 | self updateSelection ifFalse:[ |
503 | | topView open. |
| 506 | topView openModal. |
504 | 507 | ]. |
505 | 508 | ] ifFalse:[ |
506 | 509 | completionView list:list. |
… |
… |
|
514 | 517 | |
515 | 518 | "Created: / 27-09-2013 / 14:01:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
516 | 519 | "Modified: / 15-05-2014 / 11:30:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 520 | "Modified (format): / 15-03-2018 / 10:47:27 / jv" |
517 | 521 | ! |
518 | 522 | |
519 | 523 | updateCompletions: completionResult sequence: sequence |
diff -r 031924a79f90 -r ba0bfcd8ab18 SmallSense__CompletionView.st
a
|
b
|
|
20 | 20 | |
21 | 21 | "{ NameSpace: SmallSense }" |
22 | 22 | |
23 | | SimpleView subclass:#CompletionView |
| 23 | TopView subclass:#CompletionView |
24 | 24 | instanceVariableNames:'completionController completionContext list listHolder listView |
25 | 25 | selectionHolder helpHolder helpView' |
26 | 26 | classVariableNames:'' |
… |
… |
|
125 | 125 | !CompletionView methodsFor:'event handling'! |
126 | 126 | |
127 | 127 | keyPress:key x:x y:y |
| 128 | key == #Escape ifTrue:[ |
| 129 | completionController closeCompletionView. |
| 130 | ^ self |
| 131 | ]. |
128 | 132 | x isNil ifTrue:[ |
129 | 133 | "/ Already re-delegated |
130 | 134 | ^ self |
131 | 135 | ]. |
132 | | key == #Escape ifTrue:[ |
133 | | completionController closeCompletionView. |
134 | | ^ self |
135 | | ]. |
136 | 136 | (key == #CursorDown |
137 | 137 | or:[ key == #CursorUp |
138 | 138 | or:[ key == #CursorLeft |
… |
… |
|
145 | 145 | ^ completionController editView keyPress:key x:x y:y |
146 | 146 | |
147 | 147 | "Created: / 27-09-2013 / 14:05:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
148 | | "Modified: / 31-03-2014 / 22:53:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
149 | 148 | "Modified: / 18-01-2018 / 23:10:58 / jv" |
| 149 | "Modified: / 21-03-2018 / 10:10:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
150 | 150 | ! ! |
151 | 151 | |
152 | 152 | !CompletionView methodsFor:'initialization & release'! |