VirtualBox

Changeset 88969 in vbox


Ignore:
Timestamp:
May 10, 2021 5:50:38 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9930. Some more tab color hack

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp

    r88931 r88969  
    2727#include <QScrollBar>
    2828#include <QStyle>
     29#include <QStyleFactory>
    2930#include <QStylePainter>
    3031#include <QStyleOptionTab>
     
    108109    m_alternateColors << opt.palette.color(QPalette::Button).darker(140);
    109110    m_selectedTabColor = opt.palette.color(QPalette::Window).lighter(300);
     111
     112    QStyle *pFusionStyle = QStyleFactory::create("Fusion");
     113    if (pFusionStyle)
     114        setStyle(pFusionStyle);
    110115}
    111116
     
    122127
    123128        if (i == currentIndex())
    124             opt.palette.setColor(QPalette::Window, m_selectedTabColor);
     129            opt.palette.setColor(QPalette::Button, m_selectedTabColor);
    125130        else
    126131        {
    127             /* Hack alert. I could not convince drawControl to use the set color if QStyle::State_Selected is not set: */
    128             opt.state |=  QStyle::State_Selected;
    129 
    130132            int iColorIndex = tabData(i).toInt();
    131133            if (iColorIndex >= 0 && iColorIndex <= m_alternateColors.size())
    132                 opt.palette.setColor(QPalette::Window, m_alternateColors[iColorIndex]);
     134                opt.palette.setColor(QPalette::Button, m_alternateColors[iColorIndex]);
    133135        }
    134136        painter.drawControl(QStyle::CE_TabBarTab, opt);
Note: See TracChangeset for help on using the changeset viewer.

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