- tweak: UI improvement
This commit is contained in:
2
.idea/.idea.Nebula/.idea/avalonia.xml
generated
2
.idea/.idea.Nebula/.idea/avalonia.xml
generated
@@ -11,6 +11,7 @@
|
|||||||
<entry key="Nebula.Launcher/ViewModels/Styles1.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/ViewModels/Styles1.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
<entry key="Nebula.Launcher/Views/Controls/PlayerContainerControl.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/Controls/PlayerContainerControl.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
<entry key="Nebula.Launcher/Views/Controls/ServerContainerControl.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/Controls/ServerContainerControl.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
|
<entry key="Nebula.Launcher/Views/ExceptionView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
<entry key="Nebula.Launcher/Views/MainView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/MainView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
<entry key="Nebula.Launcher/Views/MainWindow.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/MainWindow.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
<entry key="Nebula.Launcher/Views/Pages/AccountInfoPage.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/Pages/AccountInfoPage.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
<entry key="Nebula.Launcher/Views/Pages/FavoriteServerListView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/Pages/FavoriteServerListView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
<entry key="Nebula.Launcher/Views/Pages/ServerListPage.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/Pages/ServerListPage.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
<entry key="Nebula.Launcher/Views/Pages/ServerListView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/Pages/ServerListView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
|
<entry key="Nebula.Launcher/Views/Popup/ExceptionListView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
<entry key="Nebula.Launcher/Views/Popup/ExceptionView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/Popup/ExceptionView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
<entry key="Nebula.Launcher/Views/Popup/InfoPopupView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/Popup/InfoPopupView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
<entry key="Nebula.Launcher/Views/Popup/LoadingContextView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/Popup/LoadingContextView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
|
|||||||
@@ -3,4 +3,8 @@
|
|||||||
<SolidColorBrush x:Key="DefaultForeground">#121212</SolidColorBrush>
|
<SolidColorBrush x:Key="DefaultForeground">#121212</SolidColorBrush>
|
||||||
<SolidColorBrush x:Key="DefaultSelected">#D95F59</SolidColorBrush>
|
<SolidColorBrush x:Key="DefaultSelected">#D95F59</SolidColorBrush>
|
||||||
<BoxShadows x:Key="DefaultShadow">0 0 10 -1 #121212</BoxShadows>
|
<BoxShadows x:Key="DefaultShadow">0 0 10 -1 #121212</BoxShadows>
|
||||||
|
<LinearGradientBrush EndPoint="100%,50%" StartPoint="0%,50%" x:Key="DefaultGrad">
|
||||||
|
<GradientStop Color="#262222" Offset="0.0" />
|
||||||
|
<GradientStop Color="#222222" Offset="1.0" />
|
||||||
|
</LinearGradientBrush>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
@@ -59,7 +59,13 @@
|
|||||||
|
|
||||||
<Style Selector="ListBoxItem:selected /template/ ContentPresenter">
|
<Style Selector="ListBoxItem:selected /template/ ContentPresenter">
|
||||||
<Setter Property="CornerRadius" Value="0,8,8,0" />
|
<Setter Property="CornerRadius" Value="0,8,8,0" />
|
||||||
<Setter Property="Background" Value="{StaticResource DefaultSelected}" />
|
<Setter Property="Background">
|
||||||
|
<LinearGradientBrush EndPoint="100%,50%" StartPoint="0%,50%">
|
||||||
|
<GradientStop Color="#ae4c47" Offset="0.0" />
|
||||||
|
<GradientStop Color="#D95F59" Offset="0.2" />
|
||||||
|
<GradientStop Color="#D95F59" Offset="1.0" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</Setter>
|
||||||
<Setter Property="BoxShadow" Value="0 0 15 1 #1212" />
|
<Setter Property="BoxShadow" Value="0 0 15 1 #1212" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="ListBoxItem:pointerover">
|
<Style Selector="ListBoxItem:pointerover">
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Reflection;
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Templates;
|
using Avalonia.Controls.Templates;
|
||||||
using Nebula.Launcher.ViewModels;
|
using Nebula.Launcher.ViewModels;
|
||||||
|
using Nebula.Launcher.Views;
|
||||||
|
|
||||||
namespace Nebula.Launcher;
|
namespace Nebula.Launcher;
|
||||||
|
|
||||||
@@ -13,6 +14,11 @@ public class ViewLocator : IDataTemplate
|
|||||||
if (param is null)
|
if (param is null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if (param is Exception e)
|
||||||
|
{
|
||||||
|
return new ExceptionView(e);
|
||||||
|
}
|
||||||
|
|
||||||
var type = param.GetType().GetCustomAttribute<ViewModelRegisterAttribute>()?.Type;
|
var type = param.GetType().GetCustomAttribute<ViewModelRegisterAttribute>()?.Type;
|
||||||
|
|
||||||
if (type != null) return (Control)Activator.CreateInstance(type)!;
|
if (type != null) return (Control)Activator.CreateInstance(type)!;
|
||||||
@@ -22,6 +28,6 @@ public class ViewLocator : IDataTemplate
|
|||||||
|
|
||||||
public bool Match(object? data)
|
public bool Match(object? data)
|
||||||
{
|
{
|
||||||
return data is ViewModelBase;
|
return data is ViewModelBase || data is Exception;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,7 +115,7 @@ public partial class MainViewModel : ViewModelBase
|
|||||||
PopupMessage(@base);
|
PopupMessage(@base);
|
||||||
break;
|
break;
|
||||||
case Exception error:
|
case Exception error:
|
||||||
var err = ViewHelperService.GetViewModel<ExceptionViewModel>();
|
var err = ViewHelperService.GetViewModel<ExceptionListViewModel>();
|
||||||
DebugService.Error(error);
|
DebugService.Error(error);
|
||||||
err.AppendError(error);
|
err.AppendError(error);
|
||||||
PopupMessage(err);
|
PopupMessage(err);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public partial class ServerListViewModel : ViewModelBase, IViewModelPage
|
|||||||
[ObservableProperty] private bool _isFavoriteMode;
|
[ObservableProperty] private bool _isFavoriteMode;
|
||||||
|
|
||||||
public ObservableCollection<ServerEntryModelView> Servers { get; }= new();
|
public ObservableCollection<ServerEntryModelView> Servers { get; }= new();
|
||||||
|
public ObservableCollection<Exception> HubErrors { get; } = new();
|
||||||
|
|
||||||
public Action? OnSearchChange;
|
public Action? OnSearchChange;
|
||||||
[GenerateProperty] private HubService HubService { get; }
|
[GenerateProperty] private HubService HubService { get; }
|
||||||
@@ -40,6 +41,7 @@ public partial class ServerListViewModel : ViewModelBase, IViewModelPage
|
|||||||
protected override void InitialiseInDesignMode()
|
protected override void InitialiseInDesignMode()
|
||||||
{
|
{
|
||||||
ServerViewContainer = new ServerViewContainer(this, RestService, CancellationService, DebugService, ViewHelperService);
|
ServerViewContainer = new ServerViewContainer(this, RestService, CancellationService, DebugService, ViewHelperService);
|
||||||
|
HubErrors.Add(new Exception("UVI"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//real think
|
//real think
|
||||||
@@ -51,12 +53,18 @@ public partial class ServerListViewModel : ViewModelBase, IViewModelPage
|
|||||||
|
|
||||||
HubService.HubServerChangedEventArgs += HubServerChangedEventArgs;
|
HubService.HubServerChangedEventArgs += HubServerChangedEventArgs;
|
||||||
HubService.HubServerLoaded += UpdateServerEntries;
|
HubService.HubServerLoaded += UpdateServerEntries;
|
||||||
|
HubService.HubServerLoadingError += HubServerLoadingError;
|
||||||
OnSearchChange += OnChangeSearch;
|
OnSearchChange += OnChangeSearch;
|
||||||
|
|
||||||
if (!HubService.IsUpdating) UpdateServerEntries();
|
if (!HubService.IsUpdating) UpdateServerEntries();
|
||||||
UpdateFavoriteEntries();
|
UpdateFavoriteEntries();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void HubServerLoadingError(Exception obj)
|
||||||
|
{
|
||||||
|
HubErrors.Add(obj);
|
||||||
|
}
|
||||||
|
|
||||||
private void UpdateServerEntries()
|
private void UpdateServerEntries()
|
||||||
{
|
{
|
||||||
Servers.Clear();
|
Servers.Clear();
|
||||||
@@ -120,6 +128,7 @@ public partial class ServerListViewModel : ViewModelBase, IViewModelPage
|
|||||||
|
|
||||||
public void UpdateRequired()
|
public void UpdateRequired()
|
||||||
{
|
{
|
||||||
|
HubErrors.Clear();
|
||||||
Task.Run(HubService.UpdateHub);
|
Task.Run(HubService.UpdateHub);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ using Nebula.Shared.Services;
|
|||||||
|
|
||||||
namespace Nebula.Launcher.ViewModels.Popup;
|
namespace Nebula.Launcher.ViewModels.Popup;
|
||||||
|
|
||||||
[ViewModelRegister(typeof(ExceptionView), false)]
|
[ViewModelRegister(typeof(ExceptionListView), false)]
|
||||||
[ConstructGenerator]
|
[ConstructGenerator]
|
||||||
public sealed partial class ExceptionViewModel : PopupViewModelBase
|
public sealed partial class ExceptionListViewModel : PopupViewModelBase
|
||||||
{
|
{
|
||||||
[GenerateProperty] public override PopupMessageService PopupMessageService { get; }
|
[GenerateProperty] public override PopupMessageService PopupMessageService { get; }
|
||||||
public override string Title => "Oopsie! Some shit is happened now!";
|
public override string Title => "Oopsie! Some shit is happened now!";
|
||||||
@@ -281,6 +281,7 @@ public partial class ServerEntryModelView : ViewModelBase
|
|||||||
Description = info.Desc;
|
Description = info.Desc;
|
||||||
|
|
||||||
Links.Clear();
|
Links.Clear();
|
||||||
|
if(info.Links is null) return;
|
||||||
foreach (var link in info.Links)
|
foreach (var link in info.Links)
|
||||||
{
|
{
|
||||||
Links.Add(link);
|
Links.Add(link);
|
||||||
|
|||||||
46
Nebula.Launcher/Views/ExceptionView.axaml
Normal file
46
Nebula.Launcher/Views/ExceptionView.axaml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<UserControl
|
||||||
|
d:DesignHeight="450"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
x:Class="Nebula.Launcher.Views.ExceptionView"
|
||||||
|
x:DataType="system:Exception"
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<Design.DataContext>
|
||||||
|
<system:Exception />
|
||||||
|
</Design.DataContext>
|
||||||
|
<Border
|
||||||
|
BoxShadow="{StaticResource DefaultShadow}"
|
||||||
|
CornerRadius="5"
|
||||||
|
Margin="0,0,0,5">
|
||||||
|
<Border.Background>
|
||||||
|
<LinearGradientBrush EndPoint="100%,50%" StartPoint="0%,50%">
|
||||||
|
<GradientStop Color="#443333" Offset="0.0" />
|
||||||
|
<GradientStop Color="#333333" Offset="1.0" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</Border.Background>
|
||||||
|
<StackPanel>
|
||||||
|
<Border CornerRadius="5,5,0,0">
|
||||||
|
<Border.Background>
|
||||||
|
<LinearGradientBrush EndPoint="100%,50%" StartPoint="0%,50%">
|
||||||
|
<GradientStop Color="#FF6B6B" Offset="0.0" />
|
||||||
|
<GradientStop Color="#FF8E53" Offset="0.3" />
|
||||||
|
<GradientStop Color="#FF5E3A" Offset="0.6" />
|
||||||
|
<GradientStop Color="#FF5e5e" Offset="1.0" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</Border.Background>
|
||||||
|
<ScrollViewer>
|
||||||
|
<Label Margin="4">
|
||||||
|
<TextBlock Text="{Binding Message}" />
|
||||||
|
</Label>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Border>
|
||||||
|
<Label Margin="4">
|
||||||
|
<TextBlock Text="{Binding StackTrace}" TextWrapping="Wrap" />
|
||||||
|
</Label>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</UserControl>
|
||||||
19
Nebula.Launcher/Views/ExceptionView.axaml.cs
Normal file
19
Nebula.Launcher/Views/ExceptionView.axaml.cs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace Nebula.Launcher.Views;
|
||||||
|
|
||||||
|
public partial class ExceptionView : UserControl
|
||||||
|
{
|
||||||
|
public ExceptionView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExceptionView(Exception exception): this()
|
||||||
|
{
|
||||||
|
DataContext = exception;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
Background="#1a1a1a"
|
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
@@ -15,6 +14,12 @@
|
|||||||
<Design.DataContext>
|
<Design.DataContext>
|
||||||
<viewModels:MainViewModel />
|
<viewModels:MainViewModel />
|
||||||
</Design.DataContext>
|
</Design.DataContext>
|
||||||
|
<UserControl.Background>
|
||||||
|
<LinearGradientBrush EndPoint="100%,50%" StartPoint="0%,50%">
|
||||||
|
<GradientStop Color="#121212" Offset="0.0" />
|
||||||
|
<GradientStop Color="#181212" Offset="1.0" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</UserControl.Background>
|
||||||
|
|
||||||
<Panel>
|
<Panel>
|
||||||
<Grid
|
<Grid
|
||||||
@@ -29,7 +34,7 @@
|
|||||||
Grid.Row="0" />
|
Grid.Row="0" />
|
||||||
|
|
||||||
<SplitView
|
<SplitView
|
||||||
CompactPaneLength="65"
|
CompactPaneLength="70"
|
||||||
DisplayMode="CompactInline"
|
DisplayMode="CompactInline"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.ColumnSpan="2"
|
Grid.ColumnSpan="2"
|
||||||
@@ -38,13 +43,19 @@
|
|||||||
PaneBackground="Transparent">
|
PaneBackground="Transparent">
|
||||||
<SplitView.Pane>
|
<SplitView.Pane>
|
||||||
<Border
|
<Border
|
||||||
Background="{StaticResource DefaultBackground}"
|
|
||||||
BoxShadow="0 0 15 -2 #121212"
|
BoxShadow="0 0 15 -2 #121212"
|
||||||
CornerRadius="0,8,8,0"
|
CornerRadius="0,0,0,0"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Margin="0,0,5,0"
|
Margin="0,0,5,0"
|
||||||
Padding="0,0,-4,0">
|
Padding="0,0,-4,0">
|
||||||
|
<Border.Background>
|
||||||
|
<LinearGradientBrush EndPoint="100%,50%" StartPoint="0%,50%">
|
||||||
|
<GradientStop Color="#1f1f1f" Offset="0.0" />
|
||||||
|
<GradientStop Color="#222222" Offset="0.2" />
|
||||||
|
<GradientStop Color="#222222" Offset="1.0" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</Border.Background>
|
||||||
<Grid ColumnDefinitions="*" RowDefinitions="*,40">
|
<Grid ColumnDefinitions="*" RowDefinitions="*,40">
|
||||||
<ListBox
|
<ListBox
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
@@ -53,7 +64,7 @@
|
|||||||
SelectedItem="{Binding SelectedListItem}">
|
SelectedItem="{Binding SelectedListItem}">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate DataType="{x:Type models:ListItemTemplate}">
|
<DataTemplate DataType="{x:Type models:ListItemTemplate}">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="17">
|
<StackPanel Orientation="Horizontal" Spacing="19">
|
||||||
<Svg
|
<Svg
|
||||||
Height="40"
|
Height="40"
|
||||||
Path="{Binding IconKey, Converter={x:Static converters:TypeConverters.IconConverter}}"
|
Path="{Binding IconKey, Converter={x:Static converters:TypeConverters.IconConverter}}"
|
||||||
@@ -78,14 +89,20 @@
|
|||||||
</SplitView>
|
</SplitView>
|
||||||
|
|
||||||
<Border
|
<Border
|
||||||
Background="{StaticResource DefaultBackground}"
|
Background="{StaticResource DefaultGrad}"
|
||||||
BoxShadow="{StaticResource DefaultShadow}"
|
BorderThickness="0,2,0,0"
|
||||||
CornerRadius="0,0,0,0"
|
CornerRadius="0,0,0,0"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.ColumnSpan="2"
|
Grid.ColumnSpan="2"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="0,0,0,0"
|
Margin="0,0,0,0"
|
||||||
Padding="5">
|
Padding="5">
|
||||||
|
<Border.BorderBrush>
|
||||||
|
<LinearGradientBrush EndPoint="100%,50%" StartPoint="0%,50%">
|
||||||
|
<GradientStop Color="#222222" Offset="0.0" />
|
||||||
|
<GradientStop Color="#442222" Offset="1.0" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</Border.BorderBrush>
|
||||||
<Label FontSize="10" Foreground="#777777">
|
<Label FontSize="10" Foreground="#777777">
|
||||||
<Panel>
|
<Panel>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
<Window
|
<Window
|
||||||
|
Background="{x:Null}"
|
||||||
|
ExtendClientAreaChromeHints="NoChrome"
|
||||||
|
ExtendClientAreaTitleBarHeightHint="-1"
|
||||||
|
ExtendClientAreaToDecorationsHint="True"
|
||||||
Height="500"
|
Height="500"
|
||||||
Icon="/Assets/avalonia-logo.ico"
|
Icon="/Assets/avalonia-logo.ico"
|
||||||
MinHeight="500"
|
MinHeight="500"
|
||||||
MinWidth="800"
|
MinWidth="800"
|
||||||
|
SystemDecorations="BorderOnly"
|
||||||
Title="Nebula.Launcher"
|
Title="Nebula.Launcher"
|
||||||
|
TransparencyLevelHint="AcrylicBlur"
|
||||||
Width="800"
|
Width="800"
|
||||||
|
WindowStartupLocation="CenterScreen"
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
@@ -12,4 +19,54 @@
|
|||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" />
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<Grid ColumnDefinitions="*" RowDefinitions="30,*">
|
||||||
|
<Border
|
||||||
|
Background="{StaticResource DefaultGrad}"
|
||||||
|
BorderThickness="0,0,0,2"
|
||||||
|
CornerRadius="0"
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.Row="0">
|
||||||
|
<Border.BorderBrush>
|
||||||
|
<LinearGradientBrush EndPoint="100%,50%" StartPoint="0%,50%">
|
||||||
|
<GradientStop Color="#222222" Offset="0.0" />
|
||||||
|
<GradientStop Color="#442222" Offset="1.0" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</Border.BorderBrush>
|
||||||
|
<Panel
|
||||||
|
Background="{StaticResource DefaultGrad}"
|
||||||
|
Height="30"
|
||||||
|
PointerPressed="InputElement_OnPointerPressed">
|
||||||
|
<TextBlock
|
||||||
|
FontSize="10"
|
||||||
|
Foreground="White"
|
||||||
|
IsVisible="False"
|
||||||
|
Margin="15,0"
|
||||||
|
Text="Nebula Launcher"
|
||||||
|
VerticalAlignment="Center" />
|
||||||
|
<StackPanel
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Margin="5,0,5,0"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="8">
|
||||||
|
<Button
|
||||||
|
Click="Minimize_Click"
|
||||||
|
Content="🗕"
|
||||||
|
Foreground="Azure" />
|
||||||
|
<Button
|
||||||
|
Click="Maximize_Click"
|
||||||
|
Content="🗗"
|
||||||
|
Foreground="Azure" />
|
||||||
|
<Button
|
||||||
|
Click="Close_Click"
|
||||||
|
Content="🗙"
|
||||||
|
Foreground="Azure" />
|
||||||
|
</StackPanel>
|
||||||
|
</Panel>
|
||||||
|
</Border>
|
||||||
|
<UserControl
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.Row="1"
|
||||||
|
x:Name="Control" />
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Input;
|
||||||
|
using Avalonia.Interactivity;
|
||||||
|
|
||||||
namespace Nebula.Launcher.Views;
|
namespace Nebula.Launcher.Views;
|
||||||
|
|
||||||
@@ -15,9 +17,29 @@ public partial class MainWindow : Window
|
|||||||
public MainWindow(MainView mainView)
|
public MainWindow(MainView mainView)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
Content = mainView;
|
Control.Content = mainView;
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
this.AttachDevTools();
|
this.AttachDevTools();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Minimize_Click(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
WindowState = WindowState.Minimized;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Maximize_Click(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Close_Click(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InputElement_OnPointerPressed(object? sender, PointerPressedEventArgs e)
|
||||||
|
{
|
||||||
|
BeginMoveDrag(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -18,11 +18,16 @@
|
|||||||
RowDefinitions="*">
|
RowDefinitions="*">
|
||||||
<StackPanel Grid.Column="1" Grid.Row="0">
|
<StackPanel Grid.Column="1" Grid.Row="0">
|
||||||
<Border
|
<Border
|
||||||
Background="{StaticResource DefaultBackground}"
|
|
||||||
BoxShadow="0 -1 15 -2 #121212"
|
BoxShadow="0 -1 15 -2 #121212"
|
||||||
CornerRadius="10,10,0,0"
|
CornerRadius="10,10,0,0"
|
||||||
Margin="5,5,5,0"
|
Margin="5,5,5,0"
|
||||||
Padding="5">
|
Padding="5">
|
||||||
|
<Border.Background>
|
||||||
|
<LinearGradientBrush EndPoint="50%,100%" StartPoint="50%,0%">
|
||||||
|
<GradientStop Color="#222222" Offset="0.0" />
|
||||||
|
<GradientStop Color="#292222" Offset="1.0" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</Border.Background>
|
||||||
<Label HorizontalAlignment="Center">Profiles:</Label>
|
<Label HorizontalAlignment="Center">Profiles:</Label>
|
||||||
</Border>
|
</Border>
|
||||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
||||||
@@ -33,11 +38,16 @@
|
|||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate DataType="{x:Type pages:ProfileAuthCredentials}">
|
<DataTemplate DataType="{x:Type pages:ProfileAuthCredentials}">
|
||||||
<Border
|
<Border
|
||||||
Background="{StaticResource DefaultBackground}"
|
|
||||||
BoxShadow="0 1 15 -2 #121212"
|
BoxShadow="0 1 15 -2 #121212"
|
||||||
CornerRadius="0,10,0,10"
|
CornerRadius="0,10,0,10"
|
||||||
Margin="5,5,5,5"
|
Margin="5,5,5,5"
|
||||||
VerticalAlignment="Center">
|
VerticalAlignment="Center">
|
||||||
|
<Border.Background>
|
||||||
|
<LinearGradientBrush EndPoint="50%,100%" StartPoint="50%,0%">
|
||||||
|
<GradientStop Color="#292222" Offset="0.0" />
|
||||||
|
<GradientStop Color="#222222" Offset="1.0" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</Border.Background>
|
||||||
<Panel>
|
<Panel>
|
||||||
<StackPanel Margin="10,5,5,5" Orientation="Horizontal">
|
<StackPanel Margin="10,5,5,5" Orientation="Horizontal">
|
||||||
<Label>Name:</Label>
|
<Label>Name:</Label>
|
||||||
@@ -76,11 +86,16 @@
|
|||||||
Grid.ColumnSpan="{Binding AuthViewSpan}"
|
Grid.ColumnSpan="{Binding AuthViewSpan}"
|
||||||
Grid.Row="0">
|
Grid.Row="0">
|
||||||
<Border
|
<Border
|
||||||
Background="{StaticResource DefaultBackground}"
|
|
||||||
BoxShadow="{StaticResource DefaultShadow}"
|
BoxShadow="{StaticResource DefaultShadow}"
|
||||||
CornerRadius="10"
|
CornerRadius="10"
|
||||||
Margin="5"
|
Margin="5"
|
||||||
Padding="15">
|
Padding="15">
|
||||||
|
<Border.Background>
|
||||||
|
<LinearGradientBrush EndPoint="50%,100%" StartPoint="50%,0%">
|
||||||
|
<GradientStop Color="#292222" Offset="0.0" />
|
||||||
|
<GradientStop Color="#222222" Offset="1.0" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</Border.Background>
|
||||||
<Panel>
|
<Panel>
|
||||||
<StackPanel IsVisible="{Binding !IsLogged}" Spacing="15">
|
<StackPanel IsVisible="{Binding !IsLogged}" Spacing="15">
|
||||||
<Svg
|
<Svg
|
||||||
|
|||||||
@@ -20,9 +20,10 @@
|
|||||||
RowDefinitions="*,40">
|
RowDefinitions="*,40">
|
||||||
<ScrollViewer
|
<ScrollViewer
|
||||||
Grid.RowSpan="2"
|
Grid.RowSpan="2"
|
||||||
Margin="0,0,0,10"
|
Margin="5,0,0,10"
|
||||||
Padding="0,0,10,0">
|
Padding="0,0,10,0">
|
||||||
<Panel>
|
<StackPanel>
|
||||||
|
<ItemsControl ItemsSource="{Binding HubErrors}" Margin="10,0,10,0" />
|
||||||
<ItemsControl
|
<ItemsControl
|
||||||
IsVisible="{Binding IsFavoriteMode}"
|
IsVisible="{Binding IsFavoriteMode}"
|
||||||
ItemsSource="{Binding FavoriteServers}"
|
ItemsSource="{Binding FavoriteServers}"
|
||||||
@@ -31,7 +32,7 @@
|
|||||||
IsVisible="{Binding !IsFavoriteMode}"
|
IsVisible="{Binding !IsFavoriteMode}"
|
||||||
ItemsSource="{Binding Servers}"
|
ItemsSource="{Binding Servers}"
|
||||||
Padding="0" />
|
Padding="0" />
|
||||||
</Panel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
||||||
<Border
|
<Border
|
||||||
@@ -43,10 +44,10 @@
|
|||||||
<Grid
|
<Grid
|
||||||
ColumnDefinitions="*,40,40,40"
|
ColumnDefinitions="*,40,40,40"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="5,0,0,0"
|
Margin="-25,0,0,0"
|
||||||
RowDefinitions="*">
|
RowDefinitions="*">
|
||||||
<TextBox
|
<TextBox
|
||||||
Margin="0"
|
Margin="25,0,0,0"
|
||||||
Text="{Binding SearchText}"
|
Text="{Binding SearchText}"
|
||||||
TextChanged="TextBox_OnTextChanged"
|
TextChanged="TextBox_OnTextChanged"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
|||||||
22
Nebula.Launcher/Views/Popup/ExceptionListView.axaml
Normal file
22
Nebula.Launcher/Views/Popup/ExceptionListView.axaml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<UserControl
|
||||||
|
d:DesignHeight="450"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
x:Class="Nebula.Launcher.Views.Popup.ExceptionListView"
|
||||||
|
x:DataType="popup:ExceptionListViewModel"
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:popup="clr-namespace:Nebula.Launcher.ViewModels.Popup"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<Design.DataContext>
|
||||||
|
<popup:ExceptionListViewModel />
|
||||||
|
</Design.DataContext>
|
||||||
|
<ScrollViewer Margin="10" Padding="0,0,8,0">
|
||||||
|
<ItemsControl
|
||||||
|
Background="#00000000"
|
||||||
|
ItemsSource="{Binding Errors}"
|
||||||
|
Padding="0" />
|
||||||
|
</ScrollViewer>
|
||||||
|
</UserControl>
|
||||||
17
Nebula.Launcher/Views/Popup/ExceptionListView.axaml.cs
Normal file
17
Nebula.Launcher/Views/Popup/ExceptionListView.axaml.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
using Nebula.Launcher.ViewModels.Popup;
|
||||||
|
|
||||||
|
namespace Nebula.Launcher.Views.Popup;
|
||||||
|
|
||||||
|
public partial class ExceptionListView : UserControl
|
||||||
|
{
|
||||||
|
public ExceptionListView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExceptionListView(ExceptionListViewModel listViewModel) : this()
|
||||||
|
{
|
||||||
|
DataContext = listViewModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<UserControl xmlns="https://github.com/avaloniaui"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
|
||||||
xmlns:popup="clr-namespace:Nebula.Launcher.ViewModels.Popup"
|
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
||||||
x:Class="Nebula.Launcher.Views.Popup.ExceptionView"
|
|
||||||
x:DataType="popup:ExceptionViewModel">
|
|
||||||
<Design.DataContext>
|
|
||||||
<popup:ExceptionViewModel />
|
|
||||||
</Design.DataContext>
|
|
||||||
<ScrollViewer Margin="10" Padding="0,0,8,0">
|
|
||||||
<ItemsControl
|
|
||||||
Background="#00000000"
|
|
||||||
ItemsSource="{Binding Errors}"
|
|
||||||
Padding="0">
|
|
||||||
<ItemsControl.ItemTemplate>
|
|
||||||
<DataTemplate DataType="{x:Type system:Exception}">
|
|
||||||
<Border Background="#333333" CornerRadius="5" Margin="0,0,0,5">
|
|
||||||
<StackPanel>
|
|
||||||
<Border Background="#aa2222" CornerRadius="5,5,0,0">
|
|
||||||
<Label Margin="4">
|
|
||||||
<TextBlock Text="{Binding Message}" />
|
|
||||||
</Label>
|
|
||||||
</Border>
|
|
||||||
<Label Margin="4">
|
|
||||||
<TextBlock Text="{Binding StackTrace}" />
|
|
||||||
</Label>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
</ScrollViewer>
|
|
||||||
</UserControl>
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
using Avalonia.Controls;
|
|
||||||
using Nebula.Launcher.ViewModels.Popup;
|
|
||||||
|
|
||||||
namespace Nebula.Launcher.Views.Popup;
|
|
||||||
|
|
||||||
public partial class ExceptionView : UserControl
|
|
||||||
{
|
|
||||||
public ExceptionView()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ExceptionView(ExceptionViewModel viewModel) : this()
|
|
||||||
{
|
|
||||||
DataContext = viewModel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -19,14 +19,15 @@
|
|||||||
</Design.DataContext>
|
</Design.DataContext>
|
||||||
|
|
||||||
<Border
|
<Border
|
||||||
Background="{StaticResource DefaultBackground}"
|
Background="{StaticResource DefaultGrad}"
|
||||||
BoxShadow="-2 0 5 -1 #121212"
|
BoxShadow="-2 0 5 -1 #121212"
|
||||||
CornerRadius="10"
|
CornerRadius="10"
|
||||||
Margin="5">
|
Margin="5">
|
||||||
|
|
||||||
<Grid ColumnDefinitions="*,80,50,50" RowDefinitions="35,*,*">
|
<Grid ColumnDefinitions="*,80,50,50" RowDefinitions="35,*,*">
|
||||||
<Border
|
<Border
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BoxShadow="0 3 3 -1 #121212"
|
BoxShadow="0 3 3 -2 #121212"
|
||||||
CornerRadius="10"
|
CornerRadius="10"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.ColumnSpan="2"
|
Grid.ColumnSpan="2"
|
||||||
@@ -34,7 +35,7 @@
|
|||||||
IsVisible="{Binding ExpandInfo}" />
|
IsVisible="{Binding ExpandInfo}" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
Background="#00000000"
|
Background="Transparent"
|
||||||
Command="{Binding ExpandInfoRequired}"
|
Command="{Binding ExpandInfoRequired}"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
@@ -124,7 +125,7 @@
|
|||||||
|
|
||||||
<Border
|
<Border
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BoxShadow="0 -3 3 -1 #121212"
|
BoxShadow="0 -3 3 -2 #121212"
|
||||||
CornerRadius="10"
|
CornerRadius="10"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.ColumnSpan="3"
|
Grid.ColumnSpan="3"
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public class HubService
|
|||||||
|
|
||||||
public Action<HubServerChangedEventArgs>? HubServerChangedEventArgs;
|
public Action<HubServerChangedEventArgs>? HubServerChangedEventArgs;
|
||||||
public Action? HubServerLoaded;
|
public Action? HubServerLoaded;
|
||||||
|
public Action<Exception>? HubServerLoadingError;
|
||||||
|
|
||||||
public HubService(ConfigurationService configurationService, RestService restService)
|
public HubService(ConfigurationService configurationService, RestService restService)
|
||||||
{
|
{
|
||||||
@@ -36,10 +37,17 @@ public class HubService
|
|||||||
|
|
||||||
foreach (var urlStr in _configurationService.GetConfigValue(CurrentConVar.Hub)!)
|
foreach (var urlStr in _configurationService.GetConfigValue(CurrentConVar.Hub)!)
|
||||||
{
|
{
|
||||||
var servers =
|
try
|
||||||
await _restService.GetAsyncDefault<List<ServerHubInfo>>(new Uri(urlStr), [], CancellationToken.None);
|
{
|
||||||
_serverList.AddRange(servers);
|
var servers =
|
||||||
HubServerChangedEventArgs?.Invoke(new HubServerChangedEventArgs(servers, HubServerChangeAction.Add));
|
await _restService.GetAsync<List<ServerHubInfo>>(new Uri(urlStr), CancellationToken.None);
|
||||||
|
_serverList.AddRange(servers);
|
||||||
|
HubServerChangedEventArgs?.Invoke(new HubServerChangedEventArgs(servers, HubServerChangeAction.Add));
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
HubServerLoadingError?.Invoke(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IsUpdating = false;
|
IsUpdating = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user