VirtualBox

Changeset 89102 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
May 17, 2021 3:04:49 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10003: Reworking Details pane; More strict logic for opened/closed element state flag and forward/backward animation.

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  
    218218    m_pButton->setPos(iButtonX, iButtonY);
    219219
    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);
    240233}
    241234
     
    444437
    445438    /* Additional height during animation: */
    446     if (m_fAnimationRunning)
     439    if (m_fAnimationRunning && isClosed())
    447440        iMinimumHeightHint += m_iAdditionalHeight;
    448441
     
    470463    updateAnimationParameters();
    471464
    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;
    474470}
    475471
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElements.cpp

    r89101 r89102  
    145145
    146146    /* Show/hide preview: */
    147     if (isClosed() && m_pPreview->isVisible())
     147    if ((isClosed() || isAnimationRunning()) && m_pPreview->isVisible())
    148148        m_pPreview->hide();
    149     if (isOpened() && !m_pPreview->isVisible() && !isAnimationRunning())
     149    if (!isClosed() && !isAnimationRunning() && !m_pPreview->isVisible())
    150150        m_pPreview->show();
    151151
    152     /* And update preview layout itself: */
     152    /* Layout Preview: */
    153153    const int iMargin = data(ElementData_Margin).toInt();
    154154    m_pPreview->setPos(iMargin, 2 * iMargin + minimumHeaderHeight());
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette