Ticket #1033: IconMenuItem.cpp.2.diff

File IconMenuItem.cpp.2.diff, 1.8 KB (added by jonas.kirilla, 17 years ago)
  • /boot/home/Desktop/IconMenuItem.cpp

    old new  
    251251    fDeviceIcon(NULL)
    252252{
    253253    if (nodeInfo) {
     254#ifdef __HAIKU__
     255        fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_RGB32);
     256#else
    254257        fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_CMAP8);
     258#endif
     259
    255260        if (nodeInfo->GetTrackerIcon(fDeviceIcon, B_MINI_ICON)) {
    256261            delete fDeviceIcon;
    257262            fDeviceIcon = NULL;
     
    269274    : PositionPassingMenuItem(label, message),
    270275    fDeviceIcon(NULL)
    271276{
    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
    273281    fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_CMAP8);
     282#endif
    274283
    275284    if (mime.GetIcon(fDeviceIcon, which) != B_OK) {
    276285        delete fDeviceIcon;
     
    289298    fDeviceIcon(NULL)
    290299{
    291300    BMimeType mime(iconType);
     301#ifdef __HAIKU__
     302    fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_RGB32);
     303#else
    292304    fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_CMAP8);
     305#endif
    293306
    294307    if (mime.GetIcon(fDeviceIcon, which) != B_OK) {
    295308        delete fDeviceIcon;
     
    324337    drawPoint.x += 20;
    325338    Menu()->MovePenTo(drawPoint);
    326339    _inherited::DrawContent();
    327    
     340
    328341    BPoint where(ContentLocation());
    329     where.y = Frame().top;
    330    
     342    where.y = Frame().top + 2;
     343
    331344    if (fDeviceIcon) {
    332345        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
    333354            Menu()->SetDrawingMode(B_OP_OVER);
    334355        else
    335356            Menu()->SetDrawingMode(B_OP_BLEND);
    336        
     357#endif     
    337358        Menu()->DrawBitmapAsync(fDeviceIcon, where);
    338359    }
    339360}