Skip to content

Commit 930c963

Browse files
committed
List height fixes
1 parent 688c1e2 commit 930c963

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

src/Tabs/EditTab.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,15 @@ public override void Initialize()
4040
regionSelector = new OpComboBox(OIUtil.CosmeticBind(""),
4141
new(SIDE_PADDING, MENU_SIZE - SIDE_PADDING - 30f),
4242
TOPBAR_UNIT_WIDTH * 2 + ITEM_GAP,
43-
regionList.Select((x, i) => new ListItem(x, $"({x}) {Data.RegionNameFor(x, null)}", i)).ToList());
43+
regionList.Select((x, i) => new ListItem(x, $"({x}) {Data.RegionNameFor(x, null)}", i)).ToList())
44+
{
45+
listHeight = 20
46+
};
4447
regionSelector.OnValueChanged += RegionSelector_OnValueChanged;
45-
scugSelector = new OpComboBox(OIUtil.CosmeticBind(""), new(SIDE_PADDING + TOPBAR_UNIT_WIDTH * 2 + ITEM_GAP * 2, regionSelector.pos.y), TOPBAR_UNIT_WIDTH, [""]);
48+
scugSelector = new OpComboBox(OIUtil.CosmeticBind(""), new(SIDE_PADDING + TOPBAR_UNIT_WIDTH * 2 + ITEM_GAP * 2, regionSelector.pos.y), TOPBAR_UNIT_WIDTH, [""])
49+
{
50+
listHeight = 10
51+
};
4652
scugSelector.OnValueChanged += ScugSelector_OnValueChanged;
4753
var saveButton = new OpSimpleButton(new(MENU_SIZE - SIDE_PADDING - TOPBAR_UNIT_WIDTH, MENU_SIZE - SIDE_PADDING - 30f), new(TOPBAR_UNIT_WIDTH, 24f), "SAVE")
4854
{
@@ -53,7 +59,10 @@ public override void Initialize()
5359
// Bottom of menu
5460
const string IMPORT_TEXT = "Import from: ";
5561
var importLabel = new OpLabel(SIDE_PADDING, SIDE_PADDING + (12f - LabelTest.LineHeight(false) / 2f), IMPORT_TEXT, false);
56-
importSelector = new OpComboBox(OIUtil.CosmeticBind(""), new(importLabel.pos.x + LabelTest.GetWidth(IMPORT_TEXT, false) + 6f, importLabel.pos.y), TOPBAR_UNIT_WIDTH, [""]);
62+
importSelector = new OpComboBox(OIUtil.CosmeticBind(""), new(importLabel.pos.x + LabelTest.GetWidth(IMPORT_TEXT, false) + 6f, importLabel.pos.y), TOPBAR_UNIT_WIDTH, [""])
63+
{
64+
listHeight = 10
65+
};
5766
var importButton = new OpSimpleButton(new(importSelector.pos.x + importSelector.size.x + 6f, importSelector.pos.y), new Vector2(80f, 24f), "IMPORT");
5867
importButton.OnClick += ImportButton_OnClick;
5968

src/Tabs/GenerateTab.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ public override void Initialize()
4343
allRegions.Add(new ListItem("", ""));
4444
}
4545

46-
regionSelector = new OpComboBox(OIUtil.CosmeticBind(""), new Vector2(PADDING, MENU_SIZE - PADDING - BIG_LINE_HEIGHT - MARGIN - 24f), 200f, allRegions);
46+
regionSelector = new OpComboBox(OIUtil.CosmeticBind(""), new Vector2(PADDING, MENU_SIZE - PADDING - BIG_LINE_HEIGHT - MARGIN - 24f), 200f, allRegions)
47+
{
48+
listHeight = 20
49+
};
4750
regionAdd = new OpSimpleButton(new Vector2(regionSelector.pos.x + regionSelector.size.x + MARGIN, regionSelector.pos.y), new Vector2(60f, 24f), "ADD");
4851
regionAdd.OnClick += RegionAdd_OnClick;
4952

@@ -58,12 +61,14 @@ public override void Initialize()
5861

5962
AddItems(
6063
new OpShinyLabel(PADDING, MENU_SIZE - PADDING - BIG_LINE_HEIGHT, "GENERATE", true),
61-
regionSelector, regionAdd,
6264
new OpLabel(PADDING, regionSelector.pos.y - PADDING - BIG_LINE_HEIGHT, "QUEUE", true),
6365
queueBox,
6466
new OpLabel(PADDING, queueBox.pos.y - PADDING - BIG_LINE_HEIGHT, "CURRENT", true),
6567
currentBox,
66-
startButton
68+
startButton,
69+
70+
// for z-index ordering reasons
71+
regionSelector, regionAdd
6772
);
6873
}
6974

src/Tabs/ScreenshotTab.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public override void Initialize()
6262
.ToList(); // OpComboBox wants it as a list
6363
comboRegions = new OpComboBox(OIUtil.CosmeticBind(""), new Vector2(10f, 530f), 175f, regionList)
6464
{
65-
listHeight = (ushort)Math.Min(20, RegionNames.Count)
65+
listHeight = 20
6666
};
6767
var addButton = new OpSimpleButton(new Vector2(195f, 530f), new Vector2(40f, 24f), "ADD");
6868
var addAllButton = new OpSimpleButton(new Vector2(245f, 530f), new Vector2(40f, 24f), "ALL");

0 commit comments

Comments
 (0)