Скруглена таблица
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
using Sms.Environment;
|
||||
|
||||
namespace Sms.Environment.Linux;
|
||||
|
||||
public sealed class LinuxEnvironmentVariableStore : IEnvironmentVariableStore
|
||||
|
||||
@@ -17,10 +17,24 @@
|
||||
<Style Selector="Button.titleButton:pointerover">
|
||||
<Setter Property="Background" Value="#D8D8D8" />
|
||||
</Style>
|
||||
<Style Selector="Button.titleButton.close">
|
||||
<Setter Property="CornerRadius" Value="0,11,0,0" />
|
||||
</Style>
|
||||
<Style Selector="Button.titleButton.close:pointerover">
|
||||
<Setter Property="Background" Value="#E81123" />
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
</Style>
|
||||
<Style Selector="DataGrid.roundedGrid">
|
||||
<Setter Property="RowHeight" Value="32" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="DataGrid.roundedGrid DataGridColumnHeader">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="DataGrid.roundedGrid DataGridColumnHeader /template/ Border#HeaderBorder">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="DataGridRow.appSettings">
|
||||
<Setter Property="Background" Value="#E3F2FD" />
|
||||
</Style>
|
||||
@@ -34,8 +48,5 @@
|
||||
<Style Selector="DataGridRow.appSettings.userStore">
|
||||
<Setter Property="Background" Value="#C8E6C9" />
|
||||
</Style>
|
||||
<Style Selector="DataGrid">
|
||||
<Setter Property="RowHeight" Value="32" />
|
||||
</Style>
|
||||
</Application.Styles>
|
||||
</Application>
|
||||
|
||||
6
src/Sms.TaskTwo.Avalonia/AppResources.cs
Normal file
6
src/Sms.TaskTwo.Avalonia/AppResources.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Sms.TaskTwo.Avalonia;
|
||||
|
||||
public static class AppResources
|
||||
{
|
||||
public const string WindowTitle = "Тестовое Avalonia-приложение для SmartMealService";
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
mc:Ignorable="d"
|
||||
x:Class="Sms.TaskTwo.Avalonia.Views.MainWindow"
|
||||
x:DataType="vm:MainWindowViewModel"
|
||||
Title="{x:Static core:AppResources.WindowTitle}"
|
||||
xmlns:core="using:Sms.TaskTwo.Core"
|
||||
Title="{x:Static app:AppResources.WindowTitle}"
|
||||
xmlns:app="using:Sms.TaskTwo.Avalonia"
|
||||
Width="960"
|
||||
Height="600"
|
||||
MinWidth="760"
|
||||
@@ -20,26 +20,30 @@
|
||||
Background="White"
|
||||
BorderBrush="#C8C8C8"
|
||||
BorderThickness="1"
|
||||
Margin="8">
|
||||
Margin="8"
|
||||
ClipToBounds="True">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,*">
|
||||
<Grid Grid.Row="0"
|
||||
ColumnDefinitions="*,Auto,Auto"
|
||||
Background="#ECECEC"
|
||||
Height="44">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{x:Static core:AppResources.WindowTitle}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="16,0,8,0"
|
||||
FontSize="14" />
|
||||
<Button Grid.Column="1"
|
||||
Classes="titleButton"
|
||||
Content="−"
|
||||
Click="OnMinimizeClick" />
|
||||
<Button Grid.Column="2"
|
||||
Classes="titleButton close"
|
||||
Content="×"
|
||||
Click="OnCloseClick" />
|
||||
</Grid>
|
||||
<Border Grid.Row="0"
|
||||
Background="#ECECEC"
|
||||
CornerRadius="11,11,0,0"
|
||||
ClipToBounds="True"
|
||||
Height="44">
|
||||
<Grid ColumnDefinitions="*,Auto,Auto">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{x:Static app:AppResources.WindowTitle}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="16,0,8,0"
|
||||
FontSize="14" />
|
||||
<Button Grid.Column="1"
|
||||
Classes="titleButton"
|
||||
Content="−"
|
||||
Click="OnMinimizeClick" />
|
||||
<Button Grid.Column="2"
|
||||
Classes="titleButton close"
|
||||
Content="×"
|
||||
Click="OnCloseClick" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Row="1"
|
||||
Margin="12,8,12,0"
|
||||
@@ -89,51 +93,57 @@
|
||||
IsVisible="{Binding ReloadEnvironmentMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}" />
|
||||
</StackPanel>
|
||||
|
||||
<DataGrid x:Name="VariablesGrid"
|
||||
Grid.Row="4"
|
||||
Margin="12,4,12,12"
|
||||
ItemsSource="{Binding Rows}"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserReorderColumns="False"
|
||||
CanUserResizeColumns="True"
|
||||
CanUserSortColumns="False"
|
||||
GridLinesVisibility="All"
|
||||
HeadersVisibility="Column"
|
||||
BorderThickness="1"
|
||||
BorderBrush="#B0B0B0"
|
||||
LoadingRow="OnLoadingRow">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Header=""
|
||||
Width="44">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate x:DataType="vm:EnvironmentVariableRowViewModel">
|
||||
<CheckBox IsChecked="{Binding UseUserStore, Mode=TwoWay}"
|
||||
IsEnabled="{Binding CanChangeUserStore}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="Поле"
|
||||
Binding="{Binding Field}"
|
||||
IsReadOnly="True"
|
||||
Width="210"
|
||||
MinWidth="150" />
|
||||
<DataGridTextColumn Header="Требуемое значение"
|
||||
Binding="{Binding RequiredValue, Mode=TwoWay}"
|
||||
Width="2*"
|
||||
MinWidth="140" />
|
||||
<DataGridTextColumn Header="Актуальное значение"
|
||||
Binding="{Binding ActualValueDisplay}"
|
||||
IsReadOnly="True"
|
||||
Width="2*"
|
||||
MinWidth="140" />
|
||||
<DataGridTextColumn Header="Комментарий"
|
||||
Binding="{Binding Comment, Mode=TwoWay}"
|
||||
Width="240"
|
||||
MinWidth="180" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Border Grid.Row="4"
|
||||
Margin="12,4,12,12"
|
||||
CornerRadius="8"
|
||||
ClipToBounds="True"
|
||||
Background="White"
|
||||
BorderBrush="#B0B0B0"
|
||||
BorderThickness="1">
|
||||
<DataGrid x:Name="VariablesGrid"
|
||||
Classes="roundedGrid"
|
||||
ItemsSource="{Binding Rows}"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserReorderColumns="False"
|
||||
CanUserResizeColumns="True"
|
||||
CanUserSortColumns="False"
|
||||
GridLinesVisibility="All"
|
||||
HeadersVisibility="Column"
|
||||
BorderThickness="0"
|
||||
LoadingRow="OnLoadingRow">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Header=""
|
||||
Width="44">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate x:DataType="vm:EnvironmentVariableRowViewModel">
|
||||
<CheckBox IsChecked="{Binding UseUserStore, Mode=TwoWay}"
|
||||
IsEnabled="{Binding CanChangeUserStore}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="Поле"
|
||||
Binding="{Binding Field}"
|
||||
IsReadOnly="True"
|
||||
Width="210"
|
||||
MinWidth="150" />
|
||||
<DataGridTextColumn Header="Требуемое значение"
|
||||
Binding="{Binding RequiredValue, Mode=TwoWay}"
|
||||
Width="2*"
|
||||
MinWidth="140" />
|
||||
<DataGridTextColumn Header="Актуальное значение"
|
||||
Binding="{Binding ActualValueDisplay}"
|
||||
IsReadOnly="True"
|
||||
Width="2*"
|
||||
MinWidth="140" />
|
||||
<DataGridTextColumn Header="Комментарий"
|
||||
Binding="{Binding Comment, Mode=TwoWay}"
|
||||
Width="240"
|
||||
MinWidth="180" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Window>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Sms.TaskTwo.Core;
|
||||
|
||||
public static class AppResources
|
||||
{
|
||||
public const string WindowTitle = "Тестовое WPF-приложение для SmartMealService";
|
||||
}
|
||||
Reference in New Issue
Block a user