benchmark_toolbox: reorganize tabs

This commit is contained in:
souldbminersmwc
2026-06-11 19:07:14 -04:00
parent 65eb5f8903
commit 319fa2bf8f
5 changed files with 36 additions and 7 deletions

View File

@@ -84,6 +84,11 @@ class Sidebar : public ScrollingFrame
*/
void addItem(std::string label, GenericEvent::Callback focusCallback);
/**
* Adds a non-focusable section header to this sidebar.
*/
void addHeader(std::string label);
/**
* Adds a separator to this sidebar.
*/

View File

@@ -37,6 +37,7 @@ class TabFrame : public AppletFrame
void handleXMLElement(tinyxml2::XMLElement* element) override;
void addTab(std::string label, TabViewCreator creator);
void addHeader(std::string label);
void addSeparator();
static View* create();

View File

@@ -157,6 +157,19 @@ void Sidebar::addItem(std::string label, GenericEvent::Callback focusCallback)
this->contentBox->addView(item);
}
void Sidebar::addHeader(std::string label)
{
Label* header = new Label();
header->setText(label);
header->setFontSize(15.0f);
header->setTextColor(nvgRGB(120, 130, 140));
header->setMarginTop(18.0f);
header->setMarginBottom(4.0f);
header->setMarginLeft(12.0f);
this->contentBox->addView(header);
}
void Sidebar::addSeparator()
{
this->contentBox->addView(new SidebarSeparator());

View File

@@ -75,6 +75,11 @@ void TabFrame::addTab(std::string label, TabViewCreator creator)
});
}
void TabFrame::addHeader(std::string label)
{
this->sidebar->addHeader(label);
}
void TabFrame::addSeparator()
{
this->sidebar->addSeparator();