@@ -13,6 +13,7 @@
|
|||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
|
#include <ControlLook.h>
|
||||||
#include <Dragger.h>
|
#include <Dragger.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
@@ -42,17 +43,13 @@ DeskButton::DeskButton(BRect frame, entry_ref* ref, const char* name,
|
|||||||
fActionList(actions),
|
fActionList(actions),
|
||||||
fTitleList(titles)
|
fTitleList(titles)
|
||||||
{
|
{
|
||||||
#ifdef __HAIKU__
|
fSegments = new BBitmap(frame, B_RGBA32);
|
||||||
fSegments = new BBitmap(BRect(0, 0, 15, 15), B_RGBA32);
|
BNodeInfo::GetTrackerIcon(&fRef, fSegments, (icon_size)(frame.IntegerWidth() + 1));
|
||||||
#else
|
|
||||||
fSegments = new BBitmap(BRect(0, 0, 15, 15), B_CMAP8);
|
|
||||||
#endif
|
|
||||||
BNodeInfo::GetTrackerIcon(&fRef, fSegments, B_MINI_ICON);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DeskButton::DeskButton(BMessage *message)
|
DeskButton::DeskButton(BMessage *message)
|
||||||
: BView(message)
|
: BView(message)
|
||||||
{
|
{
|
||||||
message->FindRef("ref", &fRef);
|
message->FindRef("ref", &fRef);
|
||||||
|
|
||||||
@@ -65,12 +62,10 @@ DeskButton::DeskButton(BMessage *message)
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __HAIKU__
|
fSegments = new BBitmap(BRect(BPoint(0, 0), be_control_look->ComposeIconSize(B_MINI_ICON)),
|
||||||
fSegments = new BBitmap(BRect(0, 0, 15, 15), B_RGBA32);
|
B_RGBA32);
|
||||||
#else
|
BNodeInfo::GetTrackerIcon(&fRef, fSegments,
|
||||||
fSegments = new BBitmap(BRect(0, 0, 15, 15), B_CMAP8);
|
(icon_size)(fSegments->Bounds().IntegerWidth() + 1));
|
||||||
#endif
|
|
||||||
BNodeInfo::GetTrackerIcon(&fRef, fSegments, B_MINI_ICON);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <ControlLook.h>
|
||||||
#include <Deskbar.h>
|
#include <Deskbar.h>
|
||||||
#include <MimeType.h>
|
#include <MimeType.h>
|
||||||
#include <Roster.h>
|
#include <Roster.h>
|
||||||
@@ -139,7 +140,8 @@ main(int, char **argv)
|
|||||||
|
|
||||||
err = deskbar.AddItem(&ref);
|
err = deskbar.AddItem(&ref);
|
||||||
if (err != B_OK) {
|
if (err != B_OK) {
|
||||||
err = deskbar.AddItem(new DeskButton(BRect(0, 0, 15, 15),
|
err = deskbar.AddItem(new DeskButton(BRect(BPoint(0, 0),
|
||||||
|
be_control_look->ComposeIconSize(B_MINI_ICON)),
|
||||||
&ref, ref.name, titleList, actionList));
|
&ref, ref.name, titleList, actionList));
|
||||||
if (err != B_OK) {
|
if (err != B_OK) {
|
||||||
printf("desklink: Deskbar refuses link to '%s': %s\n", argv[i], strerror(err));
|
printf("desklink: Deskbar refuses link to '%s': %s\n", argv[i], strerror(err));
|
||||||
|
|||||||
Reference in New Issue
Block a user