- add: Favorite, start.
This commit is contained in:
1
.idea/.idea.Nebula/.idea/avalonia.xml
generated
1
.idea/.idea.Nebula/.idea/avalonia.xml
generated
@@ -14,6 +14,7 @@
|
|||||||
<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" />
|
||||||
<entry key="Nebula.Launcher/Views/Pages/AccountInfoView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/Pages/AccountInfoView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
<entry key="Nebula.Launcher/Views/Pages/ContentBrowserView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/Pages/ContentBrowserView.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/ExceptionView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/Popup/ExceptionView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
|
|||||||
BIN
Nebula.Launcher/Assets/star-full.png
Normal file
BIN
Nebula.Launcher/Assets/star-full.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
Nebula.Launcher/Assets/star.png
Normal file
BIN
Nebula.Launcher/Assets/star.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -143,6 +143,7 @@ public sealed partial class ContentBrowserViewModel : ViewModelBase
|
|||||||
if (path.Pathes.Count > 0 && (path.Pathes[0].StartsWith("ss14://") || path.Pathes[0].StartsWith("ss14s://")))
|
if (path.Pathes.Count > 0 && (path.Pathes[0].StartsWith("ss14://") || path.Pathes[0].StartsWith("ss14s://")))
|
||||||
{
|
{
|
||||||
ServerText = path.Pathes[0];
|
ServerText = path.Pathes[0];
|
||||||
|
path = new ContentPath("");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(ServerText))
|
if (string.IsNullOrEmpty(ServerText))
|
||||||
@@ -157,14 +158,14 @@ public sealed partial class ContentBrowserViewModel : ViewModelBase
|
|||||||
SelectedEntry = await CreateEntry(ServerText);
|
SelectedEntry = await CreateEntry(ServerText);
|
||||||
}
|
}
|
||||||
|
|
||||||
_debugService.Debug(path.Path);
|
_debugService.Debug("Going to:" + path.Path);
|
||||||
|
|
||||||
var oriPath = path.Clone();
|
var oriPath = path.Clone();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (SelectedEntry == null || !SelectedEntry.GetRoot().TryGetEntry(path, out var centry))
|
if (SelectedEntry == null || !SelectedEntry.GetRoot().TryGetEntry(path, out var centry))
|
||||||
{
|
{
|
||||||
throw new Exception("Not found!");
|
throw new Exception("Not found! " + oriPath.Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (appendHistory)
|
if (appendHistory)
|
||||||
|
|||||||
13
Nebula.Launcher/ViewModels/FavoriteServerListViewModel.cs
Normal file
13
Nebula.Launcher/ViewModels/FavoriteServerListViewModel.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using Nebula.Shared.Models;
|
||||||
|
|
||||||
|
namespace Nebula.Launcher.ViewModels;
|
||||||
|
|
||||||
|
public class FavoriteServerListViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
public FavoriteServerListViewModel() : base(){}
|
||||||
|
public FavoriteServerListViewModel(IServiceProvider provider) : base(provider){}
|
||||||
|
|
||||||
|
public ObservableCollection<ServerHubInfo> Servers = new();
|
||||||
|
}
|
||||||
@@ -13,44 +13,58 @@
|
|||||||
<viewModels:ContentBrowserViewModel />
|
<viewModels:ContentBrowserViewModel />
|
||||||
</Design.DataContext>
|
</Design.DataContext>
|
||||||
|
|
||||||
<StackPanel Margin="5">
|
<Grid
|
||||||
<Border BorderThickness="2,0,0,0" CornerRadius="10">
|
ColumnDefinitions="*,2*,40,40"
|
||||||
<Grid ColumnDefinitions="*,2*,40,40" RowDefinitions="*">
|
Margin="10"
|
||||||
|
RowDefinitions="40,*">
|
||||||
|
<Border
|
||||||
|
BorderThickness="2,0,0,0"
|
||||||
|
CornerRadius="10,10,0,0"
|
||||||
|
Grid.ColumnSpan="4" />
|
||||||
<TextBox
|
<TextBox
|
||||||
Margin="0"
|
Grid.Column="0"
|
||||||
|
Grid.Row="0"
|
||||||
|
Margin="5"
|
||||||
Text="{Binding ServerText}"
|
Text="{Binding ServerText}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Watermark="Server Url..." />
|
Watermark="Server Url..." />
|
||||||
<TextBox
|
<TextBox
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="0"
|
Grid.Row="0"
|
||||||
|
Margin="5"
|
||||||
Text="{Binding SearchText}"
|
Text="{Binding SearchText}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Watermark="Path..." />
|
Watermark="Path..." />
|
||||||
<Button
|
<Button
|
||||||
Command="{Binding OnBackEnter}"
|
Command="{Binding OnBackEnter}"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
|
Grid.Row="0"
|
||||||
Padding="10">
|
Padding="10">
|
||||||
<Image Source="/Assets/back.png" />
|
<Image Source="/Assets/back.png" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
Command="{Binding OnGoEnter}"
|
Command="{Binding OnGoEnter}"
|
||||||
Grid.Column="3"
|
Grid.Column="3"
|
||||||
|
Grid.Row="0"
|
||||||
Padding="10">
|
Padding="10">
|
||||||
<Image Source="/Assets/go.png" />
|
<Image Source="/Assets/go.png" />
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
|
||||||
</Border>
|
<ScrollViewer
|
||||||
<ScrollViewer Margin="0,5,10,5">
|
Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="4"
|
||||||
|
Grid.Row="1"
|
||||||
|
Margin="0,0,0,5">
|
||||||
<ItemsControl
|
<ItemsControl
|
||||||
Background="#00000000"
|
Background="#00000000"
|
||||||
ItemsSource="{Binding Entries}"
|
ItemsSource="{Binding Entries}"
|
||||||
Padding="0">
|
Padding="0,0,0,0">
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate DataType="{x:Type viewModels:ContentEntry}">
|
<DataTemplate DataType="{x:Type viewModels:ContentEntry}">
|
||||||
<Button
|
<Button
|
||||||
Command="{Binding OnPathGo}"
|
Command="{Binding OnPathGo}"
|
||||||
CornerRadius="0"
|
CornerRadius="0"
|
||||||
|
Height="30"
|
||||||
HorizontalAlignment="Stretch">
|
HorizontalAlignment="Stretch">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="15">
|
<StackPanel Orientation="Horizontal" Spacing="15">
|
||||||
<Border
|
<Border
|
||||||
@@ -63,7 +77,7 @@
|
|||||||
Source="{Binding IconPath}" />
|
Source="{Binding IconPath}" />
|
||||||
</Border>
|
</Border>
|
||||||
<Label>
|
<Label>
|
||||||
<TextBlock Text="{Binding Name}" />
|
<TextBlock Text="{Binding Name}" VerticalAlignment="Center" />
|
||||||
</Label>
|
</Label>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -71,5 +85,5 @@
|
|||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</StackPanel>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
11
Nebula.Launcher/Views/Pages/FavoriteServerListView.axaml
Normal file
11
Nebula.Launcher/Views/Pages/FavoriteServerListView.axaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<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>
|
||||||
13
Nebula.Launcher/Views/Pages/FavoriteServerListView.axaml.cs
Normal file
13
Nebula.Launcher/Views/Pages/FavoriteServerListView.axaml.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace Nebula.Launcher.Views.Pages;
|
||||||
|
|
||||||
|
public partial class FavoriteServerListView : UserControl
|
||||||
|
{
|
||||||
|
public FavoriteServerListView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user