diff --git a/src/bin/desklink/DeskButton.cpp b/src/bin/desklink/DeskButton.cpp index ed786568ec..ca35122fbd 100644 --- a/src/bin/desklink/DeskButton.cpp +++ b/src/bin/desklink/DeskButton.cpp @@ -62,10 +62,11 @@ DeskButton::DeskButton(BMessage *message) index++; } - fSegments = new BBitmap(BRect(BPoint(0, 0), be_control_look->ComposeIconSize(B_MINI_ICON)), - B_RGBA32); - BNodeInfo::GetTrackerIcon(&fRef, fSegments, - (icon_size)(fSegments->Bounds().IntegerWidth() + 1)); + BRect bounds; + message->FindRect("bounds", &bounds); + + fSegments = new BBitmap(bounds, B_RGBA32); + BNodeInfo::GetTrackerIcon(&fRef, fSegments, (icon_size)-1); } @@ -99,6 +100,8 @@ DeskButton::Archive(BMessage *data, bool deep) const data->AddString("action", *(BString*)fActionList.ItemAt(i)); } + data->AddRect("bounds", fSegments->Bounds()); + data->AddString("add_on", kAppSignature); return B_NO_ERROR; } diff --git a/src/bin/desklink/desklink.cpp b/src/bin/desklink/desklink.cpp index 03f7901bcf..aa25fd3c2b 100644 --- a/src/bin/desklink/desklink.cpp +++ b/src/bin/desklink/desklink.cpp @@ -140,8 +140,9 @@ main(int, char **argv) err = deskbar.AddItem(&ref); if (err != B_OK) { + const float height = deskbar.MaxItemHeight(); err = deskbar.AddItem(new DeskButton(BRect(BPoint(0, 0), - be_control_look->ComposeIconSize(B_MINI_ICON)), + BSize(height, height)), &ref, ref.name, titleList, actionList)); if (err != B_OK) { printf("desklink: Deskbar refuses link to '%s': %s\n", argv[i], strerror(err));