Ticket #1033: IconMenuItem.cpp.2.diff
File IconMenuItem.cpp.2.diff, 1.8 KB (added by , 17 years ago) |
---|
-
/boot/home/Desktop/IconMenuItem.cpp
old new 251 251 fDeviceIcon(NULL) 252 252 { 253 253 if (nodeInfo) { 254 #ifdef __HAIKU__ 255 fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_RGB32); 256 #else 254 257 fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_CMAP8); 258 #endif 259 255 260 if (nodeInfo->GetTrackerIcon(fDeviceIcon, B_MINI_ICON)) { 256 261 delete fDeviceIcon; 257 262 fDeviceIcon = NULL; … … 269 274 : PositionPassingMenuItem(label, message), 270 275 fDeviceIcon(NULL) 271 276 { 272 BMimeType mime(iconType); 277 BMimeType mime(iconType); 278 #ifdef __HAIKU__ 279 fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_RGB32); 280 #else 273 281 fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_CMAP8); 282 #endif 274 283 275 284 if (mime.GetIcon(fDeviceIcon, which) != B_OK) { 276 285 delete fDeviceIcon; … … 289 298 fDeviceIcon(NULL) 290 299 { 291 300 BMimeType mime(iconType); 301 #ifdef __HAIKU__ 302 fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_RGB32); 303 #else 292 304 fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_CMAP8); 305 #endif 293 306 294 307 if (mime.GetIcon(fDeviceIcon, which) != B_OK) { 295 308 delete fDeviceIcon; … … 324 337 drawPoint.x += 20; 325 338 Menu()->MovePenTo(drawPoint); 326 339 _inherited::DrawContent(); 327 340 328 341 BPoint where(ContentLocation()); 329 where.y = Frame().top ;330 342 where.y = Frame().top + 2; 343 331 344 if (fDeviceIcon) { 332 345 if (IsEnabled()) 346 #ifdef __HAIKU__ 347 Menu()->SetDrawingMode(B_OP_ALPHA); 348 else { 349 Menu()->SetDrawingMode(B_OP_ALPHA); 350 Menu()->SetHighColor(0, 0, 0, 64); 351 Menu()->SetBlendingMode(B_CONSTANT_ALPHA, B_ALPHA_OVERLAY); 352 } 353 #else 333 354 Menu()->SetDrawingMode(B_OP_OVER); 334 355 else 335 356 Menu()->SetDrawingMode(B_OP_BLEND); 336 357 #endif 337 358 Menu()->DrawBitmapAsync(fDeviceIcon, where); 338 359 } 339 360 }