Changeset 77980 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 1, 2019 5:31:43 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 129745
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserView.cpp
r77948 r77980 106 106 if (!m_pSearchWidget) 107 107 return false; 108 109 /* Return widget visibility state: */ 108 110 return m_pSearchWidget->isVisible(); 109 111 } … … 114 116 return; 115 117 116 /* Make sure keyboard focus is managed c corectly: */118 /* Make sure keyboard focus is managed correctly: */ 117 119 if (fVisible) 118 120 m_pSearchWidget->setFocus(); … … 120 122 setFocus(); 121 123 124 /* Make sure visibility state is really changed: */ 122 125 if (m_pSearchWidget->isVisible() == fVisible) 123 126 return; 127 128 /* Set widget visibility state: */ 124 129 m_pSearchWidget->setVisible(fVisible); 130 131 /* Update geometry if widget is visible: */ 125 132 if (m_pSearchWidget->isVisible()) 126 133 updateSearchWidgetGeometry(); 127 134 128 UIChooserModel *pModel = m_pChooser->model(); 135 /* Reset search each time widget visibility changed: */ 136 UIChooserModel *pModel = m_pChooser->model(); 129 137 if (pModel) 130 138 pModel->resetSearch(); … … 135 143 if (!m_pSearchWidget) 136 144 return; 145 137 146 m_pSearchWidget->setMatchCount(iTotalMacthCount); 138 147 m_pSearchWidget->setScroolToIndex(iCurrentlyScrolledItemIndex); … … 141 150 void UIChooserView::appendToSearchString(const QString &strSearchText) 142 151 { 143 if (m_pSearchWidget) 144 m_pSearchWidget->appendToSearchString(strSearchText); 152 if (!m_pSearchWidget) 153 return; 154 155 m_pSearchWidget->appendToSearchString(strSearchText); 145 156 } 146 157 … … 165 176 if (!m_pChooser) 166 177 return; 167 168 178 UIChooserModel *pModel = m_pChooser->model(); 169 179 if (!pModel) 170 180 return; 181 171 182 pModel->performSearch(strSearchTerm, iItemSearchFlags); 172 183 } … … 174 185 void UIChooserView::sltHandleScrollToSearchResult(bool fIsNext) 175 186 { 187 if (!m_pChooser) 188 return; 176 189 UIChooserModel *pModel = m_pChooser->model(); 177 190 if (!pModel) 178 191 return; 192 179 193 pModel->selectSearchResult(fIsNext); 180 194 } … … 214 228 m_pSearchWidget->hide(); 215 229 connect(m_pSearchWidget, &UIChooserSearchWidget::sigRedoSearch, 216 230 this, &UIChooserView::sltRedoSearch); 217 231 connect(m_pSearchWidget, &UIChooserSearchWidget::sigScrollToMatch, 218 232 this, &UIChooserView::sltHandleScrollToSearchResult); 219 233 connect(m_pSearchWidget, &UIChooserSearchWidget::sigToggleVisibility, 220 234 this, &UIChooserView::sltHandleSearchWidgetVisibilityToggle); 221 235 222 236 /* Update scene-rect: */ 223 237 updateSceneRect(); 224 225 238 /* Update the location and size of the search widget: */ 226 239 updateSearchWidgetGeometry(); … … 248 261 /* Update scene-rect: */ 249 262 updateSceneRect(); 263 /* Update the location and size of the search widget: */ 250 264 updateSearchWidgetGeometry(); 251 265 } … … 260 274 if (!m_pSearchWidget || !m_pSearchWidget->isVisible()) 261 275 return; 262 int iHeight = m_pSearchWidget->height(); 263 QRect widgetRect(0, height() - iHeight, 264 width(), iHeight); 265 m_pSearchWidget->setGeometry(widgetRect); 266 } 276 277 const int iHeight = m_pSearchWidget->height(); 278 m_pSearchWidget->setGeometry(QRect(0, height() - iHeight, width(), iHeight)); 279 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserView.h
r77812 r77980 52 52 /** @} */ 53 53 54 /** @name Virtual Machine search stuff.54 /** @name Search stuff. 55 55 * @{ */ 56 56 /** Returns if the search widget is visible or not. */ … … 107 107 /** @} */ 108 108 109 /** @name Virtual Machine search stuff.109 /** @name Search stuff. 110 110 * @{ */ 111 111 /** Updates search widget's geometry. */
Note:
See TracChangeset
for help on using the changeset viewer.