VirtualBox

Ignore:
Timestamp:
Mar 26, 2018 2:32:57 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
121488
Message:

FE/Qt: bugref:9049: Full and heavy cleanup for UIPopupPane Message & Details.

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

Legend:

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

    r70474 r71515  
    55
    66/*
    7  * Copyright (C) 2013-2017 Oracle Corporation
     7 * Copyright (C) 2013-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2525
    2626/* GUI includes: */
     27# include "UIAnimationFramework.h"
    2728# include "UIPopupPaneDetails.h"
    28 # include "UIAnimationFramework.h"
    2929
    3030#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    106106}
    107107
    108 void UIPopupPaneDetails::updateVisibility()
    109 {
    110     if (m_fFocused && !m_strText.isEmpty())
    111         show();
    112     else
    113         hide();
    114 }
    115 
    116108void UIPopupPaneDetails::sltHandleProposalForWidth(int iWidth)
    117109{
     
    189181    /* Create text-editor: */
    190182    m_pTextEdit = new QTextEdit(this);
     183    if (m_pTextEdit)
    191184    {
    192185        /* Configure text-editor: */
     
    245238}
    246239
     240void UIPopupPaneDetails::updateVisibility()
     241{
     242    if (m_fFocused && !m_strText.isEmpty())
     243        show();
     244    else
     245        hide();
     246}
     247
    247248/* static */
    248249QFont UIPopupPaneDetails::tuneFont(QFont font)
     
    255256    return font;
    256257}
     258
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneDetails.h

    r69500 r71515  
    55
    66/*
    7  * Copyright (C) 2013-2017 Oracle Corporation
     7 * Copyright (C) 2013-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2626class UIAnimation;
    2727
    28 /* Popup-pane text-pane prototype class: */
     28/** QWidget extension providing GUI with popup-pane details-pane prototype class. */
    2929class UIPopupPaneDetails : public QWidget
    3030{
     
    3636signals:
    3737
    38     /* Notifiers: Parent propagation stuff: */
     38    /** Notifies about focus enter. */
    3939    void sigFocusEnter();
     40    /** Notifies about focus enter. */
    4041    void sigFocusLeave();
    4142
    42     /* Notifier: Layout stuff: */
     43    /** Notifies about size-hint change. */
    4344    void sigSizeHintChanged();
    4445
    4546public:
    4647
    47     /* Constructor: */
     48    /** Constructs details-pane passing @a pParent to the base-class.
     49      * @param  strText   Brings the details text.
     50      * @param  fFcoused  Brings whether the pane is focused. */
    4851    UIPopupPaneDetails(QWidget *pParent, const QString &strText, bool fFocused);
    4952
    50     /* API: Text stuff: */
     53    /** Defines the details @a strText. */
    5154    void setText(const QString &strText);
    5255
    53     /* API: Layout stuff: */
     56    /** Returns the details minimum size-hint. */
    5457    QSize minimumSizeHint() const;
     58    /** Defines the details @a minimumSizeHint. */
    5559    void setMinimumSizeHint(const QSize &minimumSizeHint);
     60    /** Lays the content out. */
    5661    void layoutContent();
    5762
    58     /* Property: Focus stuff: */
     63    /** Returns the collapsed size-hint. */
    5964    QSize collapsedSizeHint() const { return m_collapsedSizeHint; }
     65    /** Returns the expanded size-hint. */
    6066    QSize expandedSizeHint() const { return m_expandedSizeHint; }
    6167
    6268public slots:
    6369
    64     /* Handlers: Layout stuff: */
     70    /** Handles proposal for @a iWidth. */
    6571    void sltHandleProposalForWidth(int iWidth);
     72    /** Handles proposal for @a iHeight. */
    6673    void sltHandleProposalForHeight(int iHeight);
    6774
    68     /* Handlers: Focus stuff: */
     75    /** Handles focus enter. */
    6976    void sltFocusEnter();
     77    /** Handles focus leave. */
    7078    void sltFocusLeave();
    7179
    7280private:
    7381
    74     /* Helpers: Prepare stuff: */
     82    /** Prepares all. */
    7583    void prepare();
     84    /** Prepares content. */
    7685    void prepareContent();
     86    /** Prepares animations. */
    7787    void prepareAnimation();
    7888
    79     /* Helper: Layout stuff: */
     89    /** Updates size-hint. */
    8090    void updateSizeHint();
     91    /** Updates visibility. */
    8192    void updateVisibility();
    8293
    83     /* Static helper: Font stuff: */
     94    /** Adjusts @a font. */
    8495    static QFont tuneFont(QFont font);
    8596
    86     /* Variables: Layout stuff: */
     97    /** Holds the layout margin. */
    8798    const int m_iLayoutMargin;
     99    /** Holds the layout spacing. */
    88100    const int m_iLayoutSpacing;
     101
     102    /** Holds the text-editor size-hint. */
    89103    QSize m_textEditSizeHint;
     104    /** Holds the collapsed size-hint. */
    90105    QSize m_collapsedSizeHint;
     106    /** Holds the expanded size-hint. */
    91107    QSize m_expandedSizeHint;
     108    /** Holds the minimum size-hint. */
    92109    QSize m_minimumSizeHint;
    93110
    94     /* Variables: Widget stuff: */
     111    /** Holds the text. */
    95112    QString m_strText;
     113
     114    /** Holds the text-editor instance. */
    96115    QTextEdit *m_pTextEdit;
     116
     117    /** Holds the desired textr-editor width. */
    97118    int m_iDesiredTextEditWidth;
     119    /** Holds the maximum pane height. */
    98120    int m_iMaximumPaneHeight;
     121    /** Holds the desired textr-editor height. */
    99122    int m_iMaximumTextEditHeight;
     123    /** Holds the text content margin. */
    100124    int m_iTextContentMargin;
    101125
    102     /* Variables: Focus stuff: */
     126    /** Holds whether details-pane is focused. */
    103127    bool m_fFocused;
     128
     129    /** Holds the animation instance. */
    104130    UIAnimation *m_pAnimation;
    105131};
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneMessage.cpp

    r69500 r71515  
    55
    66/*
    7  * Copyright (C) 2013-2017 Oracle Corporation
     7 * Copyright (C) 2013-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2424
    2525/* GUI includes: */
     26# include "UIAnimationFramework.h"
    2627# include "UIPopupPaneMessage.h"
    27 # include "UIAnimationFramework.h"
    2828
    2929#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    148148    /* Create label: */
    149149    m_pLabel = new QLabel(this);
     150    if (m_pLabel)
    150151    {
    151152        /* Configure label: */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneMessage.h

    r69500 r71515  
    55
    66/*
    7  * Copyright (C) 2013-2017 Oracle Corporation
     7 * Copyright (C) 2013-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2626class UIAnimation;
    2727
    28 /* Popup-pane text-pane prototype class: */
     28/** QWidget extension providing GUI with popup-pane message-pane prototype class. */
    2929class UIPopupPaneMessage : public QWidget
    3030{
     
    3636signals:
    3737
    38     /* Notifiers: Parent propagation stuff: */
     38    /** Notifies about focus enter. */
    3939    void sigFocusEnter();
     40    /** Notifies about focus enter. */
    4041    void sigFocusLeave();
    4142
    42     /* Notifier: Layout stuff: */
     43    /** Notifies about size-hint change. */
    4344    void sigSizeHintChanged();
    4445
    4546public:
    4647
    47     /* Constructor: */
     48    /** Constructs message-pane passing @a pParent to the base-class.
     49      * @param  strText   Brings the message text.
     50      * @param  fFcoused  Brings whether the pane is focused. */
    4851    UIPopupPaneMessage(QWidget *pParent, const QString &strText, bool fFocused);
    4952
    50     /* API: Text stuff: */
     53    /** Defines the message @a strText. */
    5154    void setText(const QString &strText);
    5255
    53     /* API: Layout stuff: */
     56    /** Returns the message minimum size-hint. */
    5457    QSize minimumSizeHint() const;
     58    /** Defines the message @a minimumSizeHint. */
    5559    void setMinimumSizeHint(const QSize &minimumSizeHint);
     60    /** Lays the content out. */
    5661    void layoutContent();
    5762
    58     /* Property: Focus stuff: */
     63    /** Returns the collapsed size-hint. */
    5964    QSize collapsedSizeHint() const { return m_collapsedSizeHint; }
     65    /** Returns the expanded size-hint. */
    6066    QSize expandedSizeHint() const { return m_expandedSizeHint; }
    6167
    6268private slots:
    6369
    64     /* Handler: Layout stuff: */
     70    /** Handles proposal for @a iWidth. */
    6571    void sltHandleProposalForWidth(int iWidth);
    6672
    67     /* Handlers: Focus stuff: */
     73    /** Handles focus enter. */
    6874    void sltFocusEnter();
     75    /** Handles focus leave. */
    6976    void sltFocusLeave();
    7077
    7178private:
    7279
    73     /* Helpers: Prepare stuff: */
     80    /** Prepares all. */
    7481    void prepare();
     82    /** Prepares content. */
    7583    void prepareContent();
     84    /** Prepares animations. */
    7685    void prepareAnimation();
    7786
    78     /* Helper: Layout stuff: */
     87    /** Updates size-hint. */
    7988    void updateSizeHint();
    8089
    81     /* Static helper: Font stuff: */
     90    /** Adjusts @a font. */
    8291    static QFont tuneFont(QFont font);
    8392
    84     /* Variables: Layout stuff: */
     93    /** Holds the layout margin. */
    8594    const int m_iLayoutMargin;
     95    /** Holds the layout spacing. */
    8696    const int m_iLayoutSpacing;
     97
     98    /** Holds the label size-hint. */
    8799    QSize m_labelSizeHint;
     100    /** Holds the collapsed size-hint. */
    88101    QSize m_collapsedSizeHint;
     102    /** Holds the expanded size-hint. */
    89103    QSize m_expandedSizeHint;
     104    /** Holds the minimum size-hint. */
    90105    QSize m_minimumSizeHint;
    91106
    92     /* Variables: Widget stuff: */
     107    /** Holds the text. */
    93108    QString m_strText;
     109
     110    /** Holds the label instance. */
    94111    QLabel *m_pLabel;
     112
     113    /** Holds the desired label width. */
    95114    int m_iDesiredLabelWidth;
    96115
    97     /* Variables: Focus stuff: */
     116    /** Holds whether message-pane is focused. */
    98117    bool m_fFocused;
     118
     119    /** Holds the animation instance. */
    99120    UIAnimation *m_pAnimation;
    100121};
Note: See TracChangeset for help on using the changeset viewer.

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