From f0eb9fcd9323903b2c1b7046a0a78e078663c6dc Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Fri, 12 Dec 2014 16:11:07 +0100 Subject: [PATCH] FileTypes: make space for BBox titles In some locales the title is longer than the space there is for it. Make sure the boxes are wide enough for the title to display completely. Fixes #11611. --- src/preferences/filetypes/FileTypeWindow.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/preferences/filetypes/FileTypeWindow.cpp b/src/preferences/filetypes/FileTypeWindow.cpp index c91317c596..c9a4093f9b 100644 --- a/src/preferences/filetypes/FileTypeWindow.cpp +++ b/src/preferences/filetypes/FileTypeWindow.cpp @@ -58,7 +58,10 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs) // "File Type" group BBox* fileTypeBox = new BBox("file type BBox"); - fileTypeBox->SetLabel(B_TRANSLATE("File type")); + const char* label = B_TRANSLATE("File type"); + fileTypeBox->SetLabel(label); + fileTypeBox->SetExplicitMinSize(BSize(be_bold_font->StringWidth(label) + 20, + B_SIZE_UNSET)); fTypeControl = new BTextControl("type", NULL, "Type Control", new BMessage(kMsgTypeEntered)); @@ -86,7 +89,10 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs) // "Icon" group BBox* iconBox = new BBox("icon BBox"); - iconBox->SetLabel(B_TRANSLATE("Icon")); + label = B_TRANSLATE("Icon"); + iconBox->SetLabel(label); + iconBox->SetExplicitMinSize(BSize(be_bold_font->StringWidth(label) + 20, + B_SIZE_UNSET)); fIconView = new IconView("icon"); BLayoutBuilder::Group<>(iconBox, B_HORIZONTAL) .SetInsets(padding, padding * 2, padding, padding) @@ -95,7 +101,10 @@ FileTypeWindow::FileTypeWindow(BPoint position, const BMessage& refs) // "Preferred Application" group BBox* preferredBox = new BBox("preferred BBox"); - preferredBox->SetLabel(B_TRANSLATE("Preferred application")); + label = B_TRANSLATE("Preferred application"); + preferredBox->SetLabel(label); + preferredBox->SetExplicitMinSize(BSize(be_bold_font->StringWidth(label) + + 20, B_SIZE_UNSET)); BMenu* menu = new BPopUpMenu("preferred"); BMenuItem* item;