Changeset 58382 in vbox
- Timestamp:
- Oct 22, 2015 5:18:37 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r57508 r58382 136 136 const char* UIExtraDataDefs::GUI_RealtimeDockIconUpdateEnabled = "GUI/RealtimeDockIconUpdateEnabled"; 137 137 const char* UIExtraDataDefs::GUI_RealtimeDockIconUpdateMonitor = "GUI/RealtimeDockIconUpdateMonitor"; 138 const char* UIExtraDataDefs::GUI_DockIconOverlayEnabled = "GUI/DockIconOverlayEnabled"; 138 139 #endif /* Q_WS_MAC */ 139 140 const char* UIExtraDataDefs::GUI_PassCAD = "GUI/PassCAD"; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r57508 r58382 235 235 /** Mac OS X: Holds guest-screen which Dock icon should reflect at runtime. */ 236 236 extern const char* GUI_RealtimeDockIconUpdateMonitor; 237 /** Mac OS X: Holds whether Dock icon should have guest-os overlay. */ 238 extern const char* GUI_DockIconOverlayEnabled; 237 239 #endif /* Q_WS_MAC */ 238 240 /** Holds whether machine should pass CAD to guest. */ -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r58377 r58382 1874 1874 << GUI_StatusBar_Enabled << GUI_RestrictedStatusBarIndicators << GUI_StatusBar_IndicatorOrder 1875 1875 #ifdef Q_WS_MAC 1876 << GUI_RealtimeDockIconUpdateEnabled << GUI_RealtimeDockIconUpdateMonitor 1876 << GUI_RealtimeDockIconUpdateEnabled << GUI_RealtimeDockIconUpdateMonitor << GUI_DockIconOverlayEnabled 1877 1877 #endif /* Q_WS_MAC */ 1878 1878 << GUI_PassCAD … … 3430 3430 setExtraDataString(GUI_RealtimeDockIconUpdateMonitor, iIndex ? QString::number(iIndex) : QString(), strID); 3431 3431 } 3432 3433 bool UIExtraDataManager::dockIconOverlayEnabled(const QString &strID) 3434 { 3435 /* 'True' unless feature restricted: */ 3436 return !isFeatureRestricted(GUI_DockIconOverlayEnabled, strID); 3437 } 3438 3439 void UIExtraDataManager::setdockIconOverlayEnabled(bool fEnabled, const QString &strID) 3440 { 3441 /* 'False' if feature restricted, 'True' otherwise: */ 3442 setExtraDataString(GUI_DockIconOverlayEnabled, toFeatureRestricted(!fEnabled), strID); 3443 } 3432 3444 #endif /* Q_WS_MAC */ 3433 3445 … … 3810 3822 #ifdef Q_WS_MAC 3811 3823 /* 'Dock icon' appearance changed (allowed if not restricted)? */ 3812 else if ( strKey == GUI_RealtimeDockIconUpdateEnabled3813 ||strKey == GUI_RealtimeDockIconUpdateMonitor)3824 else if (strKey == GUI_RealtimeDockIconUpdateEnabled || 3825 strKey == GUI_RealtimeDockIconUpdateMonitor) 3814 3826 emit sigDockIconAppearanceChange(!isFeatureRestricted(strKey, strMachineID)); 3827 /* 'Dock icon overlay' appearance changed (allowed if not restricted)? */ 3828 else if (strKey == GUI_DockIconOverlayEnabled) 3829 emit sigDockIconOverlayAppearanceChange(!isFeatureRestricted(strKey, strMachineID)); 3815 3830 #endif /* Q_WS_MAC */ 3816 3831 } -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r57508 r58382 92 92 /** Mac OS X: Notifies about 'dock icon' appearance change. */ 93 93 void sigDockIconAppearanceChange(bool fEnabled); 94 /** Mac OS X: Notifies about 'dock icon overlay' appearance change. */ 95 void sigDockIconOverlayAppearanceChange(bool fEnabled); 94 96 #endif /* RT_OS_DARWIN */ 95 97 … … 460 462 /** Mac OS X: Defines guest-screen @a iIndex which Dock icon should reflect at runtime. */ 461 463 void setRealtimeDockIconUpdateMonitor(int iIndex, const QString &strID); 464 465 /** Mac OS X: Returns whether Dock icon overlay is enabled. */ 466 bool dockIconOverlayEnabled(const QString &strID); 467 /** Mac OS X: Defines whether Dock icon overlay @a fEnabled. */ 468 void setdockIconOverlayEnabled(bool fEnabled, const QString &strID); 462 469 #endif /* Q_WS_MAC */ 463 470 -
trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UIAbstractDockIconPreview.cpp
r58343 r58382 5 5 6 6 /* 7 * Copyright (C) 2009-201 0Oracle Corporation7 * Copyright (C) 2009-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 25 25 /* GUI includes: */ 26 26 # include "UIAbstractDockIconPreview.h" 27 # include "UIConverter.h" 28 # include "UIExtraDataManager.h" 27 29 # include "UIFrameBuffer.h" 28 30 # include "UIMachineLogic.h" 29 31 # include "UIMachineView.h" 30 # include "UIConverter.h"31 32 # include "UISession.h" 33 # include "VBoxGlobal.h" 32 34 33 35 /* COM includes: */ … … 160 162 void UIAbstractDockIconPreviewHelper::drawOverlayIcons(CGContextRef context) 161 163 { 162 CGRect overlayRect = CGRectMake(0, 0, 0, 0); 163 /* The overlay image at bottom/right */ 164 if (m_overlayImage) 164 /* Determine whether dock icon overlay enabled: */ 165 if (gEDataManager->dockIconOverlayEnabled(vboxGlobal().managedVMUuid())) 165 166 { 166 overlayRect = CGRectMake(m_dockIconRect.size.width - CGImageGetWidth(m_overlayImage), 167 m_dockIconRect.size.height - CGImageGetHeight(m_overlayImage), 168 CGImageGetWidth(m_overlayImage), 169 CGImageGetHeight(m_overlayImage)); 170 CGContextDrawImage(context, flipRect(overlayRect), m_overlayImage); 171 } 172 CGImageRef sImage = stateImage(); 173 /* The state image at bottom/right */ 174 if (sImage) 175 { 176 CGRect stateRect = CGRectMake(overlayRect.origin.x - CGImageGetWidth(sImage) / 2.0, 177 overlayRect.origin.y - CGImageGetHeight(sImage) / 2.0, 178 CGImageGetWidth(sImage), 179 CGImageGetHeight(sImage)); 180 CGContextDrawImage(context, flipRect(stateRect), sImage); 167 /* Initialize overlayrect: */ 168 CGRect overlayRect = CGRectMake(0, 0, 0, 0); 169 /* Make sure overlay image is valid: */ 170 if (m_overlayImage) 171 { 172 /* Draw overlay image at bottom-right of dock icon: */ 173 overlayRect = CGRectMake(m_dockIconRect.size.width - CGImageGetWidth(m_overlayImage), 174 m_dockIconRect.size.height - CGImageGetHeight(m_overlayImage), 175 CGImageGetWidth(m_overlayImage), 176 CGImageGetHeight(m_overlayImage)); 177 CGContextDrawImage(context, flipRect(overlayRect), m_overlayImage); 178 } 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 } 181 192 } 182 193 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r58346 r58382 1193 1193 connect(gEDataManager, SIGNAL(sigDockIconAppearanceChange(bool)), 1194 1194 this, SLOT(sltChangeDockIconUpdate(bool))); 1195 connect(gEDataManager, SIGNAL(sigDockIconOverlayAppearanceChange(bool)), 1196 this, SLOT(sltChangeDockIconOverlayAppearance(bool))); 1195 1197 1196 1198 /* Monitor selection if there are more than one monitor */ … … 2128 2130 } 2129 2131 } 2132 2133 void UIMachineLogic::sltChangeDockIconOverlayAppearance(bool fEnabled) 2134 { 2135 /* Value of flag is directly referenced from extra-data manager later: */ 2136 Q_UNUSED(fEnabled); 2137 /* Update dock icon overlay: */ 2138 if (isMachineWindowsCreated()) 2139 updateDockOverlay(); 2140 } 2130 2141 #endif /* Q_WS_MAC */ 2131 2142 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r57178 r58382 311 311 void sltDockPreviewMonitorChanged(QAction *pAction); 312 312 void sltChangeDockIconUpdate(bool fEnabled); 313 void sltChangeDockIconOverlayAppearance(bool fEnabled); 313 314 #endif /* RT_OS_DARWIN */ 314 315
Note:
See TracChangeset
for help on using the changeset viewer.