From 9638d4c87730eb6ab5ecb68f6b5a93689175d05f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 7 Mar 2006 14:09:30 +0000 Subject: [PATCH] * Fixed a font sensitivity issue not visible under BeOS. * IconView now draws a rectangle in case there is no icon to let the user know there is something he could click on. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16628 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/preferences/filetypes/FileTypeWindow.cpp | 4 +++- src/preferences/filetypes/IconView.cpp | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/preferences/filetypes/FileTypeWindow.cpp b/src/preferences/filetypes/FileTypeWindow.cpp index a192c1b206..fc25be7608 100644 --- a/src/preferences/filetypes/FileTypeWindow.cpp +++ b/src/preferences/filetypes/FileTypeWindow.cpp @@ -138,6 +138,7 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs) NULL, menu); fPreferredField->GetPreferredSize(&width, &height); fPreferredField->ResizeTo(rect.Width(), height); + constrainingView->ResizeTo(rect.Width(), height); constrainingView->AddChild(fPreferredField); // we embed the menu field in another view to make it behave like // we want so that it can't obscure other elements with larger @@ -145,7 +146,7 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs) box->AddChild(constrainingView); - rect.OffsetBy(0.0f, fTypeControl->Bounds().Height() + 5.0f); + rect.OffsetBy(0.0f, height + 5.0f); fSelectAppButton = new BButton(rect, "select app", "Select" B_UTF8_ELLIPSIS, new BMessage(kMsgSelectPreferredApp), B_FOLLOW_LEFT | B_FOLLOW_TOP); fSelectAppButton->ResizeToPreferred(); @@ -156,6 +157,7 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs) new BMessage(kMsgSamePreferredAppAs), B_FOLLOW_LEFT | B_FOLLOW_TOP); fSameAppAsButton->ResizeToPreferred(); box->AddChild(fSameAppAsButton); + box->ResizeBy(0.0f, height - fTypeControl->Bounds().Height()); ResizeTo(fSameAppAsButton->Frame().right + 100.0f, box->Frame().bottom + 8.0f); SetSizeLimits(fSameAppAsButton->Frame().right + iconBoxWidth + 32.0f, 32767.0f, diff --git a/src/preferences/filetypes/IconView.cpp b/src/preferences/filetypes/IconView.cpp index 3d0444b195..999a1d0afa 100644 --- a/src/preferences/filetypes/IconView.cpp +++ b/src/preferences/filetypes/IconView.cpp @@ -47,6 +47,12 @@ IconView::Draw(BRect updateRect) DrawBitmap(fHeapIcon, BPoint(0.0f, 0.0f)); else if (fIcon != NULL) DrawBitmap(fIcon, BPoint(0.0f, 0.0f)); + else { + // draw frame so that the user knows here is something he + // might be able to click on + SetHighColor(tint_color(ViewColor(), B_DARKEN_1_TINT)); + StrokeRect(Bounds()); + } }