Changeset 102704 in vbox
- Timestamp:
- Dec 26, 2023 3:18:43 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialog.cpp
r102697 r102704 293 293 void UIModeCheckBox::paintEvent(QPaintEvent *pEvent) 294 294 { 295 /* Prepare painter: */ 296 QPainter painter(this); 297 painter.setRenderHint(QPainter::Antialiasing); 298 painter.setRenderHint(QPainter::TextAntialiasing); 299 /* Avoid painting more than necessary: */ 300 painter.setClipRect(pEvent->rect()); 301 295 302 /* Acquire useful properties: */ 296 const QPalette pal = QGuiApplication::palette();297 QRect contentRect = pEvent->rect();303 const QPalette pal = qApp->palette(); 304 QRect contentRect = rect(); 298 305 #ifdef VBOX_WS_MAC 299 306 contentRect.setLeft(contentRect.left() + 2); /// @todo justify! … … 301 308 #endif 302 309 303 /* Prepare painter: */304 QPainter painter(this);305 306 310 /* Prepare left painter paths: */ 307 311 QPainterPath painterPath1; 308 painterPath1.lineTo(contentRect.width() / 2 - 1, 0); 312 painterPath1.moveTo(contentRect.x(), contentRect.y()); 313 painterPath1.lineTo(contentRect.width() / 2, contentRect.y()); 309 314 painterPath1.lineTo(contentRect.width() / 2 - contentRect.height(), contentRect.height()); 310 painterPath1.lineTo( 0,contentRect.height());315 painterPath1.lineTo(contentRect.x(), contentRect.height()); 311 316 painterPath1.closeSubpath(); 312 317 313 318 /* Prepare right painter paths: */ 314 319 QPainterPath painterPath2; 315 painterPath2.moveTo(contentRect.width() / 2 + 1, 0);316 painterPath2.lineTo(contentRect.width(), 0);320 painterPath2.moveTo(contentRect.width() / 2 + 1, contentRect.y()); 321 painterPath2.lineTo(contentRect.width(), contentRect.y()); 317 322 painterPath2.lineTo(contentRect.width() - contentRect.height(), contentRect.height()); 318 323 painterPath2.lineTo(contentRect.width() / 2 + 1 - contentRect.height(), contentRect.height()); … … 337 342 /* Paint fancy shape: */ 338 343 painter.save(); 339 painter. setClipPath(painterPath1);340 painter. fillRect(contentRect, grad1);341 painter. setClipPath(painterPath2);342 painter. fillRect(contentRect, grad2);344 painter.fillPath(painterPath1, grad1); 345 painter.strokePath(painterPath1, backColor1.darker(110)); 346 painter.fillPath(painterPath2, grad2); 347 painter.strokePath(painterPath2, backColor2.darker(110)); 343 348 painter.restore(); 344 349 … … 555 560 QFontMetrics fm(m_pLineEdit->font()); 556 561 const int iPlaceholderWidth = fm.horizontalAdvance(m_pLineEdit->placeholderText()) 557 + 2 * 2/* left/right panel/frame width, no pixelMetric */562 + 2 * 5 /* left/right panel/frame width, no pixelMetric */ 558 563 + 10 /* left margin, assigned via setStyleSheet */; 559 564 /* Acquire filter editor size-hint: */
Note:
See TracChangeset
for help on using the changeset viewer.

