设置页

This commit is contained in:
末城via 2023-01-03 12:18:21 +08:00
parent 7639a4b55a
commit c52f20bfbe
7 changed files with 50 additions and 104 deletions

View File

@ -6,7 +6,7 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VPet-Simulator.Windows;component/Design/Theme/default.xaml" />
<ResourceDictionary Source="/VPet-Simulator.Core;component/Display/Theme.xaml" />
<ResourceDictionary Source="/VPet-Simulator.Windows;component/Design/Theme/basestyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

View File

@ -6,6 +6,25 @@
<pucore:SharedResourceDictionary Source="/Panuon.WPF.UI;component/Control.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="BaseWindowXStyle"
TargetType="pu:WindowX">
<Setter Property="pu:WindowXCaption.Background"
Value="{DynamicResource DARKPrimary}" />
<Setter Property="pu:WindowXCaption.Foreground"
Value="{DynamicResource DARKPrimaryText}" />
<Setter Property="pu:WindowXCaption.Buttons"
Value="Close" />
<Setter Property="pu:WindowXCaption.CloseButtonStyle">
<Setter.Value>
<Style TargetType="Button"
BasedOn="{StaticResource {x:Static pu:WindowXCaption.CloseButtonStyle}}">
<Setter Property="pu:ButtonHelper.HoverBackground"
Value="{x:Null}" />
</Style>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="StandardComboBoxStyle"
TargetType="{x:Type ComboBox}"
BasedOn="{StaticResource {x:Type ComboBox}}">
@ -147,13 +166,13 @@
<Setter Property="pu:MenuHelper.TopLevelItemsBackground"
Value="Transparent" />
<Setter Property="pu:MenuHelper.TopLevelItemsHoverBackground"
Value="{DynamicResource DARKPrimary}" />
<Setter Property="pu:MenuHelper.TopLevelItemsHoverForeground"
Value="{DynamicResource DARKPrimaryText}" />
Value="{DynamicResource SecondaryLight}" />
<!--<Setter Property="pu:MenuHelper.TopLevelItemsHoverForeground"
Value="{DynamicResource DARKPrimaryText}" />-->
<Setter Property="pu:MenuHelper.TopLevelItemsOpenedBackground"
Value="{DynamicResource DARKPrimary}" />
<Setter Property="pu:MenuHelper.TopLevelItemsOpenedForeground"
Value="{DynamicResource DARKPrimaryText}" />
Value="{DynamicResource SecondaryLight}" />
<!--<Setter Property="pu:MenuHelper.TopLevelItemsOpenedForeground"
Value="{DynamicResource DARKPrimaryText}" />-->
<Setter Property="pu:MenuHelper.SubmenuItemsPadding"
Value="20,0" />
<Setter Property="pu:MenuHelper.SubmenuItemsHeight"
@ -167,14 +186,13 @@
<Setter Property="pu:MenuHelper.SubmenuItemsBackground"
Value="Transparent" />
<Setter Property="pu:MenuHelper.SubmenuItemsHoverBackground"
Value="{DynamicResource DARKPrimary}" />
<Setter Property="pu:MenuHelper.SubmenuItemsHoverForeground"
Value="{DynamicResource DARKPrimaryText}" />
Value="{DynamicResource SecondaryLight}" />
<!--<Setter Property="pu:MenuHelper.SubmenuItemsHoverForeground"
Value="{DynamicResource DARKPrimaryText}" />-->
<Setter Property="pu:MenuHelper.SubmenuItemsOpenedBackground"
Value="{DynamicResource DARKPrimary}" />
<Setter Property="pu:MenuHelper.SubmenuItemsOpenedForeground"
Value="{DynamicResource DARKPrimaryText}" />
Value="{DynamicResource SecondaryLight}" />
<!--<Setter Property="pu:MenuHelper.SubmenuItemsOpenedForeground"
Value="{DynamicResource DARKPrimaryText}" />-->
<Setter Property="pu:MenuHelper.SubmenuItemsSeparatorVisibility"
Value="Visible" />
<Setter Property="pu:MenuHelper.SubmenuItemsSeparatorBrush"

View File

@ -1,77 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:VPet_Simulator.Windows">
<!--
注释: 主题中的部分颜色是根据计算算出来的,比如说Trans
-->
<SolidColorBrush x:Key="Primary"
Color="#FF81d4fa" />
<SolidColorBrush x:Key="PrimaryTrans"
Color="#CC81d4fa" />
<SolidColorBrush x:Key="PrimaryTrans4"
Color="#4481d4fa" />
<SolidColorBrush x:Key="PrimaryTransA"
Color="#AA81d4fa" />
<SolidColorBrush x:Key="PrimaryTransE"
Color="#EE81d4fa" />
<SolidColorBrush x:Key="PrimaryLight"
Color="#FFA3E2FF" />
<SolidColorBrush x:Key="PrimaryLighter"
Color="#FFC1EBFF" />
<SolidColorBrush x:Key="PrimaryDark"
Color="#FF5CBEEA" />
<SolidColorBrush x:Key="PrimaryDarker"
Color="#FF3CA9DB" />
<SolidColorBrush x:Key="PrimaryText"
Color="#FF000000" />
<SolidColorBrush x:Key="PrimaryHover"
Color="#FFA4D4F9"/>
<SolidColorBrush x:Key="Secondary"
Color="#FF90caf9" />
<SolidColorBrush x:Key="SecondaryTrans"
Color="#CC90caf9" />
<SolidColorBrush x:Key="SecondaryTrans4"
Color="#4490caf9" />
<SolidColorBrush x:Key="SecondaryTransA"
Color="#AA90caf9" />
<SolidColorBrush x:Key="SecondaryTransE"
Color="#EE90caf9" />
<SolidColorBrush x:Key="SecondaryLight"
Color="#FFADD7F9" />
<SolidColorBrush x:Key="SecondaryLighter"
Color="#FFCBE4F9" />
<SolidColorBrush x:Key="SecondaryDark"
Color="#FF6BB1E9" />
<SolidColorBrush x:Key="SecondaryDarker"
Color="#FF4999DA" />
<SolidColorBrush x:Key="SecondaryText"
Color="#FF000000" />
<SolidColorBrush x:Key="DARKPrimary"
Color="#FF039be5" />
<SolidColorBrush x:Key="DARKPrimaryTrans"
Color="#CC039be5" />
<SolidColorBrush x:Key="DARKPrimaryTrans4"
Color="#44039be5" />
<SolidColorBrush x:Key="DARKPrimaryTransA"
Color="#AA039be5" />
<SolidColorBrush x:Key="DARKPrimaryTransE"
Color="#EE039be5" />
<SolidColorBrush x:Key="DARKPrimaryLight"
Color="#FF1FA9EC" />
<SolidColorBrush x:Key="DARKPrimaryLighter"
Color="#FF3DB8F4" />
<SolidColorBrush x:Key="DARKPrimaryDark"
Color="#FF0290D5" />
<SolidColorBrush x:Key="DARKPrimaryDarker"
Color="#FF0286C6" />
<SolidColorBrush x:Key="DARKPrimaryText" Color="#FFffffff" />
<Color x:Key="ShadowColor">#90CAF9</Color>
</ResourceDictionary>

View File

@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VPet_Simulator.Core;
using VPet_Simulator.Windows.WinDesign;
namespace VPet_Simulator.Windows
{
@ -51,8 +52,9 @@ namespace VPet_Simulator.Windows
}
public void ShowSetting()
{//TODO
throw new NotImplementedException();
{
var settingWindow = new winGameSetting();
settingWindow.ShowDialog();
}
public double ZoomRatio => 0.5;

View File

@ -111,10 +111,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Design\Theme\default.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

View File

@ -1,4 +1,4 @@
<Grid x:Class="VPet_Simulator.Windows.WinDesign.winGameSetting"
<pu:WindowX x:Class="VPet_Simulator.Windows.WinDesign.winGameSetting"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@ -7,7 +7,13 @@
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI"
mc:Ignorable="d"
d:DesignHeight="450"
d:DesignWidth="800">
d:DesignWidth="800"
Title="设置"
Width="350"
Height="450"
Style="{DynamicResource BaseWindowXStyle}"
WindowStartupLocation="CenterScreen">
<Grid>
<TabControl Margin="5" BorderThickness="0" pu:TabControlHelper.ItemsHeight="NaN"
pu:TabControlHelper.ItemsFontSize="14" Background="Transparent" pu:TabControlHelper.ItemsPadding="10,7"
pu:TabControlHelper.ItemsCornerRadius="4"
@ -18,7 +24,7 @@
<TabControl.ContentTemplate>
<DataTemplate>
<Border Margin="5,10,5,20" CornerRadius="15" Background="{DynamicResource DARKPrimaryText}">
<ContentControl Content="{Binding}" Margin="15"/>
<ContentControl Content="{Binding}" Margin="15,10"/>
</Border>
</DataTemplate>
</TabControl.ContentTemplate>
@ -345,5 +351,5 @@
</TabControl>
<Label x:Name="GameVerison" Content="版本v1.0 (655366666)" HorizontalAlignment="Left" Margin="0,398,0,-1"
VerticalAlignment="Top" FontSize="10" Foreground="Green" Background="{x:Null}" />
</Grid>
</Grid>
</pu:WindowX>

View File

@ -1,4 +1,5 @@
using System;
using Panuon.WPF.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -18,7 +19,7 @@ namespace VPet_Simulator.Windows.WinDesign
/// <summary>
/// winGameSetting.xaml 的交互逻辑
/// </summary>
public partial class winGameSetting : Grid
public partial class winGameSetting : WindowX
{
public winGameSetting()
{