Fix layout problems in Filetypes that became apparent with the introduction of CollapsingLayouter.
+alpha git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41662 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -243,18 +243,17 @@ AttributeWindow::AttributeWindow(FileTypesWindow* target, BMimeType& mimeType,
|
|||||||
BLayoutBuilder::Grid<>(padding, padding / 2)
|
BLayoutBuilder::Grid<>(padding, padding / 2)
|
||||||
.Add(fDisplayAsMenuField->CreateLabelLayoutItem(), 0, 0)
|
.Add(fDisplayAsMenuField->CreateLabelLayoutItem(), 0, 0)
|
||||||
.Add(fDisplayAsMenuField->CreateMenuBarLayoutItem(), 1, 0)
|
.Add(fDisplayAsMenuField->CreateMenuBarLayoutItem(), 1, 0)
|
||||||
.Add(fEditableCheckBox, 3, 0)
|
.Add(fEditableCheckBox, 2, 0)
|
||||||
.Add(fSpecialControl->CreateLabelLayoutItem(), 0, 1)
|
.Add(fSpecialControl->CreateLabelLayoutItem(), 0, 1)
|
||||||
.Add(fSpecialControl->CreateTextViewLayoutItem(), 1, 1, 3)
|
.Add(fSpecialControl->CreateTextViewLayoutItem(), 1, 1, 2)
|
||||||
.Add(fWidthControl->CreateLabelLayoutItem(), 0, 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->CreateLabelLayoutItem(), 0, 3)
|
||||||
.Add(fAlignmentMenuField->CreateMenuBarLayoutItem(), 1, 3, 3)
|
.Add(fAlignmentMenuField->CreateMenuBarLayoutItem(), 1, 3, 2)
|
||||||
.SetInsets(padding, padding, padding, padding)
|
.SetInsets(padding, padding, padding, padding)
|
||||||
.View())
|
.View())
|
||||||
)
|
)
|
||||||
.AddGroup(B_HORIZONTAL, padding)
|
.AddGroup(B_HORIZONTAL, padding)
|
||||||
.Add(BSpaceLayoutItem::CreateGlue())
|
|
||||||
.Add(BSpaceLayoutItem::CreateGlue())
|
.Add(BSpaceLayoutItem::CreateGlue())
|
||||||
.Add(cancelButton)
|
.Add(cancelButton)
|
||||||
.Add(fAcceptButton);
|
.Add(fAcceptButton);
|
||||||
|
|||||||
@@ -116,6 +116,8 @@ class ExtensionListView : public DropTargetListView {
|
|||||||
uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE);
|
uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE);
|
||||||
virtual ~ExtensionListView();
|
virtual ~ExtensionListView();
|
||||||
|
|
||||||
|
virtual BSize MinSize();
|
||||||
|
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
virtual bool AcceptsDrag(const BMessage* message);
|
virtual bool AcceptsDrag(const BMessage* message);
|
||||||
|
|
||||||
@@ -123,6 +125,7 @@ class ExtensionListView : public DropTargetListView {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
BMimeType fType;
|
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
|
void
|
||||||
ExtensionListView::MessageReceived(BMessage* message)
|
ExtensionListView::MessageReceived(BMessage* message)
|
||||||
{
|
{
|
||||||
@@ -432,7 +452,6 @@ FileTypesWindow::FileTypesWindow(const BMessage& settings)
|
|||||||
.Add(fRuleControl, 0, 4, 3, 1)
|
.Add(fRuleControl, 0, 4, 3, 1)
|
||||||
.SetInsets(padding, padding, padding, padding);
|
.SetInsets(padding, padding, padding, padding);
|
||||||
|
|
||||||
recognitionBoxGrid->SetExplicitAlignment(fullAlignment);
|
|
||||||
fRecognitionBox->AddChild(recognitionBoxGrid);
|
fRecognitionBox->AddChild(recognitionBoxGrid);
|
||||||
|
|
||||||
// "Description" group
|
// "Description" group
|
||||||
|
|||||||
Reference in New Issue
Block a user