IconMenuItem: Make icon_size B_MINI_ICON by default
This commit is contained in:
parent
caf0a129d6
commit
d8c4f7b54a
@ -51,13 +51,14 @@ const bigtime_t kSynchMenuInvokeTimeout = 5000000;
|
||||
|
||||
class IconMenuItem : public PositionPassingMenuItem {
|
||||
public:
|
||||
IconMenuItem(const char* label, BMessage* message, BBitmap* icon);
|
||||
IconMenuItem(const char* label, BMessage* message, BBitmap* icon,
|
||||
icon_size which = B_MINI_ICON);
|
||||
IconMenuItem(const char* label, BMessage* message,
|
||||
const char* iconType, icon_size which);
|
||||
const char* iconType, icon_size which = B_MINI_ICON);
|
||||
IconMenuItem(const char* label, BMessage* message,
|
||||
const BNodeInfo* nodeInfo, icon_size which);
|
||||
IconMenuItem(BMenu*, BMessage*, const char* iconType,
|
||||
icon_size which);
|
||||
icon_size which = B_MINI_ICON);
|
||||
IconMenuItem(BMessage* data);
|
||||
virtual ~IconMenuItem();
|
||||
|
||||
|
@ -3538,8 +3538,7 @@ BContainerWindow::AddMimeMenu(const BMimeType& mimeType, bool isSuperType,
|
||||
|
||||
BMessage* message = new BMessage(kMIMETypeItem);
|
||||
message->AddString("mimetype", mimeType.Type());
|
||||
menu->AddItem(new IconMenuItem(mimeMenu, message, mimeType.Type(),
|
||||
B_MINI_ICON));
|
||||
menu->AddItem(new IconMenuItem(mimeMenu, message, mimeType.Type()));
|
||||
|
||||
return mimeMenu;
|
||||
}
|
||||
|
@ -1825,9 +1825,7 @@ FindPanel::AddOneMimeTypeToMenu(const ShortMimeInfo* info, void* castToMenu)
|
||||
previous->SetLabel(label);
|
||||
}
|
||||
|
||||
menu->AddItem(new IconMenuItem(
|
||||
text, msg, info->InternalName(),
|
||||
B_MINI_ICON));
|
||||
menu->AddItem(new IconMenuItem(text, msg, info->InternalName()));
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -1841,7 +1839,8 @@ FindPanel::AddMimeTypesToMenu()
|
||||
itemMessage->AddString("mimetype", kAllMimeTypes);
|
||||
|
||||
IconMenuItem* firstItem = new IconMenuItem(
|
||||
B_TRANSLATE("All files and folders"), itemMessage, NULL);
|
||||
B_TRANSLATE("All files and folders"), itemMessage,
|
||||
static_cast<BBitmap*>(NULL));
|
||||
MimeTypeMenu()->AddItem(firstItem);
|
||||
MimeTypeMenu()->AddSeparatorItem();
|
||||
firstItem->SetMarked(true);
|
||||
@ -1890,7 +1889,7 @@ FindPanel::AddMimeTypesToMenu()
|
||||
message->AddString("mimetype", superType);
|
||||
|
||||
MimeTypeMenu()->AddItem(new IconMenuItem(superMenu, message,
|
||||
superType, B_MINI_ICON));
|
||||
superType));
|
||||
|
||||
// the MimeTypeMenu's font is not correct at this time
|
||||
superMenu->SetFont(be_plain_font);
|
||||
@ -1987,7 +1986,7 @@ AddOneRecentItem(const entry_ref* ref, void* castToParams)
|
||||
char type[B_MIME_TYPE_LENGTH];
|
||||
BNode node(ref);
|
||||
BNodeInfo(&node).GetType(type);
|
||||
BMenuItem* item = new IconMenuItem(ref->name, message, type, B_MINI_ICON);
|
||||
BMenuItem* item = new IconMenuItem(ref->name, message, type);
|
||||
item->SetTarget(*params->target);
|
||||
params->menu->AddItem(item);
|
||||
|
||||
|
@ -253,12 +253,13 @@ SpecialModelMenuItem::DrawContent()
|
||||
|
||||
It's currently used in the mount and new file template menus.
|
||||
*/
|
||||
IconMenuItem::IconMenuItem(const char* label, BMessage* message, BBitmap* icon)
|
||||
IconMenuItem::IconMenuItem(const char* label, BMessage* message, BBitmap* icon,
|
||||
icon_size which)
|
||||
:
|
||||
PositionPassingMenuItem(label, message),
|
||||
fDeviceIcon(icon),
|
||||
fHeightDelta(0),
|
||||
fWhich(icon ? (icon_size)icon->Bounds().IntegerWidth() : B_MINI_ICON)
|
||||
fWhich(which)
|
||||
{
|
||||
// IconMenuItem is used in synchronously invoked menus, make sure
|
||||
// we invoke with a timeout
|
||||
|
Loading…
Reference in New Issue
Block a user