Ticket #1033: IconMenuItem.cpp.diff

File IconMenuItem.cpp.diff, 1.7 KB (added by jonas.kirilla, 17 years ago)

Possible fix

  • /boot/home/Desktop/IconMenuItem.cpp

    old new  
    251251    fDeviceIcon(NULL)
    252252{
    253253    if (nodeInfo) {
    254         fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_CMAP8);
     254        fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_RGB32);
    255255        if (nodeInfo->GetTrackerIcon(fDeviceIcon, B_MINI_ICON)) {
    256256            delete fDeviceIcon;
    257257            fDeviceIcon = NULL;
     
    270270    fDeviceIcon(NULL)
    271271{
    272272    BMimeType mime(iconType);
    273     fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_CMAP8);
     273    fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_RGB32);
    274274
    275275    if (mime.GetIcon(fDeviceIcon, which) != B_OK) {
    276276        delete fDeviceIcon;
     
    289289    fDeviceIcon(NULL)
    290290{
    291291    BMimeType mime(iconType);
    292     fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_CMAP8);
     292    fDeviceIcon = new BBitmap(BRect(0, 0, which - 1, which - 1), B_RGB32);
    293293
    294294    if (mime.GetIcon(fDeviceIcon, which) != B_OK) {
    295295        delete fDeviceIcon;
     
    325325    Menu()->MovePenTo(drawPoint);
    326326    _inherited::DrawContent();
    327327   
    328     BPoint where(ContentLocation());
    329     where.y = Frame().top;
     328    Menu()->PushState();
    330329   
     330    BPoint where(ContentLocation());
     331    where.y = Frame().top + 2;
     332
    331333    if (fDeviceIcon) {
    332         if (IsEnabled())
    333             Menu()->SetDrawingMode(B_OP_OVER);
    334         else
    335             Menu()->SetDrawingMode(B_OP_BLEND);
    336        
     334        if (IsEnabled()) {
     335            Menu()->SetDrawingMode(B_OP_ALPHA);
     336        }
     337        else {
     338            Menu()->SetDrawingMode(B_OP_ALPHA);
     339            Menu()->SetDrawingMode(B_OP_ALPHA);
     340            Menu()->SetHighColor(0, 0, 0, 64);
     341            Menu()->SetBlendingMode(B_CONSTANT_ALPHA, B_ALPHA_OVERLAY);
     342        }       
     343
    337344        Menu()->DrawBitmapAsync(fDeviceIcon, where);
    338345    }
     346   
     347    Menu()->PopState();
    339348}
    340349