- tweak: Favorite button
This commit is contained in:
@@ -22,24 +22,16 @@
|
||||
Grid.RowSpan="2"
|
||||
Margin="0,0,0,10"
|
||||
Padding="0,0,10,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>
|
||||
<Panel>
|
||||
<ItemsControl
|
||||
IsVisible="{Binding IsFavoriteMode}"
|
||||
ItemsSource="{Binding SortedFavoriteServers}"
|
||||
Padding="0" />
|
||||
<ItemsControl
|
||||
IsVisible="{Binding !IsFavoriteMode}"
|
||||
ItemsSource="{Binding SortedServers}"
|
||||
Padding="0" />
|
||||
</Panel>
|
||||
</ScrollViewer>
|
||||
|
||||
<Border
|
||||
@@ -49,7 +41,7 @@
|
||||
Grid.Row="1" />
|
||||
|
||||
<Grid
|
||||
ColumnDefinitions="*,40,40"
|
||||
ColumnDefinitions="*,40,40,40"
|
||||
Grid.Row="1"
|
||||
Margin="5,0,0,0"
|
||||
RowDefinitions="*">
|
||||
@@ -60,14 +52,20 @@
|
||||
VerticalAlignment="Center"
|
||||
Watermark="Server name..." />
|
||||
<Button
|
||||
Command="{Binding FilterRequired}"
|
||||
Command="{Binding AddFavoriteRequired}"
|
||||
Grid.Column="1"
|
||||
Padding="10">
|
||||
<Svg IsVisible="{Binding IsFavoriteMode}" Path="/Assets/svg/star.svg" />
|
||||
</Button>
|
||||
<Button
|
||||
Command="{Binding FilterRequired}"
|
||||
Grid.Column="2"
|
||||
Padding="10">
|
||||
<Svg Path="/Assets/svg/filter.svg" />
|
||||
</Button>
|
||||
<Button
|
||||
Command="{Binding UpdateRequired}"
|
||||
Grid.Column="2"
|
||||
Grid.Column="3"
|
||||
Padding="10">
|
||||
<Svg Path="/Assets/svg/refresh.svg" />
|
||||
</Button>
|
||||
|
||||
28
Nebula.Launcher/Views/Popup/AddFavoriteView.axaml
Normal file
28
Nebula.Launcher/Views/Popup/AddFavoriteView.axaml
Normal file
@@ -0,0 +1,28 @@
|
||||
<UserControl
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d"
|
||||
x:Class="Nebula.Launcher.Views.Popup.AddFavoriteView"
|
||||
x:DataType="popup:AddFavoriteViewModel"
|
||||
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:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.DataContext>
|
||||
<popup:AddFavoriteViewModel />
|
||||
</Design.DataContext>
|
||||
<StackPanel Margin="15" Spacing="10">
|
||||
<Border BoxShadow="{StaticResource DefaultShadow}">
|
||||
<TextBox Text="{Binding IpInput}" Watermark="ss14://localhost" />
|
||||
</Border>
|
||||
<Border Background="{StaticResource DefaultSelected}" BoxShadow="{StaticResource DefaultShadow}">
|
||||
<Button Command="{Binding OnEnter}" HorizontalAlignment="Stretch">
|
||||
<Label HorizontalAlignment="Center">Add</Label>
|
||||
</Button>
|
||||
</Border>
|
||||
<Label>
|
||||
<TextBlock Text="{Binding Error}" />
|
||||
</Label>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
18
Nebula.Launcher/Views/Popup/AddFavoriteView.axaml.cs
Normal file
18
Nebula.Launcher/Views/Popup/AddFavoriteView.axaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Avalonia.Controls;
|
||||
using Nebula.Launcher.ViewModels.Popup;
|
||||
|
||||
namespace Nebula.Launcher.Views.Popup;
|
||||
|
||||
public partial class AddFavoriteView : UserControl
|
||||
{
|
||||
public AddFavoriteView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public AddFavoriteView(AddFavoriteViewModel viewModel)
|
||||
: this()
|
||||
{
|
||||
DataContext = viewModel;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
BoxShadow="-2 0 5 -1 #121212"
|
||||
CornerRadius="10"
|
||||
Margin="5">
|
||||
<Grid ColumnDefinitions="*,80,50" RowDefinitions="35,*,*">
|
||||
<Grid ColumnDefinitions="*,80,50,50" RowDefinitions="35,*,*">
|
||||
<Border
|
||||
Background="Transparent"
|
||||
BoxShadow="0 3 3 -1 #121212"
|
||||
@@ -70,6 +70,28 @@
|
||||
Grid.Column="2"
|
||||
Grid.Row="0"
|
||||
Margin="5,0,0,0">
|
||||
<Button
|
||||
Command="{Binding ToggleFavorites}"
|
||||
CornerRadius="10,10,10,10"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsVisible="{Binding !IsFavorite}"
|
||||
VerticalAlignment="Stretch">
|
||||
<Svg Margin="4" Path="/Assets/svg/star.svg" />
|
||||
</Button>
|
||||
<Button
|
||||
Command="{Binding ToggleFavorites}"
|
||||
CornerRadius="10,10,10,10"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsVisible="{Binding IsFavorite}"
|
||||
VerticalAlignment="Stretch">
|
||||
<Svg Margin="4" Path="/Assets/svg/starfull.svg" />
|
||||
</Button>
|
||||
</Panel>
|
||||
|
||||
<Panel
|
||||
Grid.Column="3"
|
||||
Grid.Row="0"
|
||||
Margin="5,0,0,0">
|
||||
<Button
|
||||
Command="{Binding RunInstance}"
|
||||
CornerRadius="10,10,10,10"
|
||||
|
||||
Reference in New Issue
Block a user