Skip to content

Commit 6fbf055

Browse files
committed
fix scroll bar not rendering
(why is the default thickness -1??) also add extra line spacing after title
1 parent 7938d5b commit 6fbf055

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/main/java/gregtech/api/metatileentity/multiblock/ui/MultiblockUIBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public MultiblockUIBuilder structureFormed(boolean structureFormed) {
108108
}
109109

110110
public MultiblockUIBuilder title(String lang) {
111-
addKey(KeyUtil.lang(TextFormatting.WHITE, lang));
111+
addOperation(Operation.addLine(KeyUtil.lang(TextFormatting.WHITE, lang)).spaceLine(2));
112112
return this;
113113
}
114114

src/main/java/gregtech/common/mui/widget/ScrollableTextWidget.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.cleanroommc.modularui.screen.viewport.ModularGuiContext;
2020
import com.cleanroommc.modularui.theme.TextFieldTheme;
2121
import com.cleanroommc.modularui.theme.WidgetTheme;
22+
import com.cleanroommc.modularui.theme.WidgetThemeEntry;
2223
import com.cleanroommc.modularui.utils.HoveredWidgetList;
2324
import com.cleanroommc.modularui.widget.Widget;
2425
import com.cleanroommc.modularui.widget.scroll.ScrollArea;
@@ -51,7 +52,7 @@ public ScrollableTextWidget() {
5152

5253
@Override
5354
public void onInit() {
54-
this.scroll.setScrollData(ScrollData.of(GuiAxis.Y));
55+
this.scroll.setScrollData(ScrollData.of(GuiAxis.Y, false, 4));
5556
}
5657

5758
@Override
@@ -189,8 +190,8 @@ private void drawText(ModularGuiContext context) {
189190
public void postDraw(ModularGuiContext context, boolean transformed) {
190191
if (!transformed) {
191192
Stencil.remove();
192-
WidgetTheme theme = context.getTheme().getScrollbarTheme().getTheme(isHovering());
193-
this.scroll.drawScrollbar(context, theme, theme.getBackground());
193+
WidgetThemeEntry<WidgetTheme> theme = context.getTheme().getScrollbarTheme();
194+
this.scroll.drawScrollbar(context, theme.getTheme(isHovering()), theme.getTheme().getBackground());
194195
}
195196
}
196197

0 commit comments

Comments
 (0)