2025-11-24 22:52:51 +03:00

45 lines
1.2 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.client.gui.components.tabs;
import java.util.function.Consumer;
import net.minecraft.client.gui.components.AbstractWidget;
import net.minecraft.client.gui.components.tabs.Tab;
import net.minecraft.client.gui.layouts.FrameLayout;
import net.minecraft.client.gui.layouts.GridLayout;
import net.minecraft.client.gui.navigation.ScreenRectangle;
import net.minecraft.network.chat.Component;
public class GridLayoutTab
implements Tab {
private final Component title;
protected final GridLayout layout = new GridLayout();
public GridLayoutTab(Component title) {
this.title = title;
}
@Override
public Component getTabTitle() {
return this.title;
}
@Override
public Component getTabExtraNarration() {
return Component.empty();
}
@Override
public void visitChildren(Consumer<AbstractWidget> childrenConsumer) {
this.layout.visitWidgets(childrenConsumer);
}
@Override
public void doLayout(ScreenRectangle screenRectangle) {
this.layout.arrangeElements();
FrameLayout.alignInRectangle(this.layout, screenRectangle, 0.5f, 0.16666667f);
}
}