Changeset 77812 in vbox for trunk/src/VBox
- Timestamp:
- Mar 20, 2019 4:33:59 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r77752 r77812 522 522 else 523 523 { 524 if ( m_iCurrentScrolledIndex < 0)524 if (--m_iCurrentScrolledIndex < 0) 525 525 m_iCurrentScrolledIndex = m_searchResults.size() - 1; 526 526 } … … 828 828 void UIChooserModel::sltShowHideSearchWidget() 829 829 { 830 UIChooserView *pChooserView = view(); 831 if (!pChooserView) 832 return; 833 pChooserView->toggleSearchWidget(); 830 if (view()) 831 setSearchWidgetVisible(!view()->isSearchWidgetVisible()); 834 832 } 835 833 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserSearchWidget.cpp
r77779 r77812 117 117 if (m_pLineEdit) 118 118 { 119 connect(m_pLineEdit, &QILineEdit::text Edited,119 connect(m_pLineEdit, &QILineEdit::textChanged, 120 120 this, &UIChooserSearchWidget::sltHandleSearchTermChange); 121 121 } … … 163 163 { 164 164 if (pKeyEvent->key() == Qt::Key_Escape) 165 { 165 166 emit sigToggleVisibility(false); 167 return true; 168 } 169 else if (pKeyEvent->key() == Qt::Key_Up || pKeyEvent->key() == Qt::Key_Down) 170 { 171 emit sigScrollToMatch(pKeyEvent->key() == Qt::Key_Down); 172 return true; 173 } 166 174 } 167 175 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserView.cpp
r77750 r77812 102 102 } 103 103 104 void UIChooserView::toggleSearchWidget() 104 bool UIChooserView::isSearchWidgetVisible() const 105 105 { 106 106 if (!m_pSearchWidget) 107 return; 108 bool fVisible = m_pSearchWidget->isVisible(); 109 setSearchWidgetVisible(!fVisible); 107 return false; 108 return m_pSearchWidget->isVisible(); 110 109 } 111 110 … … 114 113 if (!m_pSearchWidget) 115 114 return; 115 116 /** Make sure keyboard focus is managed ccorectly. */ 117 if (fVisible) 118 m_pSearchWidget->setFocus(); 119 else 120 setFocus(); 121 116 122 if (m_pSearchWidget->isVisible() == fVisible) 117 123 return; … … 121 127 122 128 UIChooserModel *pModel = m_pChooser->model(); 123 if (!pModel) 124 return; 125 pModel->resetSearch(); 129 if (pModel) 130 pModel->resetSearch(); 126 131 } 127 132 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserView.h
r77750 r77812 54 54 /** @name Virtual Machine search stuff. 55 55 * @{ */ 56 /** Shows/hides machine search widget. */57 void toggleSearchWidget();58 /** Shows/hides machine search widget. */56 /** Returns if the search widget is visible or not. */ 57 bool isSearchWidgetVisible() const; 58 /** Shows/hides wrt. @a fVisible machine search widget. */ 59 59 void setSearchWidgetVisible(bool fVisible); 60 60 /** Updates the search widget's counts. */
Note:
See TracChangeset
for help on using the changeset viewer.