Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp	(revision 45521)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp	(revision 45522)
@@ -20,4 +20,5 @@
 /* Qt includes: */
 #include <QVBoxLayout>
+#include <QLabel>
 #include <QPushButton>
 #include <QEvent>
@@ -32,5 +33,4 @@
 #include "UIPopupCenter.h"
 #include "UIModalWindowManager.h"
-#include "QIRichTextLabel.h"
 #include "QIDialogButtonBox.h"
 
@@ -255,11 +255,12 @@
     , m_fPolished(false)
     , m_strId(strId)
-    , m_iMainLayoutMargin(2), m_iMainFrameLayoutMargin(5), m_iMainFrameLayoutSpacing(5)
+    , m_iMainLayoutMargin(2), m_iMainFrameLayoutMargin(10), m_iMainFrameLayoutSpacing(5)
+    , m_iParentStatusBarHeight(parentStatusBarHeight(pParent))
     , m_strMessage(strMessage), m_strDetails(strDetails)
     , m_iButton1(iButton1), m_iButton2(iButton2), m_iButton3(iButton3)
     , m_strButtonText1(strButtonText1), m_strButtonText2(strButtonText2), m_strButtonText3(strButtonText3)
     , m_iButtonEsc(0)
-    , m_iParentStatusBarHeight(parentStatusBarHeight(pParent))
-    , m_pTextPane(0), m_pButtonBox(0)
+    , m_fHovered(false)
+    , m_pMainFrame(0), m_pTextPane(0), m_pButtonBox(0)
     , m_pButton1(0), m_pButton2(0), m_pButton3(0)
 {
@@ -272,4 +273,31 @@
     /* Cleanup: */
     cleanup();
+}
+
+void UIPopupPane::sltAdjustGeomerty()
+{
+    /* Get parent attributes: */
+    const int iWidth = parentWidget()->width();
+    const int iHeight = parentWidget()->height();
+
+    /* Adjust text-pane according parent width: */
+    if (m_pTextPane)
+    {
+        m_pTextPane->setDesiredWidth(iWidth - 2 * m_iMainLayoutMargin
+                                            - 2 * m_iMainFrameLayoutMargin
+                                            - m_pButtonBox->minimumSizeHint().width());
+    }
+
+    /* Resize popup according parent width: */
+    resize(iWidth, minimumSizeHint().height());
+
+    /* Move popup according parent: */
+    move(0, iHeight - height() - m_iParentStatusBarHeight);
+
+    /* Raise popup according parent: */
+    raise();
+
+    /* Update layout: */
+    updateLayout();
 }
 
@@ -288,15 +316,45 @@
 bool UIPopupPane::eventFilter(QObject *pWatched, QEvent *pEvent)
 {
-    /* Make sure its parent event came: */
-    if (pWatched != parent())
-        return false;
-
-    /* Make sure its resize event came: */
-    if (pEvent->type() != QEvent::Resize)
-        return false;
-
-    /* Adjust geometry: */
-    adjustAccordingParent();
-
+    /* If its parent event came: */
+    if (pWatched == parent())
+    {
+        /* Make sure its resize event came: */
+        if (pEvent->type() != QEvent::Resize)
+            return false;
+
+        /* Adjust geometry: */
+        sltAdjustGeomerty();
+    }
+    /* Other objects subscribed for hovering: */
+    else
+    {
+        /* Depending on event-type: */
+        switch (pEvent->type())
+        {
+            /* Something is hovered: */
+            case QEvent::HoverEnter:
+            case QEvent::Enter:
+            {
+                if (!m_fHovered)
+                {
+                    m_fHovered = true;
+                    emit sigHoverEnter();
+                }
+                break;
+            }
+            /* Nothing is hovered: */
+            case QEvent::Leave:
+            {
+                if (pWatched == this && m_fHovered)
+                {
+                    m_fHovered = false;
+                    emit sigHoverLeave();
+                }
+                break;
+            }
+            /* Default case: */
+            default: break;
+        }
+    }
     /* Do not filter anything: */
     return false;
@@ -319,5 +377,5 @@
 {
     /* Adjust geometry: */
-    adjustAccordingParent();
+    sltAdjustGeomerty();
 }
 
@@ -346,7 +404,7 @@
         {
             /* Take into account widgets: */
-            const int iTextPaneWidth = m_pTextPane->minimumSizeHint().width();
-            const int iButtonBoxWidth = m_pButtonBox->minimumSizeHint().width();
-            iMinimumWidthHint += qMax(iTextPaneWidth, iButtonBoxWidth);
+            iMinimumWidthHint += m_pTextPane->minimumSizeHint().width();
+            iMinimumWidthHint += m_iMainFrameLayoutSpacing;
+            iMinimumWidthHint += m_pButtonBox->minimumSizeHint().width();
         }
     }
@@ -368,7 +426,7 @@
         {
             /* Take into account widgets: */
-            iMinimumHeightHint += m_pTextPane->minimumSizeHint().height();
-            iMinimumHeightHint += m_iMainFrameLayoutSpacing;
-            iMinimumHeightHint += m_pButtonBox->minimumSizeHint().height();
+            const int iTextPaneHeight = m_pTextPane->minimumSizeHint().height();
+            const int iButtonBoxHeight = m_pButtonBox->minimumSizeHint().height();
+            iMinimumHeightHint += qMax(iTextPaneHeight, iButtonBoxHeight);
         }
     }
@@ -381,30 +439,4 @@
 {
     return QSize(minimumWidthHint(), minimumHeightHint());
-}
-
-void UIPopupPane::adjustAccordingParent()
-{
-    /* Get parent attributes: */
-    const int iWidth = parentWidget()->width();
-    const int iHeight = parentWidget()->height();
-
-    /* Adjust text-pane according parent width: */
-    if (m_pTextPane)
-    {
-        m_pTextPane->setMinimumTextWidth(iWidth - 2 * m_iMainLayoutMargin
-                                                - 2 * m_iMainFrameLayoutMargin);
-    }
-
-    /* Resize popup according parent width: */
-    resize(iWidth, minimumSizeHint().height());
-
-    /* Move popup according parent: */
-    move(0, iHeight - height() - m_iParentStatusBarHeight);
-
-    /* Raise popup according parent: */
-    raise();
-
-    /* Update layout: */
-    updateLayout();
 }
 
@@ -421,19 +453,19 @@
         m_pMainFrame->resize(iWidth - 2 * m_iMainLayoutMargin,
                              iHeight - 2 * m_iMainLayoutMargin);
-        const int iMainFrameWidth = m_pMainFrame->width();
+        const int iMainFrameHeight = m_pMainFrame->height();
         /* Main-frame layout: */
         {
             /* Text-pane: */
-            const int iTextPaneHeight = m_pTextPane->minimumSizeHint().height();
+            const int iTextPaneWidth = m_pTextPane->minimumSizeHint().width();
             m_pTextPane->move(m_iMainFrameLayoutMargin,
                               m_iMainFrameLayoutMargin);
-            m_pTextPane->resize(iMainFrameWidth - 2 * m_iMainFrameLayoutMargin,
-                                iTextPaneHeight);
+            m_pTextPane->resize(iTextPaneWidth,
+                                iMainFrameHeight - 2 * m_iMainFrameLayoutMargin);
             /* Button-box: */
-            const int iButtonBoxHeight = m_pButtonBox->minimumSizeHint().height();
-            m_pButtonBox->move(m_iMainFrameLayoutMargin,
-                               m_iMainFrameLayoutMargin + iTextPaneHeight + m_iMainFrameLayoutSpacing);
-            m_pButtonBox->resize(iMainFrameWidth - 2 * m_iMainFrameLayoutMargin,
-                                 iButtonBoxHeight);
+            const int iButtonBoxWidth = m_pButtonBox->minimumSizeHint().width();
+            m_pButtonBox->move(m_iMainFrameLayoutMargin + iTextPaneWidth + m_iMainFrameLayoutSpacing,
+                               m_iMainFrameLayoutMargin);
+            m_pButtonBox->resize(iButtonBoxWidth,
+                                 iMainFrameHeight - 2 * m_iMainFrameLayoutMargin);
         }
     }
@@ -443,4 +475,5 @@
 {
     /* Prepare this: */
+    installEventFilter(this);
     setFocusPolicy(Qt::StrongFocus);
     /* Create main-frame: */
@@ -448,13 +481,14 @@
     {
         /* Prepare frame: */
-        m_pMainFrame->installEventFilter(m_pMainFrame);
+        m_pMainFrame->installEventFilter(this);
         /* Create message-label: */
-        m_pTextPane = new QIRichTextLabel(m_pMainFrame);
+        m_pTextPane = new UIPopupPaneTextPane(m_pMainFrame);
         {
             /* Prepare label: */
+            connect(m_pTextPane, SIGNAL(sigGeometryChanged()),
+                    this, SLOT(sltAdjustGeomerty()));
+            m_pTextPane->installEventFilter(this);
             m_pTextPane->setFocusPolicy(Qt::StrongFocus);
-            m_pTextPane->installEventFilter(m_pMainFrame);
             m_pTextPane->setText(m_strMessage);
-            m_pTextPane->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
         }
         /* Create button-box: */
@@ -462,5 +496,6 @@
         {
             /* Prepare button-box: */
-            m_pButtonBox->installEventFilter(m_pMainFrame);
+            m_pButtonBox->installEventFilter(this);
+            m_pButtonBox->setOrientation(Qt::Vertical);
             prepareButtons();
         }
@@ -587,9 +622,8 @@
 UIPopupPaneFrame::UIPopupPaneFrame(QWidget *pParent /*= 0*/)
     : QWidget(pParent)
-    , m_fHovered(false)
+    , m_iHoverAnimationDuration(300)
     , m_iDefaultOpacity(128)
     , m_iHoveredOpacity(230)
     , m_iOpacity(m_iDefaultOpacity)
-    , m_iHoverAnimationDuration(300)
 {
     /* Prepare: */
@@ -606,4 +640,6 @@
 {
     /* Install 'hover' animation for 'opacity' property: */
+    connect(parent(), SIGNAL(sigHoverEnter()), this, SIGNAL(sigHoverEnter()));
+    connect(parent(), SIGNAL(sigHoverLeave()), this, SIGNAL(sigHoverLeave()));
     UIAnimationFramework::installPropertyAnimation(this, QByteArray("opacity"),
                                                    m_iDefaultOpacity, m_iHoveredOpacity, m_iHoverAnimationDuration,
@@ -613,37 +649,4 @@
 void UIPopupPaneFrame::cleanup()
 {
-}
-
-bool UIPopupPaneFrame::eventFilter(QObject *pObject, QEvent *pEvent)
-{
-    /* Depending on event-type: */
-    switch (pEvent->type())
-    {
-        /* Something is hovered: */
-        case QEvent::HoverEnter:
-        case QEvent::Enter:
-        {
-            if (!m_fHovered)
-            {
-                m_fHovered = true;
-                emit sigHoverEnter();
-            }
-            break;
-        }
-        /* Nothing is hovered: */
-        case QEvent::Leave:
-        {
-            if (pObject == this && m_fHovered)
-            {
-                m_fHovered = false;
-                emit sigHoverLeave();
-            }
-            break;
-        }
-        /* Default case: */
-        default: break;
-    }
-    /* Do not filter anything: */
-    return false;
 }
 
@@ -678,2 +681,96 @@
 }
 
+UIPopupPaneTextPane::UIPopupPaneTextPane(QWidget *pParent /*= 0*/)
+    : QWidget(pParent)
+    , m_pLabel(0)
+    , m_iDesiredWidth(-1)
+    , m_iHoverAnimationDuration(300)
+    , m_iDefaultPercentage(1)
+    , m_iHoveredPercentage(100)
+    , m_iPercentage(m_iDefaultPercentage)
+{
+    /* Prepare: */
+    prepare();
+}
+
+UIPopupPaneTextPane::~UIPopupPaneTextPane()
+{
+    /* Cleanup: */
+    cleanup();
+}
+
+void UIPopupPaneTextPane::setText(const QString &strText)
+{
+    /* Make sure the text is changed: */
+    if (m_pLabel->text() == strText)
+        return;
+    /* Update the pane for new text: */
+    m_pLabel->setText(strText);
+    updateGeometry();
+}
+
+void UIPopupPaneTextPane::setDesiredWidth(int iDesiredWidth)
+{
+    /* Make sure the desired-width is changed: */
+    if (m_iDesiredWidth == iDesiredWidth)
+        return;
+    /* Update the pane for new desired-width: */
+    m_iDesiredWidth = iDesiredWidth;
+    updateGeometry();
+}
+
+QSize UIPopupPaneTextPane::minimumSizeHint() const
+{
+    /* Check if desired-width set: */
+    if (m_iDesiredWidth >= 0)
+        /* Return dependent size-hint: */
+        return QSize(m_iDesiredWidth, (int)(((qreal)percentage() / 100) * m_pLabel->heightForWidth(m_iDesiredWidth)));
+    /* Return golden-rule size-hint by default: */
+    return m_pLabel->minimumSizeHint();
+}
+
+void UIPopupPaneTextPane::prepare()
+{
+    /* Install 'hover' animation for 'height' property: */
+    connect(parent(), SIGNAL(sigHoverEnter()), this, SIGNAL(sigHoverEnter()));
+    connect(parent(), SIGNAL(sigHoverLeave()), this, SIGNAL(sigHoverLeave()));
+    UIAnimationFramework::installPropertyAnimation(this, QByteArray("percentage"),
+                                                   m_iDefaultPercentage, m_iHoveredPercentage, m_iHoverAnimationDuration,
+                                                   SIGNAL(sigHoverEnter()), SIGNAL(sigHoverLeave()));
+    /* Prepare content: */
+    prepareContent();
+}
+
+void UIPopupPaneTextPane::cleanup()
+{
+}
+
+void UIPopupPaneTextPane::prepareContent()
+{
+    /* Create main layout: */
+    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
+    {
+        /* Prepare layout: */
+        pMainLayout->setContentsMargins(0, 0, 0, 0);
+        pMainLayout->setSpacing(0);
+        /* Create label: */
+        m_pLabel = new QLabel;
+        {
+            /* Add into layout: */
+            pMainLayout->addWidget(m_pLabel);
+            /* Prepare label: */
+            m_pLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
+            m_pLabel->setWordWrap(true);
+        }
+        /* Activate layout: */
+        updateGeometry();
+    }
+}
+
+void UIPopupPaneTextPane::setPercentage(int iPercentage)
+{
+    m_iPercentage = iPercentage;
+    updateGeometry();
+    emit sigGeometryChanged();
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h	(revision 45521)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h	(revision 45522)
@@ -31,8 +31,9 @@
 /* Forward declaration: */
 class QPushButton;
-class QIRichTextLabel;
+class QLabel;
 class QIDialogButtonBox;
 class UIPopupPane;
 class UIPopupPaneFrame;
+class UIPopupPaneTextPane;
 
 /* Global popup-center object: */
@@ -142,4 +143,8 @@
 signals:
 
+    /* Notifiers: Hover stuff: */
+    void sigHoverEnter();
+    void sigHoverLeave();
+
     /* Notifier: Complete stuff: */
     void sigDone(int iButtonCode) const;
@@ -164,4 +169,7 @@
     void done3() { done(m_iButton3 & AlertButtonMask); }
 
+    /* Handler: Layout stuff: */
+    void sltAdjustGeomerty();
+
 private:
 
@@ -182,5 +190,4 @@
     int minimumHeightHint() const;
     QSize minimumSizeHint() const;
-    void adjustAccordingParent();
     void updateLayout();
 
@@ -200,16 +207,25 @@
     bool m_fPolished;
     const QString m_strId;
-    int m_iMainLayoutMargin;
-    int m_iMainFrameLayoutMargin;
-    int m_iMainFrameLayoutSpacing;
+
+    /* Variables: Layout stuff: */
+    const int m_iMainLayoutMargin;
+    const int m_iMainFrameLayoutMargin;
+    const int m_iMainFrameLayoutSpacing;
+    const int m_iParentStatusBarHeight;
+
+    /* Variables: Text stuff: */
     QString m_strMessage, m_strDetails;
+
+    /* Variables: Button stuff: */
     int m_iButton1, m_iButton2, m_iButton3;
     QString m_strButtonText1, m_strButtonText2, m_strButtonText3;
     int m_iButtonEsc;
-    const int m_iParentStatusBarHeight;
+
+    /* Variables: Hover stuff: */
+    bool m_fHovered;
 
     /* Widgets: */
     UIPopupPaneFrame *m_pMainFrame;
-    QIRichTextLabel *m_pTextPane;
+    UIPopupPaneTextPane *m_pTextPane;
     QIDialogButtonBox *m_pButtonBox;
     QPushButton *m_pButton1, *m_pButton2, *m_pButton3;
@@ -224,5 +240,5 @@
 signals:
 
-    /* Notifiers: Hover-machine stuff: */
+    /* Notifiers: Hover stuff: */
     void sigHoverEnter();
     void sigHoverLeave();
@@ -241,18 +257,68 @@
 
     /* Handlers: Event stuff: */
-    bool eventFilter(QObject *pWatched, QEvent *pEvent);
     void paintEvent(QPaintEvent *pEvent);
 
-    /* Property: Hover-machine stuff: */
+    /* Property: Hover stuff: */
     int opacity() const { return m_iOpacity; }
     void setOpacity(int iOpacity) { m_iOpacity = iOpacity; update(); }
 
-    /* Hover-machine stuff: */
-    bool m_fHovered;
-    int m_iDefaultOpacity;
-    int m_iHoveredOpacity;
+    /* Variables: Hover stuff: */
+    const int m_iHoverAnimationDuration;
+    const int m_iDefaultOpacity;
+    const int m_iHoveredOpacity;
     int m_iOpacity;
-    int m_iHoverAnimationDuration;
 };
 
+/* Popup-pane text-pane prototype class: */
+class UIPopupPaneTextPane : public QWidget
+{
+    Q_OBJECT;
+    Q_PROPERTY(int percentage READ percentage WRITE setPercentage);
+
+signals:
+
+    /* Notifiers: Hover stuff: */
+    void sigHoverEnter();
+    void sigHoverLeave();
+    void sigGeometryChanged();
+
+public:
+
+    /* Constructor/destructor: */
+    UIPopupPaneTextPane(QWidget *pParent = 0);
+    ~UIPopupPaneTextPane();
+
+    /* API: Text stuff: */
+    void setText(const QString &strText);
+
+    /* API: Set desired width: */
+    void setDesiredWidth(int iDesiredWidth);
+
+    /* API: Minimum size-hint stuff: */
+    QSize minimumSizeHint() const;
+
+private:
+
+    /* Helpers: Prepare/cleanup stuff: */
+    void prepare();
+    void cleanup();
+
+    /* Helper: Content stuff: */
+    void prepareContent();
+
+    /* Property: Hover stuff: */
+    int percentage() const { return m_iPercentage; }
+    void setPercentage(int iPercentage);
+
+    /* Variables: Label stuff: */
+    QLabel *m_pLabel;
+    int m_iDesiredWidth;
+
+    /* Variables: Hover stuff: */
+    const int m_iHoverAnimationDuration;
+    const int m_iDefaultPercentage;
+    const int m_iHoveredPercentage;
+    int m_iPercentage;
+};
+
 #endif /* __UIPopupCenter_h__ */
