Changeset 102708 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Dec 27, 2023 10:08:20 AM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialog.cpp
r102707 r102708 176 176 void cleanup(); 177 177 178 /** Returns painter path for the passed @a pathRect. */ 179 QPainterPath cookPainterPath(const QRect &pathRect); 180 178 181 /** Adjusts editor geometry. */ 179 182 void adjustEditorGeometry(); … … 469 472 /* Prepare base/frame painter path: */ 470 473 const QRegion totalRegion = QRegion(m_pLineEdit->geometry()) + QRegion(m_pToolButton->geometry()); 471 const QRect widgetRect = totalRegion.boundingRect(); 472 const QSizeF arcSize(2 * m_iRadius, 2 * m_iRadius); 473 QPainterPath path; 474 path.moveTo(widgetRect.x() + m_iRadius, widgetRect.y()); 475 path.arcTo(QRectF(path.currentPosition(), arcSize).translated(-m_iRadius, 0), 90, 90); 476 path.lineTo(path.currentPosition().x(), path.currentPosition().y() + widgetRect.height() - 2 * m_iRadius); 477 path.arcTo(QRectF(path.currentPosition(), arcSize).translated(0, -m_iRadius), 180, 90); 478 path.lineTo(path.currentPosition().x() + widgetRect.width() - 2 * m_iRadius, path.currentPosition().y()); 479 path.arcTo(QRectF(path.currentPosition(), arcSize).translated(-m_iRadius, -2 * m_iRadius), 270, 90); 480 path.lineTo(path.currentPosition().x(), path.currentPosition().y() - widgetRect.height() + 2 * m_iRadius); 481 path.arcTo(QRectF(path.currentPosition(), arcSize).translated(-2 * m_iRadius, -m_iRadius), 0, 90); 482 path.closeSubpath(); 474 QRect widgetRect = totalRegion.boundingRect(); 475 const QPainterPath widgetPath = cookPainterPath(widgetRect); 483 476 484 477 /* Draw base/frame: */ 485 painter.fillPath( path, colorBase);486 painter.strokePath( path, colorFrame);478 painter.fillPath(widgetPath, colorBase); 479 painter.strokePath(widgetPath, colorFrame); 487 480 } 488 481 … … 551 544 delete m_pAnimation; 552 545 m_pAnimation = 0; 546 } 547 548 QPainterPath UIFilterEditor::cookPainterPath(const QRect &pathRect) 549 { 550 QPainterPath path; 551 const QSizeF arcSize(2 * m_iRadius, 2 * m_iRadius); 552 path.moveTo(pathRect.x() + m_iRadius, pathRect.y()); 553 path.arcTo(QRectF(path.currentPosition(), arcSize).translated(-m_iRadius, 0), 90, 90); 554 path.lineTo(path.currentPosition().x(), path.currentPosition().y() + pathRect.height() - 2 * m_iRadius); 555 path.arcTo(QRectF(path.currentPosition(), arcSize).translated(0, -m_iRadius), 180, 90); 556 path.lineTo(path.currentPosition().x() + pathRect.width() - 2 * m_iRadius, path.currentPosition().y()); 557 path.arcTo(QRectF(path.currentPosition(), arcSize).translated(-m_iRadius, -2 * m_iRadius), 270, 90); 558 path.lineTo(path.currentPosition().x(), path.currentPosition().y() - pathRect.height() + 2 * m_iRadius); 559 path.arcTo(QRectF(path.currentPosition(), arcSize).translated(-2 * m_iRadius, -m_iRadius), 0, 90); 560 path.closeSubpath(); 561 return path; 553 562 } 554 563
Note:
See TracChangeset
for help on using the changeset viewer.