Changeset 89170 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 19, 2021 2:09:35 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp
r89138 r89170 48 48 : UIChooserItem(0, pNode) 49 49 , m_pScene(pScene) 50 , m_iBackgroundDarknessStart(115) 51 , m_iBackgroundDarknessFinal(150) 50 52 , m_iAdditionalHeight(0) 51 53 , m_iHeaderDarkness(110) … … 68 70 : UIChooserItem(pParent, pNode) 69 71 , m_pScene(0) 72 , m_iBackgroundDarknessStart(115) 73 , m_iBackgroundDarknessFinal(150) 70 74 , m_iAdditionalHeight(0) 71 75 , m_iHeaderDarkness(110) … … 1588 1592 pPainter->save(); 1589 1593 1590 /* Non-root-item: */ 1591 if (!isRoot()) 1594 /* Root-item: */ 1595 if (isRoot()) 1596 { 1597 /* Acquire background color: */ 1598 const QColor backgroundColor = QApplication::palette().color(QPalette::Active, QPalette::Window); 1599 1600 /* Paint default background: */ 1601 QColor bcTone1 = backgroundColor.darker(m_iBackgroundDarknessStart); 1602 QColor bcTone2 = backgroundColor.darker(m_iBackgroundDarknessFinal); 1603 QLinearGradient gradientDefault(rect.topRight(), rect.bottomLeft()); 1604 gradientDefault.setColorAt(0, bcTone1); 1605 gradientDefault.setColorAt(1, bcTone2); 1606 pPainter->fillRect(rect, gradientDefault); 1607 } 1608 else 1592 1609 { 1593 1610 /* Prepare color: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h
r86767 r89170 323 323 /** Holds the cached machine children info. */ 324 324 QString m_strInfoMachines; 325 326 /** Holds the start background darkness. */ 327 int m_iBackgroundDarknessStart; 328 /** Holds the final background darkness. */ 329 int m_iBackgroundDarknessFinal; 325 330 326 331 /** Holds aditional height. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.cpp
r88805 r89170 195 195 } 196 196 197 void UIDetailsGroup::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions, QWidget *)198 {199 /* Paint background: */200 paintBackground(pPainter, pOptions);201 }202 203 197 void UIDetailsGroup::addItem(UIDetailsItem *pItem) 204 198 { … … 274 268 model(), &UIDetailsModel::sigRootItemMinimumWidthHintChanged); 275 269 } 276 277 void UIDetailsGroup::paintBackground(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions) const278 {279 /* Save painter: */280 pPainter->save();281 282 /* Prepare variables: */283 const QRect optionRect = pOptions->rect;284 285 /* Paint default background: */286 const QColor backgroundColor = QApplication::palette().color(QPalette::Active, QPalette::Window);287 pPainter->fillRect(optionRect, backgroundColor);288 289 /* Restore painter: */290 pPainter->restore();291 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.h
r82968 r89170 96 96 protected: 97 97 98 /** @name Event-handling stuff.99 * @{ */100 /** Performs painting using passed @a pPainter, @a pOptions and optionally specified @a pWidget. */101 virtual void paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions, QWidget *pWidget = 0) /* override */;102 /** @} */103 104 98 /** @name Item stuff. 105 99 * @{ */ … … 138 132 /** @} */ 139 133 140 /** @name Painting stuff.141 * @{ */142 /** Paints background using specified @a pPainter and certain @a pOptions. */143 void paintBackground(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions) const;144 /** @} */145 146 134 /** @name Item stuff. 147 135 * @{ */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.cpp
r89159 r89170 44 44 , m_configurationAccessLevel(ConfigurationAccessLevel_Null) 45 45 , m_pBuildStep(0) 46 , m_iBackgroundDarknessStart(115) 47 , m_iBackgroundDarknessFinal(150) 46 48 { 47 49 /* Add set to the parent group: */ … … 744 746 const QRect optionRect = pOptions->rect; 745 747 748 /* Acquire background color: */ 749 const QColor backgroundColor = QApplication::palette().color(QPalette::Active, QPalette::Window); 750 746 751 /* Paint default background: */ 747 const QColor backgroundColor = QApplication::palette().color(QPalette::Active, QPalette::Window); 748 pPainter->fillRect(optionRect, backgroundColor); 752 QColor bcTone1 = backgroundColor.darker(m_iBackgroundDarknessStart); 753 QColor bcTone2 = backgroundColor.darker(m_iBackgroundDarknessFinal); 754 QLinearGradient gradientDefault(optionRect.topLeft(), optionRect.bottomRight()); 755 gradientDefault.setColorAt(0, bcTone1); 756 gradientDefault.setColorAt(1, bcTone2); 757 pPainter->fillRect(optionRect, gradientDefault); 749 758 750 759 /* Restore painter: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.h
r89106 r89170 213 213 /** Holds the generated set ID. */ 214 214 QUuid m_uSetId; 215 216 /** Holds the start background darkness. */ 217 int m_iBackgroundDarknessStart; 218 /** Holds the final background darkness. */ 219 int m_iBackgroundDarknessFinal; 215 220 /** @} */ 216 221
Note:
See TracChangeset
for help on using the changeset viewer.