package com.raoulvdberge.refinedstorage.screen.widget;

import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.client.config.GuiCheckBox;

public class CheckBoxWidget extends GuiCheckBox {
    private IPressable onPress;

    public CheckBoxWidget(int xPos, int yPos, String displayString, boolean isChecked, IPressable onPress) {
        super(xPos, yPos, displayString, isChecked);

        this.onPress = onPress;
        this.width = Minecraft.getInstance().fontRenderer.getStringWidth(displayString) + 2 + 11 + 20;
    }

    @Override
    public void onPress() {
        super.onPress();

        onPress.onPress(this);
    }
}

@@ -149,89 +149,316 @@
 ox;%0A
-%0Apublic class CheckBoxWidget extends GuiCheckBox %7B%0A    private IPressable onPress
+import net.minecraftforge.fml.client.config.GuiUtils;%0A%0A// @Volatile: Copied from Forge 1.12. Remove this if GuiCheckBox gets ported over correctly.%0Apublic class CheckBoxWidget extends GuiCheckBox %7B%0A    private static final int BOX_WIDTH = 13;%0A%0A    private IPressable onPress;%0A    private String displayString
 ;%0A%0A 
@@ -647,24 +647,68 @@
  = onPress;%0A
+        this.displayString = displayString;%0A
         this
@@ -789,20 +789,739 @@
 ) + 
-2 + 11 + 20;
+BOX_WIDTH + 3;%0A    %7D%0A%0A    @Override%0A    public void renderButton(int mouseX, int mouseY, float partial) %7B%0A        if (visible) %7B%0A            GuiUtils.drawContinuousTexturedBox(WIDGETS_LOCATION, x, y, 0, 46, BOX_WIDTH, height, 200, 20, 2, 3, 2, 2, 0);%0A%0A            int color = 14737632;%0A%0A            if (packedFGColor != 0) %7B%0A                color = packedFGColor;%0A            %7D else if (!active) %7B%0A                color = 10526880;%0A            %7D%0A%0A            if (isChecked()) %7B%0A                drawCenteredString(Minecraft.getInstance().fontRenderer, %22x%22, x + BOX_WIDTH / 2 + 1, y + 1, 14737632);%0A            %7D%0A%0A            drawString(Minecraft.getInstance().fontRenderer, displayString, x + BOX_WIDTH + 2, y + 2, color);%0A        %7D
 %0A   

Fix CheckBoxWidget