Initial popup window.

This commit is contained in:
James Grogan 2022-12-02 13:44:52 +00:00
parent f16dd7c0d9
commit 70220fc6e9
22 changed files with 253 additions and 15 deletions

View file

@ -1,10 +1,36 @@
#include "TopBar.h"
#include "Color.h"
#include "Theme.h"
#include "Button.h"
#include "TopBarMenu.h"
TopBar::TopBar()
{
setBackgroundColor(Color(50, 50, 50));
setBackgroundColor(Theme::getBackgroundPrimary());
auto fileButton = Button::Create();
fileButton->setLabel("File");
fileButton->setBackgroundColor(Theme::getBackgroundPrimary());
fileButton->setMargin(2);
fileButton->setMaxWidth(60);
auto onClick = [this](Widget* self){
if(this)
{
auto menu = std::make_unique<TopBarMenu>();
auto window = getTopLevelWindow();
window->addPopup(std::move(menu));
};
};
fileButton->setOnClickFunction(onClick);
addWidget(std::move(fileButton));
}
TopBar::~TopBar()
{
}
std::unique_ptr<TopBar> TopBar::Create()