#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Tue, 19 Jun 2018 14:46:36 +0200
changeset 8395 d52686498a23
parent 8394 44c396105bcc
child 8396 c6ff7df785d8
#UI_ENHANCEMENT by cg class: TopView added: #isActive moved.
TopView.st
--- a/TopView.st	Tue Jun 19 14:45:41 2018 +0200
+++ b/TopView.st	Tue Jun 19 14:46:36 2018 +0200
@@ -918,6 +918,19 @@
     ^ height
 !
 
+isActive
+    "true, if I have the focus (w.r.t the windowing system);
+     i.e. if one of my subViews actually has the real focus.
+     With click-to-focus behavior, this is obviously the current application.
+     Use this query with caution, for example, to suppress tooltips for inactive apps."
+
+    ^ windowGroup notNil 
+    and:[windowGroup anyViewHasFocus
+         or:[ self graphicsDevice focusWindowGroup == windowGroup]].
+
+    "Created: / 19-06-2018 / 14:46:21 / Claus Gittinger"
+!
+
 isCollapsed
     "ST80 compatibility: return true if the view is not shown (i.e. iconified)"