Changeset 68807 in vbox
- Timestamp:
- Sep 21, 2017 9:07:14 AM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/widgets
- Files:
-
- 3 edited
-
UIPopupPane.cpp (modified) (2 diffs)
-
UIPopupPaneDetails.cpp (modified) (6 diffs)
-
UIPopupPaneDetails.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPane.cpp
r68540 r68807 133 133 iTextPaneYOffset + iTextPaneHeight + m_iLayoutSpacing); 134 134 m_pDetailsPane->resize(iTextPaneWidth + iButtonPaneMinimumWidth, 135 m_pDetailsPane->minimumSizeHint().height() - m_iLayoutMargin);135 m_pDetailsPane->minimumSizeHint().height()); 136 136 m_pDetailsPane->layoutContent(); 137 137 } … … 196 196 /* Take into account layout: */ 197 197 iMinimumHeightHint += 2 * m_iLayoutMargin; 198 iMinimumHeightHint += m_iLayoutSpacing; 198 199 { 199 200 /* Take into account widgets: */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneDetails.cpp
r68540 r68807 33 33 UIPopupPaneDetails::UIPopupPaneDetails(QWidget *pParent, const QString &strText, bool fFocused) 34 34 : QWidget(pParent) 35 , m_iLayoutMargin( 0)35 , m_iLayoutMargin(5) 36 36 , m_iLayoutSpacing(10) 37 37 , m_strText(strText) 38 38 , m_pTextEdit(0) 39 39 , m_iDesiredTextEditWidth(-1) 40 , m_iDesiredTextEditHeight(-1) 40 , m_iMaximumPaneHeight(-1) 41 , m_iMaximumTextEditHeight(0) 42 , m_iTextContentMargin(5) 41 43 , m_fFocused(fFocused) 42 44 , m_pAnimation(0) … … 95 97 m_pTextEdit->move(m_iLayoutMargin, m_iLayoutMargin); 96 98 m_pTextEdit->resize(qMin(iWidth, iTextEditWidth), qMin(iHeight, iTextEditHeight)); 99 /* Text-document: */ 100 QTextDocument *pTextDocument = m_pTextEdit->document(); 101 if (pTextDocument) 102 { 103 pTextDocument->adjustSize(); 104 pTextDocument->setTextWidth(m_pTextEdit->width() - m_iTextContentMargin); 105 } 97 106 } 98 107 … … 121 130 { 122 131 /* Make sure the desired-height has changed: */ 123 if (m_i DesiredTextEditHeight == iHeight)132 if (m_iMaximumPaneHeight == iHeight) 124 133 return; 125 134 126 135 /* Fetch new desired-height: */ 127 m_iDesiredTextEditHeight = iHeight; 136 m_iMaximumPaneHeight = iHeight; 137 m_iMaximumTextEditHeight = m_iMaximumPaneHeight - 2 * m_iLayoutMargin; 128 138 129 139 /* Update size-hint: */ … … 184 194 m_pTextEdit->setText(m_strText); 185 195 m_pTextEdit->setFocusProxy(this); 186 m_pTextEdit->setLineWrapMode(QTextEdit::NoWrap);187 196 } 188 197 } … … 208 217 /* Recalculate expanded size-hint: */ 209 218 { 210 int iNewHeight = m_i DesiredTextEditHeight;219 int iNewHeight = m_iMaximumPaneHeight; 211 220 QTextDocument *pTextDocument = m_pTextEdit->document(); 212 221 if(pTextDocument) … … 217 226 QSize textSize = pTextDocument->size().toSize(); 218 227 /* Make sure the text edits height is no larger than that of container widget: */ 219 iNewHeight = qMin( iNewHeight, textSize.height());228 iNewHeight = qMin(m_iMaximumTextEditHeight, textSize.height() + 2 * m_iLayoutMargin); 220 229 } 221 230 /* Recalculate label size-hint: */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneDetails.h
r68540 r68807 96 96 QTextEdit *m_pTextEdit; 97 97 int m_iDesiredTextEditWidth; 98 int m_iDesiredTextEditHeight; 98 int m_iMaximumPaneHeight; 99 int m_iMaximumTextEditHeight; 100 int m_iTextContentMargin; 99 101 100 102 /* Variables: Focus stuff: */
Note:
See TracChangeset
for help on using the changeset viewer.

