- Timestamp:
- Dec 27, 2023 11:07:54 AM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialog.cpp
r102710 r102711 428 428 m_fFocused = true; 429 429 emit sigFocused(); 430 update(); 430 431 break; 431 432 /* Backward animation on focus-out: */ … … 433 434 m_fFocused = false; 434 435 emit sigUnfocused(); 436 update(); 435 437 break; 436 438 default: … … 463 465 const bool fActive = window() && window()->isActiveWindow(); 464 466 const QPalette::ColorGroup enmColorGroup = fActive ? QPalette::Active : QPalette::Inactive; 467 #ifdef VBOX_WS_MAC 468 const QColor colorHighlight = uiCommon().isInDarkMode() 469 ? qApp->palette().color(enmColorGroup, QPalette::Highlight).lighter(110) 470 : qApp->palette().color(enmColorGroup, QPalette::Highlight).darker(110); 471 #endif 465 472 const QColor colorBase = qApp->palette().color(enmColorGroup, QPalette::Base); 466 473 const QColor colorFrame = uiCommon().isInDarkMode() … … 471 478 const QRegion totalRegion = QRegion(m_pLineEdit->geometry()) + QRegion(m_pToolButton->geometry()); 472 479 QRect widgetRect = totalRegion.boundingRect(); 480 #ifdef VBOX_WS_MAC 481 const QRect focusRect = widgetRect; 482 widgetRect.adjust(3, 3, -3, -3); 483 const QPainterPath focusPath = cookPainterPath(focusRect, m_iRadius + 2); 484 #endif 473 485 const QPainterPath widgetPath = cookPainterPath(widgetRect, m_iRadius); 474 486 475 487 /* Draw base/frame: */ 488 #ifdef VBOX_WS_MAC 489 if (m_pLineEdit->hasFocus()) 490 painter.fillPath(focusPath, colorHighlight); 491 #endif 476 492 painter.fillPath(widgetPath, colorBase); 477 493 painter.strokePath(widgetPath, colorFrame); … … 498 514 if (m_pLineEdit) 499 515 { 516 #ifdef VBOX_WS_MAC 517 /* A bit of magic to be able to replace the frame. 518 * Disable border, adjust margins and make background transparent. 519 * Left and right margins also take focus ring into account. */ 520 m_pLineEdit->setStyleSheet("QLineEdit {\ 521 background-color: rgba(255, 255, 255, 0%);\ 522 border: 0px none black;\ 523 margin: 6px 0px 6px 10px;\ 524 }"); 525 #else 500 526 /* A bit of magic to be able to replace the frame. 501 527 * Disable border, adjust margins and make background transparent. */ … … 505 531 margin: 3px 0px 3px 10px;\ 506 532 }"); 533 #endif 507 534 m_pLineEdit->installEventFilter(this); 508 535 connect(m_pLineEdit, &QILineEdit::textChanged,
Note:
See TracChangeset
for help on using the changeset viewer.