ui/api: Added sidebar

This commit is contained in:
WerWolv
2022-01-22 22:03:19 +01:00
parent d5d1577b43
commit 4e047beabb
5 changed files with 78 additions and 3 deletions

View File

@@ -312,6 +312,10 @@ namespace hex {
getToolbarItems().push_back(function);
}
void ContentRegistry::Interface::addSidebarItem(const std::string &icon, const impl::DrawCallback &function) {
getSidebarItems().push_back({ icon, function });
}
void ContentRegistry::Interface::addLayout(const std::string &unlocalizedName, const impl::LayoutFunction &function) {
log::info("Added new layout: {}", unlocalizedName);
@@ -332,6 +336,9 @@ namespace hex {
std::vector<ContentRegistry::Interface::impl::DrawCallback>& ContentRegistry::Interface::getToolbarItems() {
return SharedData::toolbarItems;
}
std::vector<ContentRegistry::Interface::impl::SidebarItem>& ContentRegistry::Interface::getSidebarItems() {
return SharedData::sidebarItems;
}
std::vector<ContentRegistry::Interface::impl::Layout>& ContentRegistry::Interface::getLayouts() {
return SharedData::layouts;