- Timestamp:
- Apr 9, 2019 12:02:30 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/guestctrl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.cpp
r78055 r78058 783 783 m_pSearchLineEdit->hide(); 784 784 m_pSearchLineEdit->setClearButtonEnabled(true); 785 m_searchLineUnmarkColor = m_pSearchLineEdit->palette().color(QPalette::Base); 786 m_searchLineMarkColor = QColor(m_searchLineUnmarkColor.green(), 787 0.5 * m_searchLineUnmarkColor.green(), 788 0.5 * m_searchLineUnmarkColor.blue()); 785 789 connect(m_pSearchLineEdit, &QLineEdit::textChanged, 786 790 this, &UIFileManagerTable::sltSearchTextChanged); … … 1302 1306 if (m_pSearchLineEdit) 1303 1307 { 1308 markUnmarkSearchLineEdit(false); 1304 1309 m_pSearchLineEdit->clear(); 1305 1310 m_pSearchLineEdit->show(); … … 1469 1474 void UIFileManagerTable::performSelectionSearch(const QString &strSearchText) 1470 1475 { 1471 if (!m_pProxyModel | !m_pView || strSearchText.isEmpty()) 1472 return; 1476 if (!m_pProxyModel | !m_pView) 1477 return; 1478 1479 if (strSearchText.isEmpty()) 1480 { 1481 markUnmarkSearchLineEdit(false); 1482 return; 1483 } 1473 1484 1474 1485 int rowCount = m_pProxyModel->rowCount(m_pView->rootIndex()); … … 1493 1504 setSelection(index); 1494 1505 } 1506 markUnmarkSearchLineEdit(!pFoundItem); 1495 1507 } 1496 1508 … … 1532 1544 } 1533 1545 1546 void UIFileManagerTable::markUnmarkSearchLineEdit(bool fMark) 1547 { 1548 if (!m_pSearchLineEdit) 1549 return; 1550 QPalette palette = m_pSearchLineEdit->palette(); 1551 1552 if (fMark) 1553 palette.setColor(QPalette::Base, m_searchLineMarkColor); 1554 else 1555 palette.setColor(QPalette::Base, m_searchLineUnmarkColor); 1556 m_pSearchLineEdit->setPalette(palette); 1557 } 1558 1534 1559 #include "UIFileManagerTable.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.h
r78024 r78058 283 283 * if deletion can continue */ 284 284 bool checkIfDeleteOK(); 285 /** Marks/umarks the search line edit to signal that there are no matches for the current search. 286 * uses m_searchLineUnmarkColor and m_searchLineMarkColor. */ 287 void markUnmarkSearchLineEdit(bool fMark); 285 288 286 289 UICustomFileSystemModel *m_pModel; … … 290 293 QGridLayout *m_pMainLayout; 291 294 QILineEdit *m_pSearchLineEdit; 295 QColor m_searchLineUnmarkColor; 296 QColor m_searchLineMarkColor; 292 297 QILabel *m_pWarningLabel; 293 298
Note:
See TracChangeset
for help on using the changeset viewer.