Skip to content

Commit

Permalink
UI - Fixed UI showing during auto-run even with show on startup disabled
Browse files Browse the repository at this point in the history
UI - Fixen an issue during startup where Artemis would navigate to home after a few seconds
Workshop - Added Submit new entry button to submissions tab
  • Loading branch information
RobertBeekman committed Feb 19, 2024
1 parent 0b6bf56 commit 9126601
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
2 changes: 2 additions & 0 deletions src/Artemis.UI.Shared/Routing/Router/Router.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ private void MainWindowServiceOnMainWindowOpened(object? sender, EventArgs e)
{
if (_previousWindowRoute != null && _currentRouteSubject.Value == "blank")
Dispatcher.UIThread.InvokeAsync(async () => await Navigate(_previousWindowRoute, new RouterNavigationOptions {AddToHistory = false, EnableLogging = false}));
else if (_currentRouteSubject.Value == null || _currentRouteSubject.Value == "blank")
Dispatcher.UIThread.InvokeAsync(async () => await Navigate("home", new RouterNavigationOptions {AddToHistory = false, EnableLogging = true}));
}

private void MainWindowServiceOnMainWindowClosed(object? sender, EventArgs e)
Expand Down
6 changes: 3 additions & 3 deletions src/Artemis.UI/Screens/Root/RootViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ public RootViewModel(IRouter router,
registrationService.RegisterBuiltInDataModelDisplays();
registrationService.RegisterBuiltInDataModelInputs();
registrationService.RegisterBuiltInPropertyEditors();
_router.Navigate("home");
});
}

Expand Down Expand Up @@ -130,7 +128,9 @@ private bool ShouldShowUI()
bool minimized = Constants.StartupArguments.Contains("--minimized");
bool showOnAutoRun = _settingsService.GetSetting("UI.ShowOnStartup", true).Value;

return (autoRunning && showOnAutoRun) || !minimized;
if (autoRunning)
return showOnAutoRun;
return !minimized;
}

private void ShowSplashScreen()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,24 @@
<Button HorizontalAlignment="Center" Command="{CompiledBinding AddSubmission}">Submit new entry</Button>
</StackPanel>

<ScrollViewer IsVisible="{CompiledBinding Entries.Count}">
<ItemsControl ItemsSource="{CompiledBinding Entries}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl Content="{CompiledBinding}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ScrollViewer>
<StackPanel Spacing="15">
<Button HorizontalAlignment="Right" Command="{CompiledBinding AddSubmission}">Submit new entry</Button>
<ScrollViewer IsVisible="{CompiledBinding Entries.Count}">
<ItemsControl ItemsSource="{CompiledBinding Entries}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl Content="{CompiledBinding}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ScrollViewer>
</StackPanel>

</Panel>
</Panel>

Expand Down

0 comments on commit 9126601

Please sign in to comment.