public static Layout makeHorizontal() { Layout ret = new Layout(); ret.isVertical = false; return ret; }
public ModuleSwitch(Layout layout, Module module) { _toggle = new Toggle(module.name, false); _toggle.onSwitch = (m => { if(m.toggled) module.show(); else module.hide(); }); layout.views.add(_toggle); }
public InfoModule(Computer computer) : base(computer) { _stats = new List<StatLabel>(); _statsLayout = Layout.makeVertical(); }
public StatLabel(string name, UpdateHandler onUpdate) { _layout = Layout.makeHorizontal(); Label nameLabel = new Label(name); nameLabel.area.widthExpandable = true; nameLabel.font.alignment = Alignment.UpperLeft; nameLabel.font.normal = Color.white; nameLabel.font.style = FontStyle.Bold; _layout.views.add(nameLabel); _valueLabel = new Label(); _valueLabel.area.width = 150; _layout.views.add(_valueLabel); _updateHandler = onUpdate; }