Ticket #3637: filetypes.2.patch
File filetypes.2.patch, 2.9 KB (added by , 14 years ago) |
---|
-
src/preferences/filetypes/FileTypesWindow.cpp
512 512 513 513 innerRect.right = innerRect.left - 6.0f; 514 514 innerRect.left = 8.0f; 515 BView* constrainingView = new BView(innerRect, NULL, B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW);516 constrainingView->SetViewColor(topView->ViewColor());517 515 518 fPreferredField = new BMenuField(innerRect .OffsetToCopy(B_ORIGIN), "preferred",519 NULL, menu );516 fPreferredField = new BMenuField(innerRect, "preferred", 517 NULL, menu, true, B_FOLLOW_LEFT_RIGHT ); 520 518 float width; 521 519 fPreferredField->GetPreferredSize(&width, &height); 522 520 fPreferredField->ResizeTo(innerRect.Width(), height); 523 521 fPreferredField->MoveBy(0.0f, (innerRect.Height() - height) / 2.0f); 524 constrainingView->AddChild(fPreferredField);525 // we embed the menu field in another view to make it behave like526 // we want so that it can't obscure other elements with larger527 // labels528 522 529 fPreferredBox->AddChild( constrainingView);523 fPreferredBox->AddChild( fPreferredField ); 530 524 531 525 // "Extra Attributes" group 532 526 -
src/kits/interface/Menu.cpp
203 203 fAscent(-1.0f), 204 204 fDescent(-1.0f), 205 205 fFontHeight(-1.0f), 206 fState( 0),206 fState(MENU_STATE_CLOSED), 207 207 fLayout(layout), 208 208 fExtraRect(NULL), 209 209 fMaxContentWidth(0.0f), … … 272 272 fAscent(-1.0f), 273 273 fDescent(-1.0f), 274 274 fFontHeight(-1.0f), 275 fState( 0),275 fState(MENU_STATE_CLOSED), 276 276 fLayout(B_ITEMS_IN_ROW), 277 277 fExtraRect(NULL), 278 278 fMaxContentWidth(0.0f), … … 1255 1255 fAscent(-1.0f), 1256 1256 fDescent(-1.0f), 1257 1257 fFontHeight(-1.0f), 1258 fState( 0),1258 fState(MENU_STATE_CLOSED), 1259 1259 fLayout(layout), 1260 1260 fExtraRect(NULL), 1261 1261 fMaxContentWidth(0.0f), -
src/kits/interface/MenuItem.cpp
398 398 399 399 fSuper->SetDrawingMode(B_OP_OVER); 400 400 401 float frameWidth = fBounds.Width(); 402 if(MenuPrivate(fSuper).State() == MENU_STATE_CLOSED) { 403 float rightMargin,leftMargin; 404 MenuPrivate(fSuper).GetItemMargins( &leftMargin,NULL,&rightMargin,NULL); 405 frameWidth = fSuper->Frame().Width() - (rightMargin+leftMargin); 406 } 407 401 408 // truncate if needed 402 // TODO: Actually, this is still never triggered 403 if (fBounds.Width() > labelWidth) 409 if (frameWidth > labelWidth) 404 410 fSuper->DrawString(fLabel); 405 411 else { 406 412 char *truncatedLabel = new char[strlen(fLabel) + 4]; 407 TruncateLabel(f Bounds.Width(), truncatedLabel);413 TruncateLabel(frameWidth, truncatedLabel); 408 414 fSuper->DrawString(truncatedLabel); 409 415 delete[] truncatedLabel; 410 416 }