use of mathax.client.gui.widgets.containers.WVerticalList in project Client by MatHax.
the class ModulesScreen method initWidgets.
@Override
public void initWidgets() {
controller = add(new WCategoryController()).widget();
// Help
WVerticalList help = add(theme.verticalList()).pad(4).bottom().widget();
help.add(theme.label("Left click - Toggle module"));
help.add(theme.label("Right click - Open module settings"));
}
use of mathax.client.gui.widgets.containers.WVerticalList in project Client by MatHax.
the class ModulesScreen method createSearch.
protected WWindow createSearch(WContainer c) {
WWindow w = theme.window("Search");
w.id = "search";
if (theme.categoryIcons())
w.beforeHeaderInit = wContainer -> wContainer.add(theme.item(Items.COMPASS.getDefaultStack())).pad(2);
c.add(w);
w.view.scrollOnlyWhenMouseOver = true;
w.view.hasScrollBar = false;
w.view.maxHeight -= 20;
WVerticalList l = theme.verticalList();
WTextBox text = w.add(theme.textBox("")).minWidth(140).expandX().widget();
text.setFocused(true);
text.action = () -> {
l.clear();
createSearchW(l, text.get());
};
text.actionOnEnter = () -> {
Set<Module> modules = Modules.get().searchTitles(text.get());
if (modules.size() != 1)
return;
Module target = modules.iterator().next();
target.toggle();
};
w.add(l).expandX();
createSearchW(l, text.get());
return w;
}
use of mathax.client.gui.widgets.containers.WVerticalList in project Client by MatHax.
the class Marker method getWidget.
// Buttons
@Override
public WWidget getWidget(GuiTheme theme) {
WVerticalList list = theme.verticalList();
fillList(theme, list);
return list;
}
use of mathax.client.gui.widgets.containers.WVerticalList in project Client by MatHax.
the class Swarm method getWidget.
// Buttons
@Override
public WWidget getWidget(GuiTheme theme) {
WVerticalList list = theme.verticalList();
WHorizontalList b = list.add(theme.horizontalList()).expandX().widget();
WButton start = b.add(theme.button("Start")).expandX().widget();
start.action = () -> {
if (!isActive())
return;
close();
if (mode.get() == Mode.Host)
host = new SwarmHost(serverPort.get());
else
worker = new SwarmWorker(ipAddress.get(), serverPort.get());
};
WButton stop = b.add(theme.button("Stop")).expandX().widget();
stop.action = this::close;
WButton guide = list.add(theme.button("Guide")).expandX().widget();
guide.action = () -> Util.getOperatingSystem().open("https://mathaxclient.xyz/Swarm-Guide");
return list;
}
Aggregations