Changeset 86831 in vbox
- Timestamp:
- Nov 9, 2020 8:20:42 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 141278
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r86830 r86831 160 160 const QHelpEngine* m_pHelpEngine; 161 161 UIFindInPageWidget *m_pFindInPageWidget; 162 /* Initilized as false and set to true once the find widget is positioned during first resize. */163 bool m_fFindWidget Positioned;162 /* Initilized as false and set to true once the user drag moves the find widget. */ 163 bool m_fFindWidgetDragged; 164 164 const int m_iMarginForFindWidget; 165 165 /** Document positions of the cursors within the document for all matches. */ … … 625 625 , m_pHelpEngine(pHelpEngine) 626 626 , m_pFindInPageWidget(new UIFindInPageWidget(this)) 627 , m_fFindWidget Positioned(false)627 , m_fFindWidgetDragged(false) 628 628 , m_iMarginForFindWidget(qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin)) 629 629 , m_iSelectedMatchIndex(0) … … 673 673 if (!m_pFindInPageWidget) 674 674 return; 675 /* Try to position the widget somewhere meaningful initially: */ 676 if (!m_fFindWidgetDragged) 677 m_pFindInPageWidget->move(width() - m_iMarginForFindWidget - m_pFindInPageWidget->width(), 678 m_iMarginForFindWidget); 679 675 680 m_pFindInPageWidget->setVisible(fVisible); 676 681 … … 709 714 void UIHelpBrowserViewer::resizeEvent(QResizeEvent *pEvent) 710 715 { 716 /* Make sure the widget stays inside the parent during parent resize: */ 711 717 if (m_pFindInPageWidget) 712 718 { 713 if (!m_fFindWidgetPositioned) 714 { 715 m_pFindInPageWidget->move(m_iMarginForFindWidget, m_iMarginForFindWidget); 716 m_fFindWidgetPositioned = true; 717 } 718 else 719 if (!isRectInside(m_pFindInPageWidget->geometry(), m_iMarginForFindWidget)) 720 moveFindWidgetIn(m_iMarginForFindWidget); 719 if (!isRectInside(m_pFindInPageWidget->geometry(), m_iMarginForFindWidget)) 720 moveFindWidgetIn(m_iMarginForFindWidget); 721 721 } 722 722 QIWithRetranslateUI<QTextBrowser>::resizeEvent(pEvent); … … 831 831 if (isRectInside(geo, m_iMarginForFindWidget)) 832 832 m_pFindInPageWidget->move(m_pFindInPageWidget->pos() + delta); 833 m_fFindWidgetDragged = true; 833 834 update(); 834 835 }
Note:
See TracChangeset
for help on using the changeset viewer.