* Fixed various minor font sensitivity issues with larger fonts.

* Fixed build on Dano.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16552 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-02-28 21:18:24 +00:00
parent 28475bfdbd
commit 3a14d2275f
4 changed files with 30 additions and 25 deletions

View File

@ -117,7 +117,7 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
topView->AddChild(menuField);
rect.OffsetBy(0.0f, rect.Height() + 4.0f);
rect.bottom = rect.top + fAttributeControl->Bounds().Height() * 5.0f + 22.0f;
rect.bottom = rect.top + fAttributeControl->Bounds().Height() * 2.0f + 18.0f;
BBox* box = new BBox(rect, "", B_FOLLOW_LEFT_RIGHT);
topView->AddChild(box);
@ -210,6 +210,8 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
fAlignmentMenuField->SetAlignment(B_ALIGN_RIGHT);
fAlignmentMenuField->ResizeTo(rect.Width(), height);
box->AddChild(fAlignmentMenuField);
box->ResizeBy(0.0f, fAlignmentMenuField->Bounds().Height() * 2.0f
+ fVisibleCheckBox->Bounds().Height());
fAcceptButton = new BButton(rect, "add", item ? "Done" : "Add",
new BMessage(kMsgAccept), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);

View File

@ -14,7 +14,9 @@
#include <Window.h>
class BButton;
class BCheckBox;
class BMenu;
class BMenuField;
class BTextControl;
class FileTypesWindow;

View File

@ -90,7 +90,8 @@ ExtensionWindow::ExtensionWindow(FileTypesWindow* target, BMimeType& type,
fAcceptButton->Frame().top);
topView->AddChild(button);
ResizeTo(labelWidth * 4.0f + 24.0f, fExtensionControl->Bounds().Height() * 2.0f + 30.0f);
ResizeTo(labelWidth * 4.0f + 24.0f, fExtensionControl->Bounds().Height()
+ fAcceptButton->Bounds().Height() + 28.0f);
SetSizeLimits(button->Bounds().Width() + fAcceptButton->Bounds().Width() + 26.0f,
32767.0f, Frame().Height(), Frame().Height());

View File

@ -36,28 +36,9 @@ NewFileTypeWindow::NewFileTypeWindow(FileTypesWindow* target, const char* curren
topView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
AddChild(topView);
rect.InsetBy(8.0f, 8.0f);
fNameControl = new BTextControl(rect, "internal", "Internal Name:", "",
NULL, B_FOLLOW_LEFT_RIGHT);
float labelWidth = fNameControl->StringWidth(fNameControl->Label()) + 2.0f;
fNameControl->SetModificationMessage(new BMessage(kMsgNameUpdated));
fNameControl->SetDivider(labelWidth);
fNameControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
// filter out invalid characters that can't be part of a MIME type name
BTextView* textView = fNameControl->TextView();
const char* disallowedCharacters = "/<>@,;:\"()[]?=";
for (int32 i = 0; disallowedCharacters[i]; i++) {
textView->DisallowChar(disallowedCharacters[i]);
}
float width, height;
fNameControl->GetPreferredSize(&width, &height);
fNameControl->ResizeTo(rect.Width(), height);
fNameControl->MoveTo(8.0f, 12.0f + fNameControl->Bounds().Height());
topView->AddChild(fNameControl);
float labelWidth = be_plain_font->StringWidth("Internal Name:") + 2.0f;
rect.InsetBy(8.0f, 6.0f);
fSupertypesMenu = new BPopUpMenu("supertypes");
BMenuItem* item;
BMessage types;
@ -82,15 +63,33 @@ NewFileTypeWindow::NewFileTypeWindow(FileTypesWindow* target, const char* curren
fSupertypesMenu->AddItem(new BMenuItem("Add New Group",
new BMessage(kMsgNewSupertypeChosen)));
rect.bottom = rect.top + fNameControl->Bounds().Height() + 2.0f;
BMenuField* menuField = new BMenuField(rect, "supertypes",
"Group:", fSupertypesMenu);
menuField->SetDivider(labelWidth);
menuField->SetAlignment(B_ALIGN_RIGHT);
float width, height;
menuField->GetPreferredSize(&width, &height);
menuField->ResizeTo(rect.Width(), height);
topView->AddChild(menuField);
fNameControl = new BTextControl(rect, "internal", "Internal Name:", "",
NULL, B_FOLLOW_LEFT_RIGHT);
fNameControl->SetModificationMessage(new BMessage(kMsgNameUpdated));
fNameControl->SetDivider(labelWidth);
fNameControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
// filter out invalid characters that can't be part of a MIME type name
BTextView* textView = fNameControl->TextView();
const char* disallowedCharacters = "/<>@,;:\"()[]?=";
for (int32 i = 0; disallowedCharacters[i]; i++) {
textView->DisallowChar(disallowedCharacters[i]);
}
fNameControl->GetPreferredSize(&width, &height);
fNameControl->ResizeTo(rect.Width(), height);
fNameControl->MoveTo(8.0f, 12.0f + menuField->Bounds().Height());
topView->AddChild(fNameControl);
fAddButton = new BButton(rect, "add", "Add Type", new BMessage(kMsgAddType),
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
fAddButton->ResizeToPreferred();
@ -106,7 +105,8 @@ NewFileTypeWindow::NewFileTypeWindow(FileTypesWindow* target, const char* curren
fAddButton->Frame().top);
topView->AddChild(button);
ResizeTo(labelWidth * 4.0f + 24.0f, fNameControl->Bounds().Height() * 3.0f + 34.0f);
ResizeTo(labelWidth * 4.0f + 24.0f, fNameControl->Bounds().Height()
+ menuField->Bounds().Height() + fAddButton->Bounds().Height() + 30.0f);
SetSizeLimits(button->Bounds().Width() + fAddButton->Bounds().Width() + 26.0f,
32767.0f, Frame().Height(), Frame().Height());