launcher: fix and improve config group boxes

This commit is contained in:
somewhatlurker
2019-10-06 00:35:09 +10:00
parent 384008d8ea
commit 351bec473f
2 changed files with 7 additions and 6 deletions
@@ -1143,11 +1143,12 @@ Panel^ MakePanel(int width, int height, std::vector<ConfigOptionBase*> &cfg, Too
{
OptionMetaGroupStart* groupData = (OptionMetaGroupStart*)(cfg[i]);
GroupBox^ groupbox = gcnew GroupBox();
groupbox->Width = width - (ScaleWidth * 8);
groupbox->Height = ScaleHeight * groupData->_height;
groupbox->Width = width - (ScaleWidth * 32);
groupbox->Height = ScaleHeight * (groupData->_height);
groupbox->Left = ScaleWidth * 4;
groupbox->Top = ScaleHeight * curY;
groupbox->Text = gcnew String(groupData->_friendlyName);
groupbox->ForeColor = Drawing::Color::White;
// find the end of this group by simple iteration keeping track of indent level
int level = 1;
@@ -1163,9 +1164,9 @@ Panel^ MakePanel(int width, int height, std::vector<ConfigOptionBase*> &cfg, Too
break;
}
Panel^ groupPanel = MakePanel(groupbox->Width - (ScaleWidth * 8), groupbox->Height - (ScaleHeight * 10), std::vector<ConfigOptionBase*>(&(cfg[i + 1]), &(cfg[endidx])), tooltip, hasChanged);
groupPanel->Left = ScaleWidth * 12;
groupPanel->Top = ScaleHeight * (curY + 8);
Panel^ groupPanel = MakePanel(groupbox->Width - (ScaleWidth * 16), groupbox->Height - (ScaleHeight * 20), std::vector<ConfigOptionBase*>(&(cfg[i + 1]), &(cfg[endidx])), tooltip, hasChanged);
groupPanel->Left = ScaleWidth * 2;
groupPanel->Top = ScaleHeight * 14;
groupbox->Controls->Add(groupPanel);
outpanel->Controls->Add(groupbox);
@@ -52,7 +52,7 @@ namespace PluginConfig
for (int i = 0; i < in.len; i++)
{
// basic check for validity
if (in.options[i].data == nullptr)
if (in.options[i].data == nullptr && in.options[i].cfgType != CONFIG_GROUP_END)
break;
outvec.push_back(GetConfigOption(in.options[i]));