Inceptum/launcher-gtk/src/main/java/io/gitlab/jfronny/inceptum/gtk/window/InstanceSettingsWindow.java

44 lines
1.7 KiB
Java

package io.gitlab.jfronny.inceptum.gtk.window;
import io.gitlab.jfronny.inceptum.gtk.util.I18n;
import io.gitlab.jfronny.inceptum.gtk.window.edit.*;
import io.gitlab.jfronny.inceptum.launcher.system.instance.Instance;
import org.gnome.adw.HeaderBar;
import org.gnome.adw.*;
import org.gtk.gobject.BindingFlags;
import org.gtk.gtk.Application;
import org.gtk.gtk.Window;
import org.gtk.gtk.*;
public class InstanceSettingsWindow extends Window {
public InstanceSettingsWindow(Application app, Instance instance) {
this.application = app;
ViewStack stack = new ViewStack();
HeaderBar header = new HeaderBar();
ViewSwitcherTitle viewSwitcher = new ViewSwitcherTitle();
viewSwitcher.stack = stack;
header.titleWidget = viewSwitcher;
titlebar = header;
ScrolledWindow scroll = new ScrolledWindow();
scroll.setPolicy(PolicyType.NEVER, PolicyType.AUTOMATIC);
scroll.child = stack;
scroll.vexpand = true;
ViewSwitcherBar bottomBar = new ViewSwitcherBar();
bottomBar.stack = stack;
viewSwitcher.bindProperty("title-visible", bottomBar, "reveal", BindingFlags.DEFAULT);
Box view = new Box(Orientation.VERTICAL, 0);
view.append(scroll);
view.append(bottomBar);
child = view;
stack.addTitledWithIcon(new GeneralTab(instance, this), null, I18n.get("instance.settings.general"), "preferences-other-symbolic");
stack.addTitledWithIcon(new ModsTab(instance, this), null, I18n.get("instance.settings.mods"), "package-x-generic-symbolic");
stack.addTitledWithIcon(new ExportTab(instance, this), null, I18n.get("instance.settings.export"), "send-to-symbolic");
}
}