* use B_RGBA32 icons when compiled for Haiku
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19312 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -90,14 +90,26 @@ void IconMenuItem::Highlight(bool hilited)
|
|||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
void IconMenuItem::DrawIcon()
|
void IconMenuItem::DrawIcon()
|
||||||
{
|
{
|
||||||
BPoint loc;
|
// TODO: exact code duplication with TeamBarMenuItem::DrawIcon()
|
||||||
|
if (!fIcon)
|
||||||
|
return;
|
||||||
|
|
||||||
|
BPoint loc = ContentLocation();
|
||||||
|
BRect frame = Frame();
|
||||||
|
|
||||||
loc = ContentLocation();
|
|
||||||
BRect frame = Frame();
|
|
||||||
loc.y = frame.top + (frame.bottom - frame.top - 15) / 2;
|
loc.y = frame.top + (frame.bottom - frame.top - 15) / 2;
|
||||||
Menu()->SetDrawingMode(B_OP_OVER);
|
|
||||||
if (fIcon)
|
BMenu* menu = Menu();
|
||||||
Menu()->DrawBitmap(fIcon, loc);
|
|
||||||
|
if (fIcon->ColorSpace() == B_RGBA32) {
|
||||||
|
menu->SetDrawingMode(B_OP_ALPHA);
|
||||||
|
menu->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
|
||||||
|
} else
|
||||||
|
menu->SetDrawingMode(B_OP_OVER);
|
||||||
|
|
||||||
|
menu->DrawBitmap(fIcon, loc);
|
||||||
|
|
||||||
|
menu->SetDrawingMode(B_OP_COPY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
|
|||||||
@@ -79,15 +79,26 @@ MemoryBarMenuItem::DrawContent()
|
|||||||
void
|
void
|
||||||
MemoryBarMenuItem::DrawIcon()
|
MemoryBarMenuItem::DrawIcon()
|
||||||
{
|
{
|
||||||
|
// TODO: exact code duplication with TeamBarMenuItem::DrawIcon()
|
||||||
|
if (!fIcon)
|
||||||
|
return;
|
||||||
|
|
||||||
BPoint loc = ContentLocation();
|
BPoint loc = ContentLocation();
|
||||||
BRect frame = Frame();
|
BRect frame = Frame();
|
||||||
|
|
||||||
loc.y = frame.top + (frame.bottom - frame.top - 15) / 2;
|
loc.y = frame.top + (frame.bottom - frame.top - 15) / 2;
|
||||||
|
|
||||||
if (fIcon) {
|
BMenu* menu = Menu();
|
||||||
Menu()->SetDrawingMode(B_OP_OVER);
|
|
||||||
Menu()->DrawBitmap(fIcon, loc);
|
if (fIcon->ColorSpace() == B_RGBA32) {
|
||||||
Menu()->SetDrawingMode(B_OP_COPY);
|
menu->SetDrawingMode(B_OP_ALPHA);
|
||||||
}
|
menu->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
|
||||||
|
} else
|
||||||
|
menu->SetDrawingMode(B_OP_OVER);
|
||||||
|
|
||||||
|
menu->DrawBitmap(fIcon, loc);
|
||||||
|
|
||||||
|
menu->SetDrawingMode(B_OP_COPY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -91,15 +91,25 @@ TeamBarMenuItem::DrawContent()
|
|||||||
void
|
void
|
||||||
TeamBarMenuItem::DrawIcon()
|
TeamBarMenuItem::DrawIcon()
|
||||||
{
|
{
|
||||||
|
if (!fIcon)
|
||||||
|
return;
|
||||||
|
|
||||||
BPoint loc = ContentLocation();
|
BPoint loc = ContentLocation();
|
||||||
BRect frame = Frame();
|
BRect frame = Frame();
|
||||||
|
|
||||||
loc.y = frame.top + (frame.bottom - frame.top - 15) / 2;
|
loc.y = frame.top + (frame.bottom - frame.top - 15) / 2;
|
||||||
|
|
||||||
BMenu* menu = Menu ();
|
BMenu* menu = Menu();
|
||||||
menu->SetDrawingMode(B_OP_OVER);
|
|
||||||
if (fIcon)
|
if (fIcon->ColorSpace() == B_RGBA32) {
|
||||||
menu->DrawBitmap(fIcon, loc);
|
menu->SetDrawingMode(B_OP_ALPHA);
|
||||||
|
menu->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
|
||||||
|
} else
|
||||||
|
menu->SetDrawingMode(B_OP_OVER);
|
||||||
|
|
||||||
|
menu->DrawBitmap(fIcon, loc);
|
||||||
|
|
||||||
|
menu->SetDrawingMode(B_OP_COPY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,8 @@ get_team_name_and_icon(info_pack& infoPack, bool icon)
|
|||||||
BEntry entry(infoPack.team_info.args, true);
|
BEntry entry(infoPack.team_info.args, true);
|
||||||
status = entry.GetRef(&info.ref);
|
status = entry.GetRef(&info.ref);
|
||||||
if (status != B_OK
|
if (status != B_OK
|
||||||
|| strncmp(infoPack.team_info.args, systemPath.Path(), strlen(systemPath.Path())) != 0)
|
|| strncmp(infoPack.team_info.args, systemPath.Path(),
|
||||||
|
strlen(systemPath.Path())) != 0)
|
||||||
nameFromArgs = true;
|
nameFromArgs = true;
|
||||||
tryTrackerIcon = (status == B_OK);
|
tryTrackerIcon = (status == B_OK);
|
||||||
}
|
}
|
||||||
@@ -77,9 +78,17 @@ get_team_name_and_icon(info_pack& infoPack, bool icon)
|
|||||||
B_PATH_NAME_LENGTH - 1);
|
B_PATH_NAME_LENGTH - 1);
|
||||||
|
|
||||||
if (icon) {
|
if (icon) {
|
||||||
infoPack.team_icon = new BBitmap(BRect(0, 0, 15, 15), B_COLOR_8_BIT);
|
#ifdef __HAIKU__
|
||||||
if (!tryTrackerIcon || BNodeInfo::GetTrackerIcon(&info.ref, infoPack.team_icon, B_MINI_ICON) != B_OK)
|
infoPack.team_icon = new BBitmap(BRect(0, 0, 15, 15), B_RGBA32);
|
||||||
infoPack.team_icon->SetBits(k_app_mini, 256, 0, B_COLOR_8_BIT);
|
#else
|
||||||
|
infoPack.team_icon = new BBitmap(BRect(0, 0, 15, 15), B_CMAP8);
|
||||||
|
#endif
|
||||||
|
if (!tryTrackerIcon
|
||||||
|
|| BNodeInfo::GetTrackerIcon(&info.ref, infoPack.team_icon,
|
||||||
|
B_MINI_ICON) != B_OK) {
|
||||||
|
// TODO: don't hardcode the "app" icon!
|
||||||
|
infoPack.team_icon->SetBits(k_app_mini, 256, 0, B_CMAP8);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
infoPack.team_icon = NULL;
|
infoPack.team_icon = NULL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user