VirtualBox

Changeset 52649 in vbox for trunk


Ignore:
Timestamp:
Sep 8, 2014 6:51:05 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95954
Message:

FE/Qt: 3646: Runtime UI: Status-bar editor: Use more generic way of painting check-box control for hovered indicator switch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.cpp

    r52402 r52649  
    206206    const QIcon icon = gpConverter->toIcon(m_type);
    207207    /* Cache button size-hint: */
    208     m_size = icon.availableSizes().first();
     208    QStyleOptionButton option;
     209    option.initFrom(this);
     210    const QRect minRect = QApplication::style()->subElementRect(QStyle::SE_CheckBoxIndicator, &option);
     211    m_size = icon.availableSizes().first().expandedTo(minRect.size());
    209212    /* Cache pixmap of same size: */
    210213    m_pixmap = icon.pixmap(m_size);
     
    233236    /* Create style-painter: */
    234237    QStylePainter painter(this);
    235     QStyleOption option;
     238    /* Prepare option set for check-box: */
     239    QStyleOptionButton option;
    236240    option.initFrom(this);
     241    /* Use the size of 'this': */
    237242    option.rect = QRect(0, 0, width(), height());
     243    /* But do not use hover bit of 'this' since
     244     * we already have another hovered-state representation: */
     245    if (option.state & QStyle::State_MouseOver)
     246        option.state &= ~QStyle::State_MouseOver;
    238247    /* Remember checked-state: */
    239248    if (m_fChecked)
     
    241250    /* Draw check-box for hovered-state: */
    242251    if (m_fHovered)
    243         painter.drawPrimitive(QStyle::PE_IndicatorCheckBox, option);
     252        painter.drawControl(QStyle::CE_CheckBox, option);
    244253    /* Draw pixmap for unhovered-state: */
    245254    else
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette