Index: trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStateIndicator.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStateIndicator.cpp	(revision 51289)
+++ trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStateIndicator.cpp	(revision 51293)
@@ -21,4 +21,5 @@
 
 /* Qt includes */
+#include <QIcon>
 #include <QPainter>
 #ifdef Q_WS_MAC
@@ -44,29 +45,24 @@
 }
 
-QPixmap QIStateIndicator::stateIcon (int aState) const
+QPixmap QIStateIndicator::stateIcon(int state) const
 {
-    Icon *icon = mStateIcons [aState];
-    return icon ? icon->pixmap : QPixmap();
+    /* Check if state-icon was set before: */
+    Icon *pIcon = mStateIcons[state];
+    return pIcon ? pIcon->pixmap : QPixmap();
 }
 
-/**
- *  Sets an icon for the specified state. The first icon set by this method
- *  defines the preferred size of this indicator. All other icons will be
- *  scaled to fit this size.
- *
- *  @note If this widget is constructed with the WNoAutoErase flag, then all
- *  transparent areas of the new state icon are filled with the widget
- *  background color or pixmap (as taken from the widget palette), to provide
- *  flicker free state redraws in one single operation (which is useful for
- *  indicators that frequently change their state).
- */
-void QIStateIndicator::setStateIcon (int aState, const QPixmap &aPixmap)
+void QIStateIndicator::setStateIcon(int state, const QIcon &icon)
 {
-    /* Here we just set the original pixmap. All actual work from the @note
-     * above takes place in #drawContents(). */
-    mStateIcons.insert (aState, new Icon (aPixmap));
+    /* Get minimum size: */
+    QSize size = icon.availableSizes().first();
 
-    if (mSize.isNull())
-        mSize = aPixmap.size();
+    /* Get pixmap of size above: */
+    QPixmap pixmap = icon.pixmap(size);
+
+    /* Assign that pixmap to state-pixmap: */
+    mStateIcons.insert(state, new Icon(pixmap));
+
+    /* Adjust minimum size-hint: */
+    mSize = mSize.expandedTo(size);
 }
 
@@ -87,5 +83,5 @@
     Icon *icon = mStateIcons [mState];
     if (icon)
-        aPainter->drawPixmap (contentsRect(), icon->pixmap);
+        aPainter->drawPixmap(contentsRect().topLeft(), icon->pixmap);
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStateIndicator.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStateIndicator.h	(revision 51289)
+++ trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStateIndicator.h	(revision 51293)
@@ -40,6 +40,8 @@
     int state () const { return mState; }
 
-    QPixmap stateIcon (int aState) const;
-    void setStateIcon (int aState, const QPixmap &aPixmap);
+    /** Returns state-icon for passed @a state. */
+    QPixmap stateIcon(int state) const;
+    /** Defines state-icon for passed @a state as @a icon. */
+    void setStateIcon(int state, const QIcon &icon);
 
     virtual void updateAppearance() {}
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp	(revision 51289)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp	(revision 51293)
@@ -30,4 +30,5 @@
 #include "UIAnimationFramework.h"
 #include "UIMedium.h"
+#include "UIIconPool.h"
 
 /* COM includes: */
@@ -58,8 +59,8 @@
       : m_session(session)
     {
-        setStateIcon(KDeviceActivity_Idle, QPixmap(":/hd_16px.png"));
-        setStateIcon(KDeviceActivity_Reading, QPixmap(":/hd_read_16px.png"));
-        setStateIcon(KDeviceActivity_Writing, QPixmap(":/hd_write_16px.png"));
-        setStateIcon(KDeviceActivity_Null, QPixmap(":/hd_disabled_16px.png"));
+        setStateIcon(KDeviceActivity_Idle,    UIIconPool::iconSet(":/hd_16px.png"));
+        setStateIcon(KDeviceActivity_Reading, UIIconPool::iconSet(":/hd_read_16px.png"));
+        setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/hd_write_16px.png"));
+        setStateIcon(KDeviceActivity_Null,    UIIconPool::iconSet(":/hd_disabled_16px.png"));
 
         retranslateUi();
@@ -124,8 +125,8 @@
       : m_session(session)
     {
-        setStateIcon(KDeviceActivity_Idle, QPixmap(":/cd_16px.png"));
-        setStateIcon(KDeviceActivity_Reading, QPixmap(":/cd_read_16px.png"));
-        setStateIcon(KDeviceActivity_Writing, QPixmap(":/cd_write_16px.png"));
-        setStateIcon(KDeviceActivity_Null, QPixmap(":/cd_disabled_16px.png"));
+        setStateIcon(KDeviceActivity_Idle,    UIIconPool::iconSet(":/cd_16px.png"));
+        setStateIcon(KDeviceActivity_Reading, UIIconPool::iconSet(":/cd_read_16px.png"));
+        setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/cd_write_16px.png"));
+        setStateIcon(KDeviceActivity_Null,    UIIconPool::iconSet(":/cd_disabled_16px.png"));
 
         retranslateUi();
@@ -194,8 +195,8 @@
       : m_session(session)
     {
-        setStateIcon(KDeviceActivity_Idle, QPixmap(":/fd_16px.png"));
-        setStateIcon(KDeviceActivity_Reading, QPixmap(":/fd_read_16px.png"));
-        setStateIcon(KDeviceActivity_Writing, QPixmap(":/fd_write_16px.png"));
-        setStateIcon(KDeviceActivity_Null, QPixmap(":/fd_disabled_16px.png"));
+        setStateIcon(KDeviceActivity_Idle,    UIIconPool::iconSet(":/fd_16px.png"));
+        setStateIcon(KDeviceActivity_Reading, UIIconPool::iconSet(":/fd_read_16px.png"));
+        setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/fd_write_16px.png"));
+        setStateIcon(KDeviceActivity_Null,    UIIconPool::iconSet(":/fd_disabled_16px.png"));
 
         retranslateUi();
@@ -265,8 +266,8 @@
       , m_pUpdateTimer(new QTimer(this))
     {
-        setStateIcon(KDeviceActivity_Idle, QPixmap(":/nw_16px.png"));
-        setStateIcon(KDeviceActivity_Reading, QPixmap(":/nw_read_16px.png"));
-        setStateIcon(KDeviceActivity_Writing, QPixmap(":/nw_write_16px.png"));
-        setStateIcon(KDeviceActivity_Null, QPixmap(":/nw_disabled_16px.png"));
+        setStateIcon(KDeviceActivity_Idle,    UIIconPool::iconSet(":/nw_16px.png"));
+        setStateIcon(KDeviceActivity_Reading, UIIconPool::iconSet(":/nw_read_16px.png"));
+        setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/nw_write_16px.png"));
+        setStateIcon(KDeviceActivity_Null,    UIIconPool::iconSet(":/nw_disabled_16px.png"));
 
         connect(m_pUpdateTimer, SIGNAL(timeout()), SLOT(sltUpdateNetworkIPs()));
@@ -370,8 +371,8 @@
       : m_session(session)
     {
-        setStateIcon(KDeviceActivity_Idle, QPixmap(":/usb_16px.png"));
-        setStateIcon(KDeviceActivity_Reading, QPixmap(":/usb_read_16px.png"));
-        setStateIcon(KDeviceActivity_Writing, QPixmap(":/usb_write_16px.png"));
-        setStateIcon(KDeviceActivity_Null, QPixmap(":/usb_disabled_16px.png"));
+        setStateIcon(KDeviceActivity_Idle,    UIIconPool::iconSet(":/usb_16px.png"));
+        setStateIcon(KDeviceActivity_Reading, UIIconPool::iconSet(":/usb_read_16px.png"));
+        setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/usb_write_16px.png"));
+        setStateIcon(KDeviceActivity_Null,    UIIconPool::iconSet(":/usb_disabled_16px.png"));
 
         retranslateUi();
@@ -435,8 +436,8 @@
       : m_session(session)
     {
-        setStateIcon(KDeviceActivity_Idle, QPixmap(":/sf_16px.png"));
-        setStateIcon(KDeviceActivity_Reading, QPixmap(":/sf_read_16px.png"));
-        setStateIcon(KDeviceActivity_Writing, QPixmap(":/sf_write_16px.png"));
-        setStateIcon(KDeviceActivity_Null, QPixmap(":/sf_disabled_16px.png"));
+        setStateIcon(KDeviceActivity_Idle,    UIIconPool::iconSet(":/sf_16px.png"));
+        setStateIcon(KDeviceActivity_Reading, UIIconPool::iconSet(":/sf_read_16px.png"));
+        setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/sf_write_16px.png"));
+        setStateIcon(KDeviceActivity_Null,    UIIconPool::iconSet(":/sf_disabled_16px.png"));
 
         retranslateUi();
@@ -524,6 +525,6 @@
     {
         /* Assign state icons: */
-        setStateIcon(UIIndicatorStateVideoCapture_Disabled, QPixmap(":/video_capture_16px.png"));
-        setStateIcon(UIIndicatorStateVideoCapture_Enabled, QPixmap(":/movie_reel_16px.png"));
+        setStateIcon(UIIndicatorStateVideoCapture_Disabled, UIIconPool::iconSet(":/video_capture_16px.png"));
+        setStateIcon(UIIndicatorStateVideoCapture_Enabled,  UIIconPool::iconSet(":/movie_reel_16px.png"));
 
         /* Prepare *enabled* state animation: */
@@ -641,6 +642,6 @@
       : m_session(session)
     {
-        setStateIcon(0, QPixmap(":/vtx_amdv_disabled_16px.png"));
-        setStateIcon(1, QPixmap(":/vtx_amdv_16px.png"));
+        setStateIcon(0, UIIconPool::iconSet(":/vtx_amdv_disabled_16px.png"));
+        setStateIcon(1, UIIconPool::iconSet(":/vtx_amdv_16px.png"));
 
         retranslateUi();
@@ -715,9 +716,9 @@
       : m_session(session)
     {
-        setStateIcon(0, QPixmap(":/mouse_disabled_16px.png"));
-        setStateIcon(1, QPixmap(":/mouse_16px.png"));
-        setStateIcon(2, QPixmap(":/mouse_seamless_16px.png"));
-        setStateIcon(3, QPixmap(":/mouse_can_seamless_16px.png"));
-        setStateIcon(4, QPixmap(":/mouse_can_seamless_uncaptured_16px.png"));
+        setStateIcon(0, UIIconPool::iconSet(":/mouse_disabled_16px.png"));
+        setStateIcon(1, UIIconPool::iconSet(":/mouse_16px.png"));
+        setStateIcon(2, UIIconPool::iconSet(":/mouse_seamless_16px.png"));
+        setStateIcon(3, UIIconPool::iconSet(":/mouse_can_seamless_16px.png"));
+        setStateIcon(4, UIIconPool::iconSet(":/mouse_can_seamless_uncaptured_16px.png"));
 
         retranslateUi();
@@ -766,8 +767,8 @@
       : m_session(session)
     {
-        setStateIcon(0, QPixmap(":/hostkey_16px.png"));
-        setStateIcon(1, QPixmap(":/hostkey_captured_16px.png"));
-        setStateIcon(2, QPixmap(":/hostkey_pressed_16px.png"));
-        setStateIcon(3, QPixmap(":/hostkey_captured_pressed_16px.png"));
+        setStateIcon(0, UIIconPool::iconSet(":/hostkey_16px.png"));
+        setStateIcon(1, UIIconPool::iconSet(":/hostkey_captured_16px.png"));
+        setStateIcon(2, UIIconPool::iconSet(":/hostkey_pressed_16px.png"));
+        setStateIcon(3, UIIconPool::iconSet(":/hostkey_captured_pressed_16px.png"));
 
         retranslateUi();
