The resolution and image type now span over the whole width of the file

panel window (and thus the text is no longer cut off under Haiku).
Instead of only writing "JPEG Image" for JPEG images, and nothing for
all other image types, the MIME types short description is now displayed
(or the MIME type itself if no such description exists).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15733 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-12-29 21:10:17 +00:00
parent 835a0aaf32
commit 2494fda73a
@@ -63,7 +63,7 @@ ImageFilePanel::Show()
background->AddChild(fImageView); background->AddChild(fImageView);
rect = BRect(background->Bounds().left + 132, background->Bounds().bottom - 85, rect = BRect(background->Bounds().left + 132, background->Bounds().bottom - 85,
background->Bounds().left + 250, background->Bounds().bottom - 65); background->Bounds().right, background->Bounds().bottom - 65);
fResolutionView = new BStringView(rect, "ResolutionView", NULL, fResolutionView = new BStringView(rect, "ResolutionView", NULL,
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM); B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
background->AddChild(fResolutionView); background->AddChild(fResolutionView);
@@ -116,13 +116,12 @@ ImageFilePanel::SelectionChanged()
BNode node(&ref); BNode node(&ref);
BNodeInfo nodeInfo(&node); BNodeInfo nodeInfo(&node);
char fileType[256]; char type[B_MIME_TYPE_LENGTH];
if (nodeInfo.GetType(fileType) == B_OK) { if (nodeInfo.GetType(type) == B_OK) {
// TODO: this is broken! BMimeType mimeType(type);
if (strncmp(fileType, "image/jpeg", 10) == 0) mimeType.GetShortDescription(type);
fImageTypeView->SetText("JPEG Image"); // if this fails, the MIME type will be displayed
else fImageTypeView->SetText(type);
fImageTypeView->SetText("");
} }
} }
} else { } else {