Адаптивность лого!
This commit is contained in:
parent
0bc523a2e9
commit
a4a06f5db3
@ -5,7 +5,8 @@
|
|||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
x:Class="MafiaClient.MainWindow"
|
x:Class="MafiaClient.MainWindow"
|
||||||
Title="MafiaClient"
|
Title="MafiaClient"
|
||||||
Closing="Window_OnClosing">
|
Closing="Window_OnClosing"
|
||||||
|
PropertyChanged="AvaloniaObject_OnPropertyChanged">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid x:Name="MainMenu" IsVisible="True">
|
<Grid x:Name="MainMenu" IsVisible="True">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@ -27,8 +28,7 @@
|
|||||||
<RowDefinition Height="20*"></RowDefinition>
|
<RowDefinition Height="20*"></RowDefinition>
|
||||||
<RowDefinition Height="10*"></RowDefinition>
|
<RowDefinition Height="10*"></RowDefinition>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Text="RMafia" FontSize="45" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Center" x:Name="Logo"></TextBlock>
|
||||||
<TextBlock Text="RMafia" FontSize="45" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Center"></TextBlock>
|
|
||||||
<Button Grid.Row="3" Grid.Column="2" Click="Play_OnClick" FontSize="25" HorizontalAlignment="Stretch">
|
<Button Grid.Row="3" Grid.Column="2" Click="Play_OnClick" FontSize="25" HorizontalAlignment="Stretch">
|
||||||
<Viewbox>
|
<Viewbox>
|
||||||
<TextBlock Text="Играть"></TextBlock>
|
<TextBlock Text="Играть"></TextBlock>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Reactive;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
@ -303,5 +304,13 @@ namespace MafiaClient
|
|||||||
{
|
{
|
||||||
App.Instance.GetRpcClient().Dispose();
|
App.Instance.GetRpcClient().Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void AvaloniaObject_OnPropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Property.Name == "TransformedBounds")
|
||||||
|
{
|
||||||
|
this.Find<TextBlock>("Logo").FontSize = Math.Min(this.Width / 17, this.Height / 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user