Ticket #2370: screen_alert_icon.patch

File screen_alert_icon.patch, 1.4 KB (added by thebolt, 16 years ago)
  • src/preferences/screen/AlertView.cpp

     
    1818#include <StringView.h>
    1919#include <String.h>
    2020
     21#include <IconUtils.h>
    2122#include <FindDirectory.h>
    2223#include <Resources.h>
    2324#include <File.h>
     
    142143        BFile file;
    143144        if (file.SetTo(path.Path(), B_READ_ONLY) == B_OK
    144145            && resources.SetTo(&file) == B_OK) {
    145             // Load the raw icon data
    146146            size_t size;
    147             const void* data = resources.LoadResource(B_LARGE_ICON_TYPE, "warn", &size);
     147            const void* data = resources.LoadResource(B_VECTOR_ICON_TYPE, "warn", &size);
    148148            if (data) {
    149                 // Now build the bitmap
    150149                icon = new BBitmap(BRect(0, 0, 31, 31), 0, B_CMAP8);
    151                 icon->SetBits(data, size, 0, B_CMAP8);
     150                if (BIconUtils::GetVectorIcon((const uint8*)data, size, icon) != B_OK) {
     151                    delete icon;
     152                    icon = NULL;
     153                }
    152154            }
    153155        }
    154156    }
  • src/preferences/screen/Jamfile

     
    33SetSubDirSupportedPlatformsBeOSCompatible ;
    44AddSubDirSupportedPlatforms libbe_test ;
    55
     6UseLibraryHeaders icon ;
    67UsePrivateHeaders [ FDirName graphics radeon ] ;
    78
    89Preference Screen :