diff --git a/src/add-ons/tracker/filetype/AppTypeAppFlagsView.cpp b/src/add-ons/tracker/filetype/AppTypeAppFlagsView.cpp index 45c34079f5..eefb907791 100644 --- a/src/add-ons/tracker/filetype/AppTypeAppFlagsView.cpp +++ b/src/add-ons/tracker/filetype/AppTypeAppFlagsView.cpp @@ -22,8 +22,8 @@ AppTypeAppFlagsView::AppTypeAppFlagsView(BRect viewFrame) const char * singleRadioButtonLabel = "Single Launch"; float singleRadioButtonStringWidth = StringWidth(singleRadioButtonLabel); BRect singleRadioButtonFrame = fAppFlagsBox->Bounds(); - singleRadioButtonFrame.top += fAppFlagsCheckBox->Bounds().Height()/2 + 10; - singleRadioButtonFrame.left += 10; + singleRadioButtonFrame.top = fAppFlagsCheckBox->Bounds().Height()/2 + 10; + singleRadioButtonFrame.left = 10; singleRadioButtonFrame.right -= 10; fAppFlagsSingleRadioButton = new BRadioButton(singleRadioButtonFrame, singleRadioButtonLabel, @@ -31,12 +31,13 @@ AppTypeAppFlagsView::AppTypeAppFlagsView(BRect viewFrame) fAppFlagsBox->AddChild(fAppFlagsSingleRadioButton); fAppFlagsSingleRadioButton->GetPreferredSize(&width,&height); fAppFlagsSingleRadioButton->ResizeTo(width,height); + float leftWidth = width; const char * multipleRadioButtonLabel = "Multiple Launch"; float multipleRadioButtonStringWidth = StringWidth(multipleRadioButtonLabel); BRect multipleRadioButtonFrame = fAppFlagsBox->Bounds(); multipleRadioButtonFrame.top = fAppFlagsSingleRadioButton->Frame().bottom; - multipleRadioButtonFrame.left += 10; + multipleRadioButtonFrame.left = 10; multipleRadioButtonFrame.right -= 10; fAppFlagsMultipleRadioButton = new BRadioButton(multipleRadioButtonFrame, multipleRadioButtonLabel, @@ -44,12 +45,13 @@ AppTypeAppFlagsView::AppTypeAppFlagsView(BRect viewFrame) fAppFlagsBox->AddChild(fAppFlagsMultipleRadioButton); fAppFlagsMultipleRadioButton->GetPreferredSize(&width,&height); fAppFlagsMultipleRadioButton->ResizeTo(width,height); + if (width > leftWidth) leftWidth = width; const char * exclusiveRadioButtonLabel = "Exclusive Launch"; float exclusiveRadioButtonStringWidth = StringWidth(exclusiveRadioButtonLabel); BRect exclusiveRadioButtonFrame = fAppFlagsBox->Bounds(); exclusiveRadioButtonFrame.top = fAppFlagsMultipleRadioButton->Frame().bottom; - exclusiveRadioButtonFrame.left += 10; + exclusiveRadioButtonFrame.left = 10; exclusiveRadioButtonFrame.right -= 10; fAppFlagsExclusiveRadioButton = new BRadioButton(exclusiveRadioButtonFrame, exclusiveRadioButtonLabel, @@ -57,8 +59,37 @@ AppTypeAppFlagsView::AppTypeAppFlagsView(BRect viewFrame) fAppFlagsBox->AddChild(fAppFlagsExclusiveRadioButton); fAppFlagsExclusiveRadioButton->GetPreferredSize(&width,&height); fAppFlagsExclusiveRadioButton->ResizeTo(width,height); + if (width > leftWidth) leftWidth = width; + + const char * argvOnlyCheckBoxLabel = "Argv Only"; + float argvOnlyCheckBoxStringWidth = StringWidth(argvOnlyCheckBoxLabel); + BRect argvOnlyCheckBoxFrame = fAppFlagsBox->Bounds(); + argvOnlyCheckBoxFrame.top = fAppFlagsSingleRadioButton->Frame().top - 1; + argvOnlyCheckBoxFrame.left = 10 + leftWidth; + argvOnlyCheckBoxFrame.right -= 10; + fAppFlagsArgvOnlyCheckBox = new BCheckBox(argvOnlyCheckBoxFrame, + argvOnlyCheckBoxLabel, + argvOnlyCheckBoxLabel,NULL); + fAppFlagsBox->AddChild(fAppFlagsArgvOnlyCheckBox); + fAppFlagsArgvOnlyCheckBox->GetPreferredSize(&width,&height); + fAppFlagsArgvOnlyCheckBox->ResizeTo(width,height); + float rightWidth = width; - width = fAppFlagsBox->Bounds().Width(); + const char * backgroundCheckBoxLabel = "Background App"; + float backgroundCheckBoxStringWidth = StringWidth(backgroundCheckBoxLabel); + BRect backgroundCheckBoxFrame = fAppFlagsBox->Bounds(); + backgroundCheckBoxFrame.top = fAppFlagsArgvOnlyCheckBox->Frame().bottom - 1; + backgroundCheckBoxFrame.left = 10 + leftWidth; + backgroundCheckBoxFrame.right -= 10; + fAppFlagsBackgroundCheckBox = new BCheckBox(backgroundCheckBoxFrame, + backgroundCheckBoxLabel, + backgroundCheckBoxLabel,NULL); + fAppFlagsBox->AddChild(fAppFlagsBackgroundCheckBox); + fAppFlagsBackgroundCheckBox->GetPreferredSize(&width,&height); + fAppFlagsBackgroundCheckBox->ResizeTo(width,height); + if (width > rightWidth) rightWidth = width; + + width = 10 + leftWidth + rightWidth + 5; height = fAppFlagsExclusiveRadioButton->Frame().bottom + 5; fAppFlagsBox->ResizeTo(width,height); ResizeTo(width,height); diff --git a/src/add-ons/tracker/filetype/AppTypeAppFlagsView.h b/src/add-ons/tracker/filetype/AppTypeAppFlagsView.h index 417935c408..ac1c3679c8 100644 --- a/src/add-ons/tracker/filetype/AppTypeAppFlagsView.h +++ b/src/add-ons/tracker/filetype/AppTypeAppFlagsView.h @@ -20,7 +20,7 @@ private: BRadioButton * fAppFlagsMultipleRadioButton; BRadioButton * fAppFlagsExclusiveRadioButton; BCheckBox * fAppFlagsArgvOnlyCheckBox; - BCheckBox * fAppFlagsBackOnlyCheckBox; + BCheckBox * fAppFlagsBackgroundCheckBox; }; #endif // APP_TYPE_APP_FLAGS_VIEW_H diff --git a/src/add-ons/tracker/filetype/AppTypeSupportedTypesView.cpp b/src/add-ons/tracker/filetype/AppTypeSupportedTypesView.cpp index b6d9749497..445d862299 100644 --- a/src/add-ons/tracker/filetype/AppTypeSupportedTypesView.cpp +++ b/src/add-ons/tracker/filetype/AppTypeSupportedTypesView.cpp @@ -4,7 +4,29 @@ AppTypeSupportedTypesView::AppTypeSupportedTypesView(BRect viewFrame) : BView(viewFrame, "AppTypeSupportedTypesView", B_FOLLOW_ALL, B_FRAME_EVENTS|B_WILL_DRAW) { + float width = 0, height = 0; SetViewColor( ui_color(B_PANEL_BACKGROUND_COLOR) ); + + fSupportedTypesBox = new BBox(Bounds(),"box", + B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP); + fSupportedTypesBox->SetLabel("Supported Types:"); + AddChild(fSupportedTypesBox); + + const char * addButtonLabel = "Add..."; + float addButtonStringWidth = StringWidth(addButtonLabel); + BRect addButtonFrame = fSupportedTypesBox->Bounds(); + addButtonFrame.top = 10; + addButtonFrame.left = 10; + addButtonFrame.right -= 10; + fSupportedTypesAddButton = new BButton(addButtonFrame, + addButtonLabel, + addButtonLabel,NULL); + fSupportedTypesBox->AddChild(fSupportedTypesAddButton); + fSupportedTypesAddButton->GetPreferredSize(&width,&height); + fSupportedTypesAddButton->ResizeTo(width,height); + float leftWidth = width; + + } AppTypeSupportedTypesView::~AppTypeSupportedTypesView() diff --git a/src/add-ons/tracker/filetype/AppTypeSupportedTypesView.h b/src/add-ons/tracker/filetype/AppTypeSupportedTypesView.h index 9fcc521a06..75fa5d81c8 100644 --- a/src/add-ons/tracker/filetype/AppTypeSupportedTypesView.h +++ b/src/add-ons/tracker/filetype/AppTypeSupportedTypesView.h @@ -2,6 +2,7 @@ #define APP_TYPE_SUPPORTED_TYPES_VIEW_H #include +#include #include #include #include diff --git a/src/add-ons/tracker/filetype/AppTypeView.cpp b/src/add-ons/tracker/filetype/AppTypeView.cpp index 3caa8e19d5..526a33c61e 100644 --- a/src/add-ons/tracker/filetype/AppTypeView.cpp +++ b/src/add-ons/tracker/filetype/AppTypeView.cpp @@ -29,6 +29,13 @@ AppTypeView::AppTypeView(BRect viewFrame) fAppFlagsView = new AppTypeAppFlagsView(appFlagsViewFrame); AddChild(fAppFlagsView); + BRect appSupportedTypesViewFrame = Bounds(); + appSupportedTypesViewFrame.top = fAppFlagsView->Frame().bottom + 10; + appSupportedTypesViewFrame.left += 10; + appSupportedTypesViewFrame.right -= 10; + fSupportedTypesView = new AppTypeSupportedTypesView(appSupportedTypesViewFrame); + AddChild(fSupportedTypesView); + BRect versionInfoViewFrame = Bounds(); versionInfoViewFrame.top = Bounds().Height()/2; fVersionInfoView = new AppTypeVersionInfoView(versionInfoViewFrame); diff --git a/src/add-ons/tracker/filetype/FileTypeApp.cpp b/src/add-ons/tracker/filetype/FileTypeApp.cpp index 2fa704b7f2..aa38b81470 100644 --- a/src/add-ons/tracker/filetype/FileTypeApp.cpp +++ b/src/add-ons/tracker/filetype/FileTypeApp.cpp @@ -233,7 +233,7 @@ BFilePanel * FileTypeApp::OpenPanel() { if (fOpenPanel == 0) { - fOpenPanel = new BFilePanel(B_OPEN_PANEL); + fOpenPanel = new BFilePanel(B_OPEN_PANEL,NULL,NULL,B_FILE_NODE|B_DIRECTORY_NODE); } return fOpenPanel; }