mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-03-14 17:00:17 +00:00
Adjust layout, remove green circle for blue selector
This commit is contained in:
parent
8ce206892c
commit
21bf409929
2 changed files with 26 additions and 19 deletions
|
@ -1,3 +1,4 @@
|
|||
using Avalonia.Media;
|
||||
using Ryujinx.Ava.UI.Controls;
|
||||
using Ryujinx.Ava.UI.ViewModels;
|
||||
using Ryujinx.Ava.UI.Views.User;
|
||||
|
@ -15,6 +16,7 @@ namespace Ryujinx.Ava.UI.Models
|
|||
private string _name;
|
||||
private UserId _userId;
|
||||
private bool _isPointerOver;
|
||||
private IBrush _backgroundColor;
|
||||
public uint MaxProfileNameLength => 0x20;
|
||||
|
||||
public byte[] Image
|
||||
|
@ -57,6 +59,16 @@ namespace Ryujinx.Ava.UI.Models
|
|||
}
|
||||
}
|
||||
|
||||
public IBrush BackgroundColor
|
||||
{
|
||||
get => _backgroundColor;
|
||||
set
|
||||
{
|
||||
_backgroundColor = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public UserProfile(Profile profile, NavigationDialogHost owner)
|
||||
{
|
||||
_profile = profile;
|
||||
|
@ -67,11 +79,16 @@ namespace Ryujinx.Ava.UI.Models
|
|||
UserId = profile.UserId;
|
||||
}
|
||||
|
||||
public bool IsOpened => _profile.AccountState == AccountState.Open;
|
||||
|
||||
public void UpdateState()
|
||||
{
|
||||
OnPropertyChanged(nameof(IsOpened));
|
||||
Avalonia.Application.Current.Styles.TryGetResource("ControlFillColorSecondary", out object color);
|
||||
|
||||
if (color is not null)
|
||||
{
|
||||
BackgroundColor = _profile.AccountState == AccountState.Open
|
||||
? new SolidColorBrush((Color)color)
|
||||
: Brushes.Transparent;
|
||||
}
|
||||
OnPropertyChanged(nameof(Name));
|
||||
}
|
||||
|
||||
|
|
|
@ -59,16 +59,14 @@
|
|||
PointerEnter="Grid_PointerEntered"
|
||||
PointerLeave="Grid_OnPointerExited">
|
||||
<Border
|
||||
Margin="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
ClipToBounds="True"
|
||||
CornerRadius="5">
|
||||
CornerRadius="5"
|
||||
Background="{Binding BackgroundColor}">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Spacing="5"
|
||||
Margin="5">
|
||||
VerticalAlignment="Stretch">
|
||||
<Image
|
||||
Width="96"
|
||||
Height="96"
|
||||
|
@ -77,23 +75,15 @@
|
|||
Source="{Binding Image, Converter={StaticResource ByteImage}}" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Stretch"
|
||||
Width="96"
|
||||
MaxWidth="96"
|
||||
Text="{Binding Name}"
|
||||
TextAlignment="Center"
|
||||
TextWrapping="Wrap"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
MaxLines="2" />
|
||||
MaxLines="2"
|
||||
Margin="5" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border
|
||||
Width="10"
|
||||
Height="10"
|
||||
Margin="5"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Background="LimeGreen"
|
||||
CornerRadius="5"
|
||||
IsVisible="{Binding IsOpened}" />
|
||||
<Border
|
||||
Height="30"
|
||||
Width="30"
|
||||
|
|
Loading…
Reference in a new issue