[haiku-commits] r35740 - haiku/trunk/src/preferences/filetypes

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 3 Mar 2010 18:47:29 +0100 (CET)

Author: stippi
Date: 2010-03-03 18:47:29 +0100 (Wed, 03 Mar 2010)
New Revision: 35740
Changeset: http://dev.haiku-os.org/changeset/35740/haiku
Ticket: http://dev.haiku-os.org/ticket/3637

Modified:
   haiku/trunk/src/preferences/filetypes/FileTypesWindow.cpp
Log:
Patch by "yourpalal": The previous hack to embed the menufield is no
longer necessary. Resolves #3637 - thanks!


Modified: haiku/trunk/src/preferences/filetypes/FileTypesWindow.cpp
===================================================================
--- haiku/trunk/src/preferences/filetypes/FileTypesWindow.cpp   2010-03-03 
17:43:31 UTC (rev 35739)
+++ haiku/trunk/src/preferences/filetypes/FileTypesWindow.cpp   2010-03-03 
17:47:29 UTC (rev 35740)
@@ -495,9 +495,11 @@
 
        innerRect = fPreferredBox->Bounds().InsetByCopy(8.0f, 6.0f);
        innerRect.top += ceilf(boldHeight.ascent);
-       innerRect.left = innerRect.right - button->StringWidth("Same as" 
B_UTF8_ELLIPSIS) - 24.0f;
+       innerRect.left = innerRect.right - button->StringWidth(
+               "Same as" B_UTF8_ELLIPSIS) - 24.0f;
        innerRect.bottom = innerRect.top + button->Bounds().Height();
-       fSameAsButton = new BButton(innerRect, "same as", "Same as" 
B_UTF8_ELLIPSIS,
+       fSameAsButton = new BButton(innerRect, "same as",
+               "Same as" B_UTF8_ELLIPSIS,
                new BMessage(kMsgSamePreferredAppAs), B_FOLLOW_RIGHT);
        fPreferredBox->AddChild(fSameAsButton);
 
@@ -507,32 +509,28 @@
        fPreferredBox->AddChild(fSelectButton);
 
        menu = new BPopUpMenu("preferred");
-       menu->AddItem(item = new BMenuItem("None", new 
BMessage(kMsgPreferredAppChosen)));
+       menu->AddItem(item = new BMenuItem("None",
+               new BMessage(kMsgPreferredAppChosen)));
        item->SetMarked(true);
 
        innerRect.right = innerRect.left - 6.0f;
        innerRect.left = 8.0f;
-       BView* constrainingView = new BView(innerRect, NULL, 
B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW);
-       constrainingView->SetViewColor(topView->ViewColor());
 
-       fPreferredField = new BMenuField(innerRect.OffsetToCopy(B_ORIGIN), 
"preferred",
-               NULL, menu);
+       fPreferredField = new BMenuField(innerRect, "preferred", NULL, menu, 
true,
+               B_FOLLOW_LEFT_RIGHT);
        float width;
        fPreferredField->GetPreferredSize(&width, &height);
        fPreferredField->ResizeTo(innerRect.Width(), height);
        fPreferredField->MoveBy(0.0f, (innerRect.Height() - height) / 2.0f);
-       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
-               // labels
 
-       fPreferredBox->AddChild(constrainingView);
+       fPreferredBox->AddChild(fPreferredField);
 
        // "Extra Attributes" group
 
        rect.top = rect.bottom + 8.0f;
        rect.bottom = topView->Bounds().Height() - 8.0f;
-       fAttributeBox = new BBox(rect, NULL, B_FOLLOW_LEFT_RIGHT | 
B_FOLLOW_TOP_BOTTOM);
+       fAttributeBox = new BBox(rect, NULL, B_FOLLOW_LEFT_RIGHT
+               | B_FOLLOW_TOP_BOTTOM);
        fAttributeBox->SetLabel("Extra attributes");
        topView->AddChild(fAttributeBox);
 
@@ -540,8 +538,8 @@
        innerRect.top += ceilf(boldHeight.ascent);
        innerRect.left = innerRect.right - button->StringWidth("Remove") - 
16.0f;
        innerRect.bottom = innerRect.top + button->Bounds().Height();
-       fAddAttributeButton = new BButton(innerRect, "add attr", "Add" 
B_UTF8_ELLIPSIS,
-               new BMessage(kMsgAddAttribute), B_FOLLOW_RIGHT);
+       fAddAttributeButton = new BButton(innerRect, "add attr",
+               "Add" B_UTF8_ELLIPSIS, new BMessage(kMsgAddAttribute), 
B_FOLLOW_RIGHT);
        fAttributeBox->AddChild(fAddAttributeButton);
 
        innerRect.OffsetBy(0, innerRect.Height() + 4.0f);


Other related posts:

  • » [haiku-commits] r35740 - haiku/trunk/src/preferences/filetypes - superstippi