- 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

@@ -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