From 2494fda73a83f8991c4ecaf0190b908fe71a6b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 29 Dec 2005 21:10:17 +0000 Subject: [PATCH] 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 --- src/preferences/backgrounds/ImageFilePanel.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/preferences/backgrounds/ImageFilePanel.cpp b/src/preferences/backgrounds/ImageFilePanel.cpp index 0b168c3685..279868e6f8 100644 --- a/src/preferences/backgrounds/ImageFilePanel.cpp +++ b/src/preferences/backgrounds/ImageFilePanel.cpp @@ -63,7 +63,7 @@ ImageFilePanel::Show() background->AddChild(fImageView); 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, B_FOLLOW_LEFT | B_FOLLOW_BOTTOM); background->AddChild(fResolutionView); @@ -116,13 +116,12 @@ ImageFilePanel::SelectionChanged() BNode node(&ref); BNodeInfo nodeInfo(&node); - char fileType[256]; - if (nodeInfo.GetType(fileType) == B_OK) { - // TODO: this is broken! - if (strncmp(fileType, "image/jpeg", 10) == 0) - fImageTypeView->SetText("JPEG Image"); - else - fImageTypeView->SetText(""); + char type[B_MIME_TYPE_LENGTH]; + if (nodeInfo.GetType(type) == B_OK) { + BMimeType mimeType(type); + mimeType.GetShortDescription(type); + // if this fails, the MIME type will be displayed + fImageTypeView->SetText(type); } } } else {