- Timestamp:
- Jan 22, 2010, 8:50:23 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/kernel/qdnd_pm.cpp
r466 r469 1219 1219 #endif 1220 1220 1221 // @todo custom drag pixmap?1222 1223 1221 DRAGIMAGE img; 1224 1222 img.cb = sizeof(DRAGIMAGE); 1225 img.hImage = WinQuerySysPointer(HWND_DESKTOP, SPTR_FILE, FALSE); 1226 img.fl = DRG_ICON; 1227 img.cxOffset = 0; 1228 img.cyOffset = 0; 1223 1224 QPixmap pm = dragPrivate()->pixmap; 1225 if (!pm.isNull()) { 1226 if (pm.hasAlpha()) { 1227 // replace the black pixels with the neutral default window 1228 // background color 1229 QPixmap pm2(pm.width(), pm.height()); 1230 pm2.fill(QApplication::palette().color(QPalette::Window)); 1231 QPainter p(&pm2); 1232 p.drawPixmap(0, 0, pm); 1233 p.end(); 1234 pm = pm2; 1235 } 1236 QPoint hot = dragPrivate()->hotspot; 1237 img.fl = DRG_BITMAP; 1238 img.hImage = pm.toPmHBITMAP(); 1239 img.cxOffset = -hot.x(); 1240 img.cyOffset = -(pm.height() - hot.y() - 1); 1241 } else { 1242 img.fl = DRG_ICON; 1243 img.hImage = WinQuerySysPointer(HWND_DESKTOP, SPTR_FILE, FALSE); 1244 img.cxOffset = 0; 1245 img.cyOffset = 0; 1246 } 1229 1247 1230 1248 // the mouse is most likely captured by Qt at this point, uncapture it
Note:
See TracChangeset
for help on using the changeset viewer.