benchmark_toolbox: reorganize tabs
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user