mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-13 00:47:35 +00:00
Add option to have the search widget under item panel (#364)
* Add option to have the search widget under item panel * update bs+sa * Make heights consistent --------- Co-authored-by: Martin Robertz <dream-master@gmx.net>
This commit is contained in:
1 parent
9218e233aa
commit
a12fadb10d
4 files changed
+37
-11
No files matched your search
@@ -166,19 +166,30 @@ public class ItemPanel extends PanelWidget {
|
||||
}
|
||||
|
||||
protected int resizeFooter(GuiContainer gui) {
|
||||
if (!NEIClientConfig.showItemQuantityWidget()) return 0;
|
||||
|
||||
final int BUTTON_SIZE = 16;
|
||||
if (!NEIClientConfig.showItemQuantityWidget() && NEIClientConfig.isSearchWidgetCentered()) return 0;
|
||||
|
||||
final int BUTTON_SIZE = 20;
|
||||
more.w = less.w = BUTTON_SIZE;
|
||||
more.h = less.h = quantity.h = BUTTON_SIZE;
|
||||
quantity.h = BUTTON_SIZE;
|
||||
|
||||
less.x = x;
|
||||
more.x = x + w - BUTTON_SIZE;
|
||||
more.y = less.y = quantity.y = y + h - BUTTON_SIZE;
|
||||
if (NEIClientConfig.isSearchWidgetCentered()) {
|
||||
more.h = less.h = BUTTON_SIZE;
|
||||
more.x = x + w - BUTTON_SIZE;
|
||||
more.y = less.y = quantity.y = y + h - BUTTON_SIZE;
|
||||
less.x = x;
|
||||
quantity.x = x + BUTTON_SIZE + 2;
|
||||
quantity.w = more.x - quantity.x - 2;
|
||||
} else {
|
||||
quantity.x = (int) (x + (w * 0.7)) + 3;
|
||||
quantity.y = y + h - BUTTON_SIZE;
|
||||
quantity.w = (int) ((w * 0.3) - BUTTON_SIZE - 1);
|
||||
|
||||
quantity.x = x + BUTTON_SIZE + 2;
|
||||
quantity.w = more.x - quantity.x - 2;
|
||||
more.h = less.h = BUTTON_SIZE / 2;
|
||||
more.y = y + h - (more.h * 2);
|
||||
|
||||
less.x = more.x = quantity.x + quantity.w;
|
||||
less.y = more.y + more.h;
|
||||
}
|
||||
|
||||
return BUTTON_SIZE + 2;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user