修改设置界面

This commit is contained in:
bob
2025-05-29 18:03:24 +08:00
parent cdcb007d6d
commit f421288244
306 changed files with 41744 additions and 612 deletions

View File

@@ -11,6 +11,7 @@ namespace NBF
{
public const string URL = "ui://6hgkvlaufcfggr";
public Controller showType;
public GList List;
public GButton BtnUserHead;
public BtnInputControl BtnPrev;
@@ -20,6 +21,7 @@ namespace NBF
{
base.ConstructFromXML(xml);
showType = GetController("showType");
List = (GList)GetChild("List");
BtnUserHead = (GButton)GetChild("BtnUserHead");
BtnPrev = (BtnInputControl)GetChild("BtnPrev");

View File

@@ -39,25 +39,25 @@ namespace NBF
}
}
public void SetTabs(List<TabListData> tabList, int selectIndex = 0)
public void SetTabs<T>(List<T> tabList, int selectIndex = 0) where T : TabListData
{
List.RemoveChildrenToPool();
var width = 0f;
var listWidth = 0f;
for (int i = 0; i < tabList.Count; i++)
{
var tabData = tabList[i];
var tabItem = List.AddItemFromPool().asButton;
tabItem.title = tabData.Tab.Name;
width += tabItem.width;
listWidth += tabItem.width;
if (i > 0)
{
width += List.columnGap;
listWidth += List.columnGap;
}
}
Log.Info($"Set tab index={List.selectedIndex}");
List.selectedIndex = selectIndex;
List.width = width;
List.width = listWidth;
OnClickItem();
}