Changeset 89102 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 17, 2021 3:04:49 PM (4 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/UIDetailsElement.cpp
r89101 r89102 218 218 m_pButton->setPos(iButtonX, iButtonY); 219 219 220 /* If closed: */ 221 if (isClosed()) 222 { 223 /* Hide text-pane if still visible: */ 224 if (m_pTextPane->isVisible()) 225 m_pTextPane->hide(); 226 } 227 /* If opened: */ 228 else 229 { 230 /* Layout text-pane: */ 231 int iTextPaneX = 2 * iMargin; 232 int iTextPaneY = iMargin + m_iMinimumHeaderHeight + 2 * iMargin; 233 m_pTextPane->setPos(iTextPaneX, iTextPaneY); 234 m_pTextPane->resize(size.width() - 4 * iMargin, 235 size.height() - 4 * iMargin - m_iMinimumHeaderHeight); 236 /* Show text-pane if still invisible and animation finished: */ 237 if (!m_pTextPane->isVisible() && !isAnimationRunning()) 238 m_pTextPane->show(); 239 } 220 /* If closed or animation running => hide: */ 221 if ((isClosed() || isAnimationRunning()) && m_pTextPane->isVisible()) 222 m_pTextPane->hide(); 223 /* If opened and animation isn't running => show: */ 224 else if (!isClosed() && !isAnimationRunning() && !m_pTextPane->isVisible()) 225 m_pTextPane->show(); 226 227 /* Layout text-pane: */ 228 int iTextPaneX = 2 * iMargin; 229 int iTextPaneY = iMargin + m_iMinimumHeaderHeight + 2 * iMargin; 230 m_pTextPane->setPos(iTextPaneX, iTextPaneY); 231 m_pTextPane->resize(size.width() - 4 * iMargin, 232 size.height() - 4 * iMargin - m_iMinimumHeaderHeight); 240 233 } 241 234 … … 444 437 445 438 /* Additional height during animation: */ 446 if (m_fAnimationRunning )439 if (m_fAnimationRunning && isClosed()) 447 440 iMinimumHeightHint += m_iAdditionalHeight; 448 441 … … 470 463 updateAnimationParameters(); 471 464 472 /* Invert toggle-state: */ 473 m_fClosed = !m_fClosed; 465 /* Invert toggle-state instantly only for closed elements. 466 * Opened element being closed should remain opened 467 * until animation is fully finished. */ 468 if (m_fClosed) 469 m_fClosed = !m_fClosed; 474 470 } 475 471 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElements.cpp
r89101 r89102 145 145 146 146 /* Show/hide preview: */ 147 if ( isClosed() && m_pPreview->isVisible())147 if ((isClosed() || isAnimationRunning()) && m_pPreview->isVisible()) 148 148 m_pPreview->hide(); 149 if ( isOpened() && !m_pPreview->isVisible() && !isAnimationRunning())149 if (!isClosed() && !isAnimationRunning() && !m_pPreview->isVisible()) 150 150 m_pPreview->show(); 151 151 152 /* And update preview layout itself: */152 /* Layout Preview: */ 153 153 const int iMargin = data(ElementData_Margin).toInt(); 154 154 m_pPreview->setPos(iMargin, 2 * iMargin + minimumHeaderHeight());
Note:
See TracChangeset
for help on using the changeset viewer.