Faculty of Information Technology
Software Engineering Group

Ticket #176: smallsense_fix_1_of_1_rev_ba0bfcd8ab18_Issue__176__fix__disappearing__completon_view_when_pointer_moves_out_of_it.patch

File smallsense_fix_1_of_1_rev_ba0bfcd8ab18_Issue__176__fix__disappearing__completon_view_when_pointer_moves_out_of_it.patch, 2.7 KB (added by Jan Vrany, 20 months ago)
  • SmallSense__CompletionController.st

    # 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  
    498498            movePos y: (movePos y - windowExtent y - editView font maxHeight - 5).
    499499        ].
    500500        topView origin:movePos.
     501        topView
     502            bePopUpView;
     503            beSlave.
    501504"/        topView resizeToFit.
    502505        self updateSelection ifFalse:[
    503             topView open.
     506            topView openModal.
    504507        ].
    505508    ] ifFalse:[
    506509        completionView list:list.
     
    514517
    515518    "Created: / 27-09-2013 / 14:01:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    516519    "Modified: / 15-05-2014 / 11:30:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     520    "Modified (format): / 15-03-2018 / 10:47:27 / jv"
    517521!
    518522
    519523updateCompletions: completionResult sequence: sequence
  • SmallSense__CompletionView.st

    diff -r 031924a79f90 -r ba0bfcd8ab18 SmallSense__CompletionView.st
    a b  
    2020
    2121"{ NameSpace: SmallSense }"
    2222
    23 SimpleView subclass:#CompletionView
     23TopView subclass:#CompletionView
    2424        instanceVariableNames:'completionController completionContext list listHolder listView
    2525                selectionHolder helpHolder helpView'
    2626        classVariableNames:''
     
    125125!CompletionView methodsFor:'event handling'!
    126126
    127127keyPress:key x:x y:y
     128    key == #Escape ifTrue:[
     129        completionController closeCompletionView.
     130        ^ self
     131    ]. 
    128132    x isNil ifTrue:[
    129133        "/ Already re-delegated   
    130134        ^ self
    131135    ].
    132     key == #Escape ifTrue:[
    133         completionController closeCompletionView.
    134         ^ self
    135     ].
    136136    (key == #CursorDown
    137137        or:[ key == #CursorUp
    138138        or:[ key == #CursorLeft
     
    145145    ^ completionController editView keyPress:key x:x y:y
    146146
    147147    "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>"
    149148    "Modified: / 18-01-2018 / 23:10:58 / jv"
     149    "Modified: / 21-03-2018 / 10:10:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    150150! !
    151151
    152152!CompletionView methodsFor:'initialization & release'!