ZenScript main repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DInputFieldStyle.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package org.openzen.drawablegui;
  7. import org.openzen.drawablegui.border.DCompositeBorder;
  8. import org.openzen.drawablegui.border.DLineBorder;
  9. import org.openzen.drawablegui.border.DPaddedBorder;
  10. import org.openzen.drawablegui.style.DBaseStyle;
  11. import org.openzen.drawablegui.style.DDpDimension;
  12. import org.openzen.drawablegui.style.DStyleDefinition;
  13. /**
  14. *
  15. * @author Hoofdgebruiker
  16. */
  17. public class DInputFieldStyle extends DBaseStyle {
  18. public final int color;
  19. public final DFont font;
  20. public final int cursorColor;
  21. public final int cursorWidth;
  22. public final int selectionColor;
  23. public DInputFieldStyle(DStyleDefinition style) {
  24. super(style, context -> new DCompositeBorder(new DLineBorder(0xFFABADB3, 1), new DPaddedBorder(context.dp(2))), 0xFFFFFFFF);
  25. color = style.getColor("color", 0xFF000000);
  26. font = style.getFont("font", context -> new DFont(DFontFamily.UI, false, false, false, (int)(14 * context.getScale())));
  27. cursorColor = style.getColor("cursorColor", 0xFF000000);
  28. cursorWidth = style.getDimension("cursorWidth", new DDpDimension(1));
  29. selectionColor = style.getColor("selectionColor", 0xFFB0C5E3);
  30. }
  31. }