From 8ff331a4d8a5e8fc6e900345b51e3b234fc228db Mon Sep 17 00:00:00 2001 From: shedaniel Date: Wed, 6 Jul 2022 17:36:15 +0800 Subject: Update information page design --- .../categories/DefaultInformationCategory.java | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'default-plugin/src/main/java/me') diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java index 0e56ea5b3..94a387ffc 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java @@ -115,9 +115,9 @@ public class DefaultInformationCategory implements DisplayCategory setupDisplay(DefaultInformationDisplay display, Rectangle bounds) { List widgets = Lists.newArrayList(); + widgets.add(Widgets.createRecipeBase(bounds)); widgets.add(Widgets.createSlot(new Point(bounds.getCenterX() - 8, bounds.y + 15 - 9)).entries(display.getEntryStacks())); - Rectangle rectangle = new Rectangle(bounds.getCenterX() - (bounds.width / 2), bounds.y + 35 - 9, bounds.width, bounds.height - 40 + 9); - widgets.add(Widgets.createSlotBase(rectangle)); + Rectangle rectangle = new Rectangle(bounds.getCenterX() - (bounds.width * 0.95 / 2), bounds.y + 35 - 9, bounds.width * 0.95, bounds.height - 40 + 9); widgets.add(new ScrollableTextWidget(rectangle, display.getTexts())); return widgets; } @@ -163,9 +163,9 @@ public class DefaultInformationCategory implements DisplayCategory 8) { + fillGradient(matrices, innerBounds.x, innerBounds.y, innerBounds.getMaxX(), innerBounds.y + 16, 0xFFC6C6C6, 0x00C6C6C6); + } + if (scrolling.getMaxScroll() - scrolling.scrollAmount() > 8) { + fillGradient(matrices, innerBounds.x, innerBounds.getMaxY() - 16, innerBounds.getMaxX(), innerBounds.getMaxY(), 0x00C6C6C6, 0xFFC6C6C6); + } + } try (CloseableScissors scissors = scissor(matrices, scrolling.getBounds())) { - scrolling.renderScrollBar(0xff000000, 1, REIRuntime.getInstance().isDarkThemeEnabled() ? 0.8f : 1f); + scrolling.renderScrollBar(0, 1, 1f); } } -- cgit