Add option to display tabs on the right and bottom (#3847)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Daniel Sage
2022-07-23 10:09:12 -04:00
committed by GitHub
parent 3b9ac7456a
commit c58552781d
6 changed files with 322 additions and 74 deletions
+22 -10
View File
@@ -145,28 +145,40 @@ void GeneralPage::initLayout(GeneralPageView &layout)
return fuzzyToFloat(args.value, 1.f);
});
ComboBox *tabDirectionDropdown =
layout.addDropdown<std::underlying_type<NotebookTabDirection>::type>(
"Tab layout", {"Horizontal", "Vertical"}, s.tabDirection,
layout.addDropdown<std::underlying_type<NotebookTabLocation>::type>(
"Tab layout", {"Top", "Left", "Right", "Bottom"}, s.tabDirection,
[](auto val) {
switch (val)
{
case NotebookTabDirection::Horizontal:
return "Horizontal";
case NotebookTabDirection::Vertical:
return "Vertical";
case NotebookTabLocation::Top:
return "Top";
case NotebookTabLocation::Left:
return "Left";
case NotebookTabLocation::Right:
return "Right";
case NotebookTabLocation::Bottom:
return "Bottom";
}
return "";
},
[](auto args) {
if (args.value == "Vertical")
if (args.value == "Bottom")
{
return NotebookTabDirection::Vertical;
return NotebookTabLocation::Bottom;
}
else if (args.value == "Left")
{
return NotebookTabLocation::Left;
}
else if (args.value == "Right")
{
return NotebookTabLocation::Right;
}
else
{
// default to horizontal
return NotebookTabDirection::Horizontal;
// default to top
return NotebookTabLocation::Top;
}
},
false);