VirtualBox

Ignore:
Timestamp:
Oct 29, 2015 2:28:05 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Mac OS X: Runtime UI: Wipe out dock state overlay code for now.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UIAbstractDockIconPreview.cpp

    r58382 r58489  
    7474    m_overlayImage   = ::darwinToCGImageRef(&overlayImage);
    7575    Assert(m_overlayImage);
    76 
    77     /* Determine desired icon size for the state-overlay: */
    78     const QStyle *pStyle = QApplication::style();
    79     const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize);
    80     const QSize iconSize = QSize(iIconMetric, iIconMetric);
    81 
    82     /* Prepare 'Paused' state-overlay: */
    83     const QPixmap statePaused = gpConverter->toIcon(KMachineState_Paused).pixmap(iconSize);
    84     m_statePaused = ::darwinToCGImageRef(&statePaused);
    85     Assert(m_statePaused);
    86 
    87     /* Prepare 'Saving' state-overlay: */
    88     const QPixmap stateSaving = gpConverter->toIcon(KMachineState_Saving).pixmap(iconSize);
    89     m_stateSaving = ::darwinToCGImageRef(&stateSaving);
    90     Assert(m_stateSaving);
    91 
    92     /* Prepare 'Restoring' state-overlay: */
    93     const QPixmap stateRestoring = gpConverter->toIcon(KMachineState_Restoring).pixmap(iconSize);
    94     m_stateRestoring = ::darwinToCGImageRef(&stateRestoring);
    95     Assert(m_stateRestoring);
    9676}
    9777
     
    11393    if (m_dockMonitorGlossy)
    11494        CGImageRelease(m_dockMonitorGlossy);
    115 
    116     CGImageRelease(m_statePaused);
    117     CGImageRelease(m_stateSaving);
    118     CGImageRelease(m_stateRestoring);
    11995}
    12096
     
    143119}
    144120
    145 CGImageRef UIAbstractDockIconPreviewHelper::stateImage() const
    146 {
    147     CGImageRef img;
    148     if (   m_pSession->machineState() == KMachineState_Paused
    149         || m_pSession->machineState() == KMachineState_TeleportingPausedVM)
    150         img = m_statePaused;
    151     else if (   m_pSession->machineState() == KMachineState_Restoring
    152              || m_pSession->machineState() == KMachineState_TeleportingIn)
    153         img = m_stateRestoring;
    154     else if (   m_pSession->machineState() == KMachineState_Saving
    155              || m_pSession->machineState() == KMachineState_LiveSnapshotting)
    156         img = m_stateSaving;
    157     else
    158         img = NULL;
    159     return img;
    160 }
    161 
    162121void UIAbstractDockIconPreviewHelper::drawOverlayIcons(CGContextRef context)
    163122{
     
    177136            CGContextDrawImage(context, flipRect(overlayRect), m_overlayImage);
    178137        }
    179 
    180         /* Determine correct state-overlay image: */
    181         CGImageRef sImage = stateImage();
    182         /* Make sure state-overlay image is valid: */
    183         if (sImage)
    184         {
    185             /* Draw state overlay image at top-left of guest-os overlay image: */
    186             CGRect stateRect = CGRectMake(overlayRect.origin.x - CGImageGetWidth(sImage) / 2.0,
    187                                           overlayRect.origin.y - CGImageGetHeight(sImage) / 2.0,
    188                                           CGImageGetWidth(sImage),
    189                                           CGImageGetHeight(sImage));
    190             CGContextDrawImage(context, flipRect(stateRect), sImage);
    191         }
    192138    }
    193139}
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UIAbstractDockIconPreview.h

    r52727 r58489  
    4949    virtual ~UIAbstractDockIconPreviewHelper();
    5050    void initPreviewImages();
    51     inline CGImageRef stateImage() const;
    5251    void drawOverlayIcons(CGContextRef context);
    5352
     
    6766    CGImageRef m_dockMonitorGlossy;
    6867
    69     CGImageRef m_statePaused;
    70     CGImageRef m_stateSaving;
    71     CGImageRef m_stateRestoring;
    72 
    7368    CGRect m_updateRect;
    7469    CGRect m_monitorRect;
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