Patch by barber which actually make menu color changes work, plus some other changes. Note that this shows some problems in how BMenuItems are drawn (wrong colors)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16963 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -61,7 +61,7 @@ ColorWindow::MessageReceived(BMessage *msg)
|
||||
get_menu_info(&info);
|
||||
info.background_color = colorPicker->ValueAsColor();
|
||||
set_menu_info(&info);
|
||||
be_app->PostMessage(UPDATE_WINDOW);
|
||||
be_app->PostMessage(MENU_COLOR);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -17,6 +17,7 @@ MenuBar::MenuBar()
|
||||
get_menu_info(&info);
|
||||
build_menu();
|
||||
set_menu();
|
||||
SetItemMargins(14.0, 2.0, 20.0, 0.0);
|
||||
}
|
||||
|
||||
|
||||
@@ -149,5 +150,6 @@ MenuBar::Update()
|
||||
void
|
||||
MenuBar::FrameResized(float width, float height)
|
||||
{
|
||||
Window()->ResizeTo(width + 80, height + 55);
|
||||
Window()->PostMessage(UPDATE_WINDOW);
|
||||
}
|
||||
|
||||
@@ -30,18 +30,18 @@ MenuWindow::MenuWindow(BRect rect)
|
||||
menuView->AddChild(menuBar);
|
||||
|
||||
// resize the window according to the size of menuBar
|
||||
ResizeTo((menuBar->Frame().right + 35), (menuBar->Frame().bottom + 45));
|
||||
ResizeTo((menuBar->Frame().right + 40), (menuBar->Frame().bottom + 45));
|
||||
|
||||
BRect menuBarFrame = menuBar->Frame();
|
||||
BRect buttonFrame(menuBarFrame.left, menuBarFrame.bottom + 10, menuBarFrame.left + 75, menuBarFrame.bottom + 30);
|
||||
|
||||
defaultButton = new BButton(buttonFrame, "Default", "Defaults", new BMessage(MENU_DEFAULT),
|
||||
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM, B_WILL_DRAW | B_NAVIGABLE);
|
||||
B_FOLLOW_H_CENTER | B_FOLLOW_BOTTOM, B_WILL_DRAW | B_NAVIGABLE);
|
||||
menuView->AddChild(defaultButton);
|
||||
|
||||
buttonFrame.OffsetBy(buttonFrame.Width() + 20, 0);
|
||||
revertButton = new BButton(buttonFrame, "Revert", "Revert", new BMessage(MENU_REVERT),
|
||||
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM, B_WILL_DRAW | B_NAVIGABLE);
|
||||
B_FOLLOW_H_CENTER | B_FOLLOW_BOTTOM, B_WILL_DRAW | B_NAVIGABLE);
|
||||
revertButton->SetEnabled(false);
|
||||
menuView->AddChild(revertButton);
|
||||
|
||||
@@ -152,8 +152,9 @@ MenuWindow::MessageReceived(BMessage *msg)
|
||||
break;
|
||||
|
||||
case MENU_COLOR:
|
||||
set_menu_info(&info);
|
||||
(new BAlert("test","we made it","cool"))->Go();
|
||||
get_menu_info(&info);
|
||||
revert = true;
|
||||
Update();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user