- add: Favorites - start

This commit is contained in:
2025-01-28 19:59:35 +03:00
parent e1657d9234
commit 730e2e5529
11 changed files with 216 additions and 91 deletions

View File

@@ -1,5 +1,5 @@
<UserControl
Background="{StaticResource DefaultBackground}"
Background="#1a1a1a"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d"
@@ -39,7 +39,7 @@
<SplitView.Pane>
<Border
Background="{StaticResource DefaultBackground}"
BoxShadow="0 0 5 0 #121212"
BoxShadow="0 0 15 -2 #121212"
CornerRadius="0,8,8,0"
Grid.Column="0"
Grid.Row="0"
@@ -79,7 +79,7 @@
<Border
Background="{StaticResource DefaultBackground}"
BoxShadow="0 0 5 0 #121212"
BoxShadow="{StaticResource DefaultShadow}"
CornerRadius="0,0,0,0"
Grid.Column="0"
Grid.ColumnSpan="2"
@@ -103,7 +103,7 @@
https://cinka.ru/nebula-launcher/
</TextBlock>
</Button>
<TextBlock HorizontalAlignment="Right" VerticalAlignment="Center">prototype-product-v0.01</TextBlock>
<TextBlock HorizontalAlignment="Right" VerticalAlignment="Center">v0.02-a</TextBlock>
</Panel>
</Label>
</Border>
@@ -118,7 +118,7 @@
<Grid RowDefinitions="35,*,20">
<Border
BorderBrush="{StaticResource DefaultForeground}"
BorderThickness="0,0,0,2"
BoxShadow="0 2 15 -2 #121212"
CornerRadius="10,10,0,0"
Grid.Row="0">
<Panel Margin="12,0,0,0" VerticalAlignment="Center">
@@ -141,7 +141,7 @@
<Border
BorderBrush="{StaticResource DefaultForeground}"
BorderThickness="0,2,0,0"
BoxShadow="0 -2 15 -2 #121212"
CornerRadius="0,0,10,10"
Grid.Row="2">
<Panel Margin="12,0,12,0" VerticalAlignment="Center">

View File

@@ -13,12 +13,13 @@
<pages:AccountInfoViewModel />
</Design.DataContext>
<Grid
ColumnDefinitions="*,1.5*"
ColumnDefinitions="*,1*"
Margin="15"
RowDefinitions="*">
<StackPanel Grid.Column="1" Grid.Row="0">
<Border
BoxShadow="0 -1 15 0 #121212"
Background="{StaticResource DefaultBackground}"
BoxShadow="0 -1 15 -2 #121212"
CornerRadius="10,10,0,0"
Margin="5,5,5,0"
Padding="5">
@@ -32,7 +33,8 @@
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type pages:AuthLoginPasswordModel}">
<Border
BoxShadow="0 1 15 0 #121212"
Background="{StaticResource DefaultBackground}"
BoxShadow="0 1 15 -2 #121212"
CornerRadius="0,10,0,10"
Margin="5,5,5,5"
VerticalAlignment="Center">
@@ -74,7 +76,8 @@
Grid.ColumnSpan="{Binding AuthViewSpan}"
Grid.Row="0">
<Border
BoxShadow="0 0 15 0 #121212"
Background="{StaticResource DefaultBackground}"
BoxShadow="{StaticResource DefaultShadow}"
CornerRadius="10"
Margin="5"
Padding="15">
@@ -109,7 +112,7 @@
</StackPanel>
<Border
BoxShadow="0 0 5 0 #121212"
BoxShadow="{StaticResource DefaultShadow}"
CornerRadius="10"
IsVisible="{Binding AuthUrlConfigExpand}">
<ScrollViewer Height="80">
@@ -129,7 +132,7 @@
</ListBox>
</ScrollViewer>
</Border>
<Border BoxShadow="0 0 5 0 #121212">
<Border Background="{StaticResource DefaultSelected}" BoxShadow="{StaticResource DefaultShadow}">
<Button
Command="{Binding DoAuth}"
HorizontalAlignment="Stretch"
@@ -160,12 +163,12 @@
Margin="5,20,5,5"
Orientation="Horizontal"
Spacing="5">
<Border BoxShadow="0 0 5 0 #121212">
<Border BoxShadow="{StaticResource DefaultShadow}">
<Button Command="{Binding Logout}">
<Label>Logout</Label>
</Button>
</Border>
<Border BoxShadow="0 0 5 0 #121212">
<Border BoxShadow="{StaticResource DefaultShadow}">
<Button Command="{Binding SaveProfileCommand}">
<Label>Save profile</Label>
</Button>

View File

@@ -1,11 +0,0 @@
<UserControl
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d"
x:Class="Nebula.Launcher.Views.Pages.FavoriteServerListView"
xmlns="https://github.com/avaloniaui"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
Welcome to Avalonia!
</UserControl>

View File

@@ -1,11 +0,0 @@
using Avalonia.Controls;
namespace Nebula.Launcher.Views.Pages;
public partial class FavoriteServerListView : UserControl
{
public FavoriteServerListView()
{
InitializeComponent();
}
}

View File

@@ -22,7 +22,24 @@
Grid.RowSpan="2"
Margin="0,0,0,10"
Padding="0,0,10,0">
<ItemsControl ItemsSource="{Binding ServerInfos}" Padding="0" />
<StackPanel Spacing="5">
<Border
Background="{StaticResource DefaultSelected}"
BoxShadow="{StaticResource DefaultShadow}"
IsVisible="{Binding FavoriteVisible}"
Margin="5">
<StackPanel Margin="0,10,0,10" Spacing="5">
<Label
HorizontalAlignment="Center"
Margin="5"
VerticalAlignment="Center">
Favorites
</Label>
<ItemsControl ItemsSource="{Binding SortedFavoriteServers}" Padding="0" />
</StackPanel>
</Border>
<ItemsControl ItemsSource="{Binding ServerInfos}" Padding="0" />
</StackPanel>
</ScrollViewer>
<Border

View File

@@ -19,8 +19,8 @@
</Design.DataContext>
<Border
Background="Transparent"
BoxShadow="-2 0 18 -1 #121212"
Background="{StaticResource DefaultBackground}"
BoxShadow="-2 0 5 -1 #121212"
CornerRadius="10"
Margin="5">
<Grid ColumnDefinitions="*,80,50" RowDefinitions="35,*,*">
@@ -46,7 +46,7 @@
VerticalScrollBarVisibility="Disabled"
x:Name="AutoScrollViewer">
<Label VerticalAlignment="Center">
<TextBlock Text="{Binding ServerHubInfo.StatusData.Name}" />
<TextBlock Text="{Binding Status.Name}" />
</Label>
</ScrollViewer>
</Button>
@@ -58,15 +58,14 @@
Orientation="Horizontal"
VerticalAlignment="Center">
<Label>
<TextBlock Text="{Binding ServerHubInfo.StatusData.Players}" />
<TextBlock Text="{Binding Status.Players}" />
</Label>
<Label>/</Label>
<Label>
<TextBlock Text="{Binding ServerHubInfo.StatusData.SoftMaxPlayers}" />
<TextBlock Text="{Binding Status.SoftMaxPlayers}" />
</Label>
</StackPanel>
<Panel
Grid.Column="2"
Grid.Row="0"
@@ -152,7 +151,7 @@
Margin="5"
VerticalAlignment="Center">
<Label FontSize="10" Margin="5,0,5,0">
<TextBlock Text="{Binding ServerHubInfo.StatusData.Map}" />
<TextBlock Text="{Binding Status.Map}" />
</Label>
</Border>
</StackPanel>
@@ -167,7 +166,7 @@
Margin="5"
VerticalAlignment="Center">
<Label FontSize="10" Margin="5,0,5,0">
<TextBlock Text="{Binding ServerHubInfo.StatusData.Preset}" />
<TextBlock Text="{Binding Status.Preset}" />
</Label>
</Border>
</StackPanel>