Ticket #3637: filetypes.patch
File filetypes.patch, 3.0 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
23 23 #include <Window.h> 24 24 25 25 #include <MenuPrivate.h> 26 #include <BMCPrivate.h> 26 27 27 28 #include "utf8_functions.h" 28 29 … … 398 399 399 400 fSuper->SetDrawingMode(B_OP_OVER); 400 401 402 float frameWidth = fBounds.Width(); 403 if( MenuPrivate(fSuper).State() == MENU_STATE_CLOSED ) { 404 frameWidth = fSuper->Frame().Width(); 405 _BMCMenuBar_* menuBar = dynamic_cast<_BMCMenuBar_*>(fSuper); 406 if (menuBar and menuBar->IsPopUpMarkerShown()) 407 frameWidth-=15; 408 //-15 for popup indicator , see BMCMenuBar::Draw() 409 } 410 401 411 // truncate if needed 402 // TODO: Actually, this is still never triggered 403 if (fBounds.Width() > labelWidth) 412 if (frameWidth > labelWidth) 404 413 fSuper->DrawString(fLabel); 405 414 else { 406 415 char *truncatedLabel = new char[strlen(fLabel) + 4]; 407 TruncateLabel(f Bounds.Width(), truncatedLabel);416 TruncateLabel(frameWidth, truncatedLabel); 408 417 fSuper->DrawString(truncatedLabel); 409 418 delete[] truncatedLabel; 410 419 }