소스 검색

Reopen the popup when closing, AutoHide and the mouse back

If Autoshow is false but AutoHide true, then leaving the mouse out of the
hot area was closing the popup but was not reopening the popup if the
mouse was back in the area.
Julien Finet 14 년 전
부모
커밋
6864b2a2b1
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      Libs/Widgets/ctkPopupWidget.cpp

+ 7 - 1
Libs/Widgets/ctkPopupWidget.cpp

@@ -479,7 +479,13 @@ void ctkPopupWidget::updatePopup()
 
   // Querying mouseOver can be slow, don't do it if not needed.
   QWidget* mouseOver = (d->AutoShow || d->AutoHide) ? d->mouseOver() : 0;
-  if (d->AutoShow && mouseOver &&
+  if ((d->AutoShow ||
+     // Even if there is no AutoShow, we might still want to reopen the popup
+     // when closing it inadvertently
+       d->AutoHide && d->isClosing()) &&
+     // to be automatically open, the mouse has to be over a child widget
+      mouseOver &&
+     // disable opening the popup when the popup is disabled
       (!d->BaseWidget || d->BaseWidget->isEnabled()))
     {
     this->showPopup();