- Timestamp:
- Oct 8, 2018 4:30:31 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/details
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.cpp
r74686 r74690 105 105 { 106 106 /* Prepare variables: */ 107 const int iSpacing = data(GroupData_Spacing).toInt();108 107 const int iMaximumWidth = geometry().size().toSize().width(); 109 108 int iVerticalIndent = 0; … … 123 122 pItem->updateLayout(); 124 123 /* Advance indent: */ 125 iVerticalIndent += (pItem->minimumHeightHint() + iSpacing);124 iVerticalIndent += pItem->minimumHeightHint(); 126 125 } 127 126 } … … 153 152 { 154 153 /* Prepare variables: */ 155 const int iMargin = data(GroupData_Margin).toInt();156 const int iSpacing = data(GroupData_Spacing).toInt();157 154 int iMinimumHeightHint = 0; 158 155 bool fHasItems = false; … … 166 163 continue; 167 164 /* And take into account all the others: */ 168 iMinimumHeightHint += (pItem->minimumHeightHint() + iSpacing);165 iMinimumHeightHint += pItem->minimumHeightHint(); 169 166 if (!fHasItems) 170 167 fHasItems = true; 171 168 } 172 /* Minus last spacing: */173 if (fHasItems)174 iMinimumHeightHint -= iSpacing;175 176 /* Add two margins finally: */177 if (fHasItems)178 iMinimumHeightHint += 2 * iMargin;179 169 180 170 /* Return result: */ … … 293 283 } 294 284 295 QVariant UIDetailsGroup::data(int iKey) const296 {297 /* Provide other members with required data: */298 switch (iKey)299 {300 /* Layout hints: */301 case GroupData_Margin: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 6;302 case GroupData_Spacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 6;303 /* Default: */304 default: break;305 }306 return QVariant();307 }308 309 285 void UIDetailsGroup::paintBackground(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions) const 310 286 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.h
r74110 r74690 126 126 private: 127 127 128 /** Data field types. */129 enum GroupItemData130 {131 /* Layout hints: */132 GroupData_Margin,133 GroupData_Spacing134 };135 136 128 /** @name Prepare/cleanup cascade. 137 129 * @{ */ 138 130 /** Prepares connections. */ 139 131 void prepareConnections(); 140 /** @} */141 142 /** @name Item stuff.143 * @{ */144 /** Returns abstractly stored data value for certain @a iKey. */145 QVariant data(int iKey) const;146 132 /** @} */ 147 133
Note:
See TracChangeset
for help on using the changeset viewer.