diff --git a/src/preferences/filetypes/AttributeWindow.cpp b/src/preferences/filetypes/AttributeWindow.cpp index 83e6ba672c..645ca3fb20 100644 --- a/src/preferences/filetypes/AttributeWindow.cpp +++ b/src/preferences/filetypes/AttributeWindow.cpp @@ -243,18 +243,17 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType, BLayoutBuilder::Grid<>(padding, padding / 2) .Add(fDisplayAsMenuField->CreateLabelLayoutItem(), 0, 0) .Add(fDisplayAsMenuField->CreateMenuBarLayoutItem(), 1, 0) - .Add(fEditableCheckBox, 3, 0) + .Add(fEditableCheckBox, 2, 0) .Add(fSpecialControl->CreateLabelLayoutItem(), 0, 1) - .Add(fSpecialControl->CreateTextViewLayoutItem(), 1, 1, 3) + .Add(fSpecialControl->CreateTextViewLayoutItem(), 1, 1, 2) .Add(fWidthControl->CreateLabelLayoutItem(), 0, 2) - .Add(fWidthControl->CreateTextViewLayoutItem(), 1, 2, 3) + .Add(fWidthControl->CreateTextViewLayoutItem(), 1, 2, 2) .Add(fAlignmentMenuField->CreateLabelLayoutItem(), 0, 3) - .Add(fAlignmentMenuField->CreateMenuBarLayoutItem(), 1, 3, 3) + .Add(fAlignmentMenuField->CreateMenuBarLayoutItem(), 1, 3, 2) .SetInsets(padding, padding, padding, padding) .View()) ) .AddGroup(B_HORIZONTAL, padding) - .Add(BSpaceLayoutItem::CreateGlue()) .Add(BSpaceLayoutItem::CreateGlue()) .Add(cancelButton) .Add(fAcceptButton); diff --git a/src/preferences/filetypes/FileTypesWindow.cpp b/src/preferences/filetypes/FileTypesWindow.cpp index 6812baa6f2..b8f0364d9e 100644 --- a/src/preferences/filetypes/FileTypesWindow.cpp +++ b/src/preferences/filetypes/FileTypesWindow.cpp @@ -116,6 +116,8 @@ class ExtensionListView : public DropTargetListView { uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE); virtual ~ExtensionListView(); + virtual BSize MinSize(); + virtual void MessageReceived(BMessage* message); virtual bool AcceptsDrag(const BMessage* message); @@ -123,6 +125,7 @@ class ExtensionListView : public DropTargetListView { private: BMimeType fType; + BSize fMinSize; }; @@ -247,6 +250,23 @@ ExtensionListView::~ExtensionListView() } +BSize +ExtensionListView::MinSize() +{ + if (!fMinSize.IsWidthSet() || fMinSize.IsHeightSet()) { + BFont font; + GetFont(&font); + fMinSize.width = font.StringWidth(".mmmmm"); + + font_height height; + font.GetHeight(&height); + fMinSize.height = (height.ascent + height.descent + height.leading) * 3; + } + + return fMinSize; +} + + void ExtensionListView::MessageReceived(BMessage* message) { @@ -432,7 +452,6 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings) .Add(fRuleControl, 0, 4, 3, 1) .SetInsets(padding, padding, padding, padding); - recognitionBoxGrid->SetExplicitAlignment(fullAlignment); fRecognitionBox->AddChild(recognitionBoxGrid); // "Description" group