#UI_ENHANCEMENT by exept
authorClaus Gittinger <cg@exept.de>
Thu, 14 Nov 2019 12:22:17 +0100
changeset 3819 a2f591cb8405
parent 3818 c3fd02d2d975
child 3820 2c48933f35cb
#UI_ENHANCEMENT by exept class: ShowMeHowItWorks changed: #showing:saying:do:
ShowMeHowItWorks.st
--- a/ShowMeHowItWorks.st	Thu Nov 14 12:10:56 2019 +0100
+++ b/ShowMeHowItWorks.st	Thu Nov 14 12:22:17 2019 +0100
@@ -457,15 +457,32 @@
     messageView := ActiveHelpView for:xLatedMessage.
     "/ messageView shapeStyle:#cartoon.
     [
-        |p top left bot right w h|
+        |p top left bot right w h screen screenBounds|
 
         w := messageView preferredExtent x.
         h := messageView preferredExtent y.
 
-        p := Screen current pointerPosition.
+        screen := Screen current.
+
+        p := screen pointerPosition.
+        screenBounds := screen monitorBoundsAt:p.
+
         left := p x. top := p y.
+        "/ try not to cover the thing we want to describe
+        left := left + 50.
+        top := top + 50.
+
         bot := top + h. right := left + w.
 
+        right > screenBounds right ifTrue:[
+            right := screenBounds right.
+            left := right - w.
+        ].
+        bot > screenBounds bottom ifTrue:[
+            bot := screenBounds bottom.
+            top := bot - h.
+        ].
+
         messageView origin:(left @ top).
         messageView makeFullyVisible.
         messageView realize.