VirtualBox

Changeset 47694 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 13, 2013 1:12:05 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: Popup-center: Popup-pane: Support for initially focused pane.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/widgets
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPane.cpp

    r47634 r47694  
    4040    , m_fShown(false)
    4141    , m_pShowAnimation(0)
    42     , m_fHovered(false)
     42    , m_fCanLooseFocus(!m_buttonDescriptions.isEmpty())
     43    , m_fFocused(!m_fCanLooseFocus)
     44    , m_fHovered(m_fFocused)
    4345    , m_iDefaultOpacity(180)
    4446    , m_iHoveredOpacity(250)
    45     , m_iOpacity(m_iDefaultOpacity)
    46     , m_fFocused(false)
     47    , m_iOpacity(m_fHovered ? m_iHoveredOpacity : m_iDefaultOpacity)
    4748    , m_pTextPane(0), m_pButtonPane(0)
    4849{
     
    227228{
    228229    /* Create message-label: */
    229     m_pTextPane = new UIPopupPaneTextPane(this, m_strMessage, m_fProposeAutoConfirmation);
     230    m_pTextPane = new UIPopupPaneTextPane(this, m_strMessage, m_fProposeAutoConfirmation, m_fFocused);
    230231    {
    231232        /* Prepare label: */
     
    265266    /* Install 'hover' animation for 'opacity' property: */
    266267    UIAnimation::installPropertyAnimation(this, "opacity", "defaultOpacity", "hoveredOpacity",
    267                                           SIGNAL(sigHoverEnter()), SIGNAL(sigHoverLeave()));
     268                                          SIGNAL(sigHoverEnter()), SIGNAL(sigHoverLeave()), m_fHovered);
    268269}
    269270
     
    340341        {
    341342            /* Unhocus pane if focused: */
    342             if (m_fFocused)
     343            if (m_fCanLooseFocus && m_fFocused)
    343344            {
    344345                m_fFocused = false;
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPane.h

    r47633 r47694  
    161161    QSize m_shownSizeHint;
    162162
     163    /* Variables: Focus stuff: */
     164    bool m_fCanLooseFocus;
     165    bool m_fFocused;
     166
    163167    /* Variables: Hover stuff: */
    164168    bool m_fHovered;
     
    166170    const int m_iHoveredOpacity;
    167171    int m_iOpacity;
    168 
    169     /* Variables: Focus stuff: */
    170     bool m_fFocused;
    171172
    172173    /* Widgets: */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneTextPane.cpp

    r47455 r47694  
    2626#include "UIAnimationFramework.h"
    2727
    28 UIPopupPaneTextPane::UIPopupPaneTextPane(QWidget *pParent, const QString &strText, bool fProposeAutoConfirmation)
     28UIPopupPaneTextPane::UIPopupPaneTextPane(QWidget *pParent, const QString &strText,
     29                                         bool fProposeAutoConfirmation, bool fFocused)
    2930    : QIWithRetranslateUI<QWidget>(pParent)
    3031    , m_iLayoutMargin(0)
     
    3536    , m_pAutoConfirmCheckBox(0)
    3637    , m_fProposeAutoConfirmation(fProposeAutoConfirmation)
    37     , m_fFocused(false)
     38    , m_fFocused(fFocused)
    3839    , m_pAnimation(0)
    3940{
     
    219220    /* Install geometry animation for 'minimumSizeHint' property: */
    220221    m_pAnimation = UIAnimation::installPropertyAnimation(this, "minimumSizeHint", "collapsedSizeHint", "expandedSizeHint",
    221                                                          SIGNAL(sigFocusEnter()), SIGNAL(sigFocusLeave()));
     222                                                         SIGNAL(sigFocusEnter()), SIGNAL(sigFocusLeave()), m_fFocused);
    222223}
    223224
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneTextPane.h

    r47455 r47694  
    5151
    5252    /* Constructor: */
    53     UIPopupPaneTextPane(QWidget *pParent, const QString &strText, bool fProposeAutoConfirmation);
     53    UIPopupPaneTextPane(QWidget *pParent, const QString &strText,
     54                        bool fProposeAutoConfirmation, bool fFocused);
    5455
    5556    /* API: Text stuff: */
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