Changeset 72710 in vbox
- Timestamp:
- Jun 27, 2018 6:30:08 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123240
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.cpp
r72692 r72710 35 35 # include "UIGraphicsTextPane.h" 36 36 # include "UIActionPool.h" 37 # include "UIConverter.h" 37 38 # include "UIIconPool.h" 38 # include "UI Converter.h"39 # include "UISelectorWindow.h" 39 40 # include "VBoxGlobal.h" 40 41 … … 131 132 } 132 133 134 void UIGDetailsElement::sltHandleWindowRemapped() 135 { 136 /* Update icon: */ 137 updateIcon(); 138 } 139 133 140 void UIGDetailsElement::sltToggleButtonClicked() 134 141 { … … 197 204 /* Update current machine mount-target: */ 198 205 vboxGlobal().updateMachineStorage(machine(), target); 206 } 207 208 void UIGDetailsElement::showEvent(QShowEvent *pEvent) 209 { 210 /* Call to base-class: */ 211 UIGDetailsItem::showEvent(pEvent); 212 213 /* Update icon: */ 214 updateIcon(); 199 215 } 200 216 … … 242 258 } 243 259 244 void UIGDetailsElement::setIcon(const QIcon &icon) 245 { 260 void UIGDetailsElement::updateIcon() 261 { 262 /* Prepare whole icon first of all: */ 263 const QIcon icon = gpConverter->toIcon(elementType()); 264 246 265 /* Cache icon: */ 247 266 if (icon.isNull()) … … 253 272 else 254 273 { 255 /* Determine default the icon size: */ 256 const QStyle *pStyle = QApplication::style(); 257 const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize); 274 /* Determine default icon size: */ 275 const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize); 258 276 m_pixmapSize = QSize(iIconMetric, iIconMetric); 259 /* Acquire the icon of the corresponding size: */260 m_pixmap = icon.pixmap( m_pixmapSize);277 /* Acquire the icon of corresponding size (taking top-level widget DPI into account): */ 278 m_pixmap = icon.pixmap(gpSelectorWindow->windowHandle(), m_pixmapSize); 261 279 } 262 280 … … 412 430 m_textFont = font(); 413 431 432 /* Update icon: */ 433 updateIcon(); 434 414 435 /* Create highlight machine: */ 415 436 m_pHighlightMachine = new QStateMachine(this); … … 444 465 m_pHighlightMachine->start(); 445 466 446 connect(this, SIGNAL(sigToggleElement(DetailsElementType, bool)), model(), SLOT(sltToggleElements(DetailsElementType, bool))); 467 /* Configure connections: */ 468 connect(gpSelectorWindow, &UISelectorWindow::sigWindowRemapped, 469 this, &UIGDetailsElement::sltHandleWindowRemapped); 470 connect(this, SIGNAL(sigToggleElement(DetailsElementType, bool)), 471 model(), SLOT(sltToggleElements(DetailsElementType, bool))); 447 472 connect(this, SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&)), 448 473 model(), SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&))); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.h
r69639 r72710 93 93 protected slots: 94 94 95 /** Handles top-level window remaps. */ 96 void sltHandleWindowRemapped(); 97 95 98 /* Handlers: Toggle stuff: */ 96 99 void sltToggleButtonClicked(); … … 117 120 }; 118 121 122 /** Handles show @a pEvent. */ 123 virtual void showEvent(QShowEvent *pEvent) /* override */; 124 119 125 /** This event handler is delivered after the widget has been resized. */ 120 126 void resizeEvent(QGraphicsSceneResizeEvent *pEvent); … … 131 137 132 138 /* API: Icon stuff: */ 133 void setIcon(const QIcon &icon);139 void updateIcon(); 134 140 135 141 /* API: Name stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.cpp
r72223 r72710 66 66 , m_pTask(0) 67 67 { 68 /* Assign corresponding icon: */69 setIcon(gpConverter->toIcon(elementType()));70 71 68 /* Listen for the global thread-pool: */ 72 69 connect(vboxGlobal().threadPool(), SIGNAL(sigTaskComplete(UITask*)), … … 124 121 : UIGDetailsElement(pParent, DetailsElementType_Preview, fOpened) 125 122 { 126 /* Assign corresponding icon: */127 setIcon(gpConverter->toIcon(elementType()));128 129 123 /* Create preview: */ 130 124 m_pPreview = new UIGMachinePreview(this);
Note:
See TracChangeset
for help on using the changeset viewer.