The subset dropdown now shows only when the bookmarks aren't visible (there isn't enough room for it otherwise).

This commit is contained in:
Jason Mitchell authored and Jason Mitchell committed 2021-04-12 20:20:36 -07:00
1 parent c0be69f85f
commit 5bfbf250cc
3 files changed
+14 -6

No files matched your search

@@ -30,6 +30,7 @@ public class LayoutStyleMinecraft extends LayoutStyle
public int buttonCount;
public int leftSize;
public int numButtons;
public int startingButtonY;
@Override
public String getName() {
@@ -60,6 +61,8 @@ public class LayoutStyleMinecraft extends LayoutStyle
public void layout(GuiContainer gui, VisiblityData visiblity) {
reset();
startingButtonY = visiblity.showBookmarkPanel ? 3 : 23;
leftSize = ItemPanels.bookmarkPanel.getWidth(gui);
numButtons = Math.max(leftSize / 18, 1);
@@ -136,9 +139,10 @@ public class LayoutStyleMinecraft extends LayoutStyle
searchField.y = gui.height - searchField.h - 2;
dropDown.x = gui.guiLeft;
dropDown.x = 2;
dropDown.h = 20;
dropDown.w = Math.min(itemPanel.prev.x - dropDown.x - 3, 100);
dropDown.w = itemPanel.x - dropDown.x - 3;
searchField.h = 20;
searchField.w = 150;
searchField.x = (gui.width - searchField.w) / 2;
@@ -151,7 +155,7 @@ public class LayoutStyleMinecraft extends LayoutStyle
public void layoutButton(Button button) {
button.x = 2 + (buttonCount % numButtons) * 20;
button.y = 3 + (buttonCount / numButtons) * 18;
button.y = startingButtonY + (buttonCount / numButtons) * 18;
button.h = 17;
button.w = button.contentWidth() + 6;