Revamp UI a whole lot
This commit is contained in:
@@ -23,26 +23,33 @@ namespace KernelPanic.UI
|
||||
var dialog = new VisualElement();
|
||||
dialog.AddToClassList("root-credit-dialog");
|
||||
dialog.AddToClassList("run-history-dialog");
|
||||
dialog.AddToClassList("terminal-pane");
|
||||
dialog.style.width = Length.Percent(94);
|
||||
dialog.style.maxWidth = 760;
|
||||
dialog.style.maxHeight = Length.Percent(92);
|
||||
bool empty = entries == null || entries.Count == 0;
|
||||
dialog.EnableInClassList("is-empty", empty);
|
||||
overlay.Add(dialog);
|
||||
dialog.Add(SoftwareCardView.Text($"RECENT RUNS / last {RunHistory.Capacity}", "section-title"));
|
||||
var titleBar = new VisualElement();
|
||||
titleBar.AddToClassList("terminal-pane-titlebar");
|
||||
titleBar.Add(SoftwareCardView.Text("[ history --runs --inspect ]", "section-title"));
|
||||
dialog.Add(titleBar);
|
||||
dialog.Add(new Label { name = "RunHistoryNotice", enableRichText = false });
|
||||
dialog.Q<Label>("RunHistoryNotice").style.whiteSpace = WhiteSpace.Normal;
|
||||
var scroll = new ScrollView(ScrollViewMode.Vertical);
|
||||
scroll.style.flexShrink = 1;
|
||||
scroll.style.flexGrow = 1;
|
||||
scroll.style.flexGrow = empty ? 0 : 1;
|
||||
scroll.style.minHeight = 0;
|
||||
scroll.horizontalScrollerVisibility = ScrollerVisibility.Hidden;
|
||||
dialog.Add(scroll);
|
||||
if (entries == null || entries.Count == 0)
|
||||
scroll.Add(Text("No completed runs yet. Your next run report will appear here."));
|
||||
if (empty)
|
||||
scroll.Add(Text("history: No completed runs (exit 1)"));
|
||||
else for (int index = 0; index < entries.Count; index++)
|
||||
{
|
||||
var entry = entries[index];
|
||||
if (entry == null) continue;
|
||||
var item = new VisualElement();
|
||||
item.AddToClassList("run-history-entry");
|
||||
item.style.marginBottom = 16;
|
||||
item.Add(Text($"{entry.distroName ?? entry.distroId} V{entry.distroVersion} / {entry.languages}"));
|
||||
item.Add(Text($"Wave {entry.waveReached} reached / {entry.wavesCleared} cleared / seed {entry.seed}"));
|
||||
@@ -100,7 +107,7 @@ namespace KernelPanic.UI
|
||||
item.Add(copySeed);
|
||||
scroll.Add(item);
|
||||
}
|
||||
var dismiss = new Button(close) { text = "Close [Esc]", name = "CloseRunHistory" };
|
||||
var dismiss = new Button(close) { text = "[ Esc ] close", name = "CloseRunHistory" };
|
||||
dismiss.AddToClassList("terminal-button");
|
||||
dismiss.style.flexShrink = 0;
|
||||
dialog.Add(dismiss);
|
||||
|
||||
Reference in New Issue
Block a user