Draw icon with transparency.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21420 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -25,7 +25,11 @@ IconView::IconView(const BRect &frame, const char *name,
|
|||||||
|
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
|
#if __HAIKU__
|
||||||
|
fIconBitmap = new BBitmap(BRect(0, 0, B_LARGE_ICON - 1, B_LARGE_ICON - 1), B_RGBA32);
|
||||||
|
#else
|
||||||
fIconBitmap = new BBitmap(BRect(0, 0, B_LARGE_ICON - 1, B_LARGE_ICON - 1), B_CMAP8);
|
fIconBitmap = new BBitmap(BRect(0, 0, B_LARGE_ICON - 1, B_LARGE_ICON - 1), B_CMAP8);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
IconView::~IconView()
|
IconView::~IconView()
|
||||||
@@ -65,7 +69,15 @@ IconView::DrawIcon(bool draw)
|
|||||||
void
|
void
|
||||||
IconView::Draw(BRect area)
|
IconView::Draw(BRect area)
|
||||||
{
|
{
|
||||||
|
#if __HAIKU__
|
||||||
|
SetDrawingMode(B_OP_ALPHA);
|
||||||
|
SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
|
||||||
|
#else
|
||||||
|
SetDrawingMode(B_OP_OVER);
|
||||||
|
#endif
|
||||||
if (fDrawIcon)
|
if (fDrawIcon)
|
||||||
DrawBitmap(fIconBitmap);
|
DrawBitmap(fIconBitmap);
|
||||||
|
|
||||||
|
SetDrawingMode(B_OP_COPY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user