Changeset 102633 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Dec 18, 2023 2:22:41 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialog.cpp
r102619 r102633 457 457 458 458 /* Prepare base/frame painter path: */ 459 const QRect widgetRect = m_pLineEdit->geometry(); 459 const QRegion totalRegion = QRegion(m_pLineEdit->geometry()) + QRegion(m_pToolButton->geometry()); 460 const QRect widgetRect = totalRegion.boundingRect(); 460 461 const QSizeF arcSize(2 * m_iRadius, 2 * m_iRadius); 461 462 QPainterPath path; … … 500 501 background-color: rgba(255, 255, 255, 0%);\ 501 502 border: 0px none black;\ 502 margin: 3px 10px 3px 10px;\503 margin: 3px 0px 3px 10px;\ 503 504 }"); 504 505 m_pLineEdit->installEventFilter(this); … … 511 512 if (m_pToolButton) 512 513 { 513 #ifdef VBOX_WS_MAC 514 setStyleSheet("QToolButton { border: 0px none black; margin: 0px 0px 0px 0px; } QToolButton::menu-indicator {image: none;}"); 515 #endif 514 m_pToolButton->setStyleSheet("QToolButton {\ 515 border: 0px none black;\ 516 margin: 0px 5px 0px 5px;\ 517 }\ 518 QToolButton::menu-indicator {\ 519 image: none;\ 520 }"); 516 521 m_pToolButton->hide(); 517 522 m_pToolButton->setIconSize(QSize(10, 10)); … … 543 548 const int iWidth = width(); 544 549 545 /* Update filter editor geometry: */550 /* Acquire filter editor size-hint: */ 546 551 const QSize esh = m_pLineEdit->minimumSizeHint(); 547 552 const int iMinimumEditorWidth = esh.width(); 548 553 const int iMinimumEditorHeight = esh.height(); 549 /* Update minimum/maximum filter editor width: */ 550 m_iUnfocusedEditorWidth = qMax(iWidth / 2, iMinimumEditorWidth); 551 m_iFocusedEditorWidth = qMax(iWidth, iMinimumEditorWidth); 552 m_pAnimation->update(); 553 setEditorWidth(m_fFocused ? m_iFocusedEditorWidth : m_iUnfocusedEditorWidth); 554 555 /* Update filter button geometry: */ 554 /* Acquire filter button size-hint: */ 556 555 const QSize bsh = m_pToolButton->minimumSizeHint(); 557 556 const int iMinimumButtonWidth = bsh.width(); 558 557 const int iMinimumButtonHeight = bsh.height(); 558 559 /* Update filter button geo: */ 560 const int iButtonX = iWidth - iMinimumButtonWidth; 559 561 const int iButtonY = iMinimumEditorHeight > iMinimumButtonHeight 560 562 ? (iMinimumEditorHeight - iMinimumButtonHeight) / 2 + 1 561 563 : 0; 562 m_pToolButton->setGeometry(iWidth - iMinimumButtonWidth - 1, iButtonY, iMinimumButtonWidth, iMinimumButtonHeight); 563 } 564 565 void UIFilterEditor::setEditorWidth(int iWidth) 564 m_pToolButton->setGeometry(iButtonX, iButtonY, iMinimumButtonWidth, iMinimumButtonHeight); 565 566 /* Update minimum/maximum filter editor width: */ 567 m_iUnfocusedEditorWidth = qMax(iWidth / 2 - iMinimumButtonWidth, iMinimumEditorWidth); 568 m_iFocusedEditorWidth = qMax(iWidth - iMinimumButtonWidth, iMinimumEditorWidth); 569 m_pAnimation->update(); 570 setEditorWidth(m_fFocused ? m_iFocusedEditorWidth : m_iUnfocusedEditorWidth); 571 } 572 573 void UIFilterEditor::setEditorWidth(int iEditorWidth) 566 574 { 567 575 /* Align filter editor right: */ 568 const int iX = width() - iWidth;576 const int iX = m_pToolButton->x() - iEditorWidth; 569 577 const int iY = 0; 570 const int i Height = m_pLineEdit->minimumSizeHint().height();578 const int iEditorHeight = m_pLineEdit->minimumSizeHint().height(); 571 579 const QRect oldGeo = m_pLineEdit->geometry(); 572 m_pLineEdit->setGeometry(iX, iY, i Width, iHeight);580 m_pLineEdit->setGeometry(iX, iY, iEditorWidth, iEditorHeight); 573 581 const QRect newGeo = m_pLineEdit->geometry(); 574 582
Note:
See TracChangeset
for help on using the changeset viewer.