Changeset 88969 in vbox
- Timestamp:
- May 10, 2021 5:50:38 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp
r88931 r88969 27 27 #include <QScrollBar> 28 28 #include <QStyle> 29 #include <QStyleFactory> 29 30 #include <QStylePainter> 30 31 #include <QStyleOptionTab> … … 108 109 m_alternateColors << opt.palette.color(QPalette::Button).darker(140); 109 110 m_selectedTabColor = opt.palette.color(QPalette::Window).lighter(300); 111 112 QStyle *pFusionStyle = QStyleFactory::create("Fusion"); 113 if (pFusionStyle) 114 setStyle(pFusionStyle); 110 115 } 111 116 … … 122 127 123 128 if (i == currentIndex()) 124 opt.palette.setColor(QPalette:: Window, m_selectedTabColor);129 opt.palette.setColor(QPalette::Button, m_selectedTabColor); 125 130 else 126 131 { 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 130 132 int iColorIndex = tabData(i).toInt(); 131 133 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]); 133 135 } 134 136 painter.drawControl(QStyle::CE_TabBarTab, opt);
Note:
See TracChangeset
for help on using the changeset viewer.