Clean project structure.

This commit is contained in:
jmsgrogan 2023-01-17 10:13:25 +00:00
parent 78a4fa99ff
commit 947bf937fd
496 changed files with 206 additions and 137 deletions

39
src/ui/client/TopBar.cpp Normal file
View file

@ -0,0 +1,39 @@
#include "TopBar.h"
#include "Color.h"
#include "Theme.h"
#include "Button.h"
#include "TopBarMenu.h"
TopBar::TopBar()
{
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()
{
return std::make_unique<TopBar>();
}