More flexible Line Separators

This commit is contained in:
Frank 2022-07-19 19:56:22 +02:00
parent fab4107dbe
commit 200385c73e
4 changed files with 25 additions and 5 deletions

View file

@ -235,12 +235,28 @@ public abstract class AbstractStack<R extends ComponentRenderer, T extends Abstr
return c;
}
public HLine addHorizontalSeparator(int height) {
return addHLine(Value.relative(1.0 / 1.618033988749894), Value.fixed(height));
}
public HLine addHorizontalLine(int height) {
return addHLine(Value.fill(), Value.fixed(height));
}
public HLine addHLine(Value width, Value height) {
HLine l = new HLine(width, height);
add(l);
return l;
}
public VLine addVerticalSeparator(int width) {
return addVLine(Value.fixed(width), Value.relative(1.0 / 1.618033988749894));
}
public VLine addVerticalLine(int width) {
return addVLine(Value.fixed(width), Value.fill());
}
public VLine addVLine(Value width, Value height) {
VLine l = new VLine(width, height);
add(l);

View file

@ -9,10 +9,12 @@ import org.betterx.ui.layout.values.Value;
import com.mojang.blaze3d.vertex.PoseStack;
public class HLine extends CustomRenderComponent {
private int color = ColorUtil.WHITE;
private int color = ColorUtil.DEFAULT_TEXT;
public HLine(Value width, Value height) {
super(width, height);
this.vAlign = Alignment.CENTER;
this.hAlign = Alignment.CENTER;
}
public HLine setColor(int color) {

View file

@ -9,10 +9,12 @@ import org.betterx.ui.layout.values.Value;
import com.mojang.blaze3d.vertex.PoseStack;
public class VLine extends CustomRenderComponent {
private int color = ColorUtil.WHITE;
private int color = ColorUtil.DEFAULT_TEXT;
public VLine(Value width, Value height) {
super(width, height);
this.vAlign = Alignment.CENTER;
this.hAlign = Alignment.CENTER;
}
public VLine setColor(int color) {