Changeset 89137 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 18, 2021 12:36:28 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144478
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGlobal.cpp
r88862 r89137 28 28 #include "UIIconPool.h" 29 29 #include "UIVirtualBoxManager.h" 30 31 /* Other VBox includes: */32 #include "iprt/cpp/utils.h"33 30 34 31 … … 553 550 } 554 551 555 void UIChooserItemGlobal::paintBackground(QPainter *pPainter, const QRect &rectangle) const552 void UIChooserItemGlobal::paintBackground(QPainter *pPainter, const QRect &rectangle) 556 553 { 557 554 /* Save painter: */ … … 562 559 563 560 /* Selected-item background: */ 564 if (model()->selectedItems().contains( unconst(this)))561 if (model()->selectedItems().contains(this)) 565 562 { 566 563 /* Prepare color: */ … … 655 652 } 656 653 657 void UIChooserItemGlobal::paintFrame(QPainter *pPainter, const QRect &rectangle) const654 void UIChooserItemGlobal::paintFrame(QPainter *pPainter, const QRect &rectangle) 658 655 { 659 656 /* Only selected and/or hovered item should have a frame: */ 660 if (!model()->selectedItems().contains( unconst(this)) && !isHovered())657 if (!model()->selectedItems().contains(this) && !isHovered()) 661 658 return; 662 659 … … 669 666 670 667 /* Selected-item frame: */ 671 if (model()->selectedItems().contains( unconst(this)))668 if (model()->selectedItems().contains(this)) 672 669 strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHighlightLightnessMin - 40); 673 670 /* Hovered-item frame: */ … … 689 686 } 690 687 691 void UIChooserItemGlobal::paintGlobalInfo(QPainter *pPainter, const QRect &rectangle) const688 void UIChooserItemGlobal::paintGlobalInfo(QPainter *pPainter, const QRect &rectangle) 692 689 { 693 690 /* Prepare variables: */ … … 700 697 701 698 /* Selected or hovered item foreground: */ 702 if (model()->selectedItems().contains( unconst(this)) || isHovered())699 if (model()->selectedItems().contains(this) || isHovered()) 703 700 { 704 701 /* Prepare palette: */ … … 707 704 /* Get background color: */ 708 705 const QColor highlight = pal.color(QPalette::Active, QPalette::Highlight); 709 const QColor background = model()->selectedItems().contains( unconst(this))706 const QColor background = model()->selectedItems().contains(this) 710 707 ? highlight.lighter(m_iHighlightLightnessMin) 711 708 : highlight.lighter(m_iHoverLightnessMin); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGlobal.h
r84625 r89137 210 210 * @{ */ 211 211 /** Paints background using specified @a pPainter and certain @a rectangle. */ 212 void paintBackground(QPainter *pPainter, const QRect &rectangle) const;212 void paintBackground(QPainter *pPainter, const QRect &rectangle); 213 213 /** Paints frame using specified @a pPainter and certain @a rect. */ 214 void paintFrame(QPainter *pPainter, const QRect &rectangle) const;214 void paintFrame(QPainter *pPainter, const QRect &rectangle); 215 215 /** Paints global info using specified @a pPainter and certain @a pOptions. */ 216 void paintGlobalInfo(QPainter *pPainter, const QRect &rectangle) const;216 void paintGlobalInfo(QPainter *pPainter, const QRect &rectangle); 217 217 /** @} */ 218 218 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp
r88862 r89137 33 33 #include "UIVirtualMachineItemCloud.h" 34 34 #include "UIVirtualMachineItemLocal.h" 35 36 /* Other VBox includes: */37 #include "iprt/cpp/utils.h"38 35 39 36 … … 897 894 } 898 895 899 void UIChooserItemMachine::paintBackground(QPainter *pPainter, const QRect &rectangle) const896 void UIChooserItemMachine::paintBackground(QPainter *pPainter, const QRect &rectangle) 900 897 { 901 898 /* Save painter: */ … … 906 903 907 904 /* Selected-item background: */ 908 if (model()->selectedItems().contains( unconst(this)))905 if (model()->selectedItems().contains(this)) 909 906 { 910 907 /* Prepare color: */ … … 999 996 { 1000 997 /* Selected-item background: */ 1001 if (model()->selectedItems().contains( unconst(this)))998 if (model()->selectedItems().contains(this)) 1002 999 backgroundColor = pal.color(QPalette::Active, QPalette::Highlight); 1003 1000 /* Default background: */ … … 1012 1009 { 1013 1010 /* Selected-item background: */ 1014 if (model()->selectedItems().contains( unconst(this)))1011 if (model()->selectedItems().contains(this)) 1015 1012 backgroundColor = pal.color(QPalette::Active, QPalette::Highlight); 1016 1013 /* Default background: */ … … 1035 1032 } 1036 1033 1037 void UIChooserItemMachine::paintFrame(QPainter *pPainter, const QRect &rectangle) const1034 void UIChooserItemMachine::paintFrame(QPainter *pPainter, const QRect &rectangle) 1038 1035 { 1039 1036 /* Only selected and/or hovered item should have a frame: */ 1040 if (!model()->selectedItems().contains( unconst(this)) && !isHovered())1037 if (!model()->selectedItems().contains(this) && !isHovered()) 1041 1038 return; 1042 1039 … … 1049 1046 1050 1047 /* Selected-item frame: */ 1051 if (model()->selectedItems().contains( unconst(this)))1048 if (model()->selectedItems().contains(this)) 1052 1049 strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHighlightLightnessMin - 40); 1053 1050 /* Hovered-item frame: */ … … 1071 1068 } 1072 1069 1073 void UIChooserItemMachine::paintMachineInfo(QPainter *pPainter, const QRect &rectangle) const1070 void UIChooserItemMachine::paintMachineInfo(QPainter *pPainter, const QRect &rectangle) 1074 1071 { 1075 1072 /* Prepare variables: */ … … 1084 1081 1085 1082 /* Selected or hovered item foreground: */ 1086 if (model()->selectedItems().contains( unconst(this)) || isHovered())1083 if (model()->selectedItems().contains(this) || isHovered()) 1087 1084 { 1088 1085 /* Prepare palette: */ … … 1091 1088 /* Get background color: */ 1092 1089 const QColor highlight = pal.color(QPalette::Active, QPalette::Highlight); 1093 const QColor background = model()->selectedItems().contains( unconst(this))1090 const QColor background = model()->selectedItems().contains(this) 1094 1091 ? highlight.lighter(m_iHighlightLightnessMin) 1095 1092 : highlight.lighter(m_iHoverLightnessMin); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.h
r86769 r89137 243 243 * @{ */ 244 244 /** Paints background using specified @a pPainter and certain @a rectangle. */ 245 void paintBackground(QPainter *pPainter, const QRect &rectangle) const;245 void paintBackground(QPainter *pPainter, const QRect &rectangle); 246 246 /** Paints frame using specified @a pPainter and certain @a rectangle. */ 247 void paintFrame(QPainter *pPainter, const QRect &rectangle) const;247 void paintFrame(QPainter *pPainter, const QRect &rectangle); 248 248 /** Paints machine info using specified @a pPainter and certain @a rectangle. */ 249 void paintMachineInfo(QPainter *pPainter, const QRect &rectangle) const;249 void paintMachineInfo(QPainter *pPainter, const QRect &rectangle); 250 250 /** @} */ 251 251
Note:
See TracChangeset
for help on using the changeset viewer.