支持外置时钟

This commit is contained in:
ZouJin 2023-05-31 02:51:53 +10:00
parent c6a2708e71
commit ec1ab849b6
6 changed files with 10 additions and 10 deletions

View File

@ -49,10 +49,10 @@ namespace VPet.Plugin.DemoClock
/// <summary>
/// 放置距离设置
/// </summary>
public double PlaceBotton
public double PlaceTop
{
get => GetDouble("placebotton", 100);
set => SetDouble("placebotton", value);
get => GetDouble("placetop", 400);
set => SetDouble("placetop", value);
}
/// <summary>
/// 默认倒计时

View File

@ -3,7 +3,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:VPet.Plugin.DemoClock"
mc:Ignorable="d" xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" MinHeight="100" Height="Auto"
Width="450" VerticalAlignment="Bottom" HorizontalAlignment="Center">
Width="450" VerticalAlignment="Top" HorizontalAlignment="Center">
<UserControl.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</UserControl.Resources>

View File

@ -56,7 +56,7 @@ namespace VPet.Plugin.DemoClock
CloseTimer.Elapsed += CloseTimer_Elapsed;
Opacity = master.Set.Opacity;
Margin = new Thickness(0, 0, 0, master.Set.PlaceBotton);
Margin = new Thickness(0, master.Set.PlaceTop, 0, 0);
Master.MW.Main.MouseEnter += UserControl_MouseEnter;
Master.MW.Main.MouseLeave += UserControl_MouseLeave;
TimeTimer_Tick();

View File

@ -44,9 +44,9 @@
ToggleBrush="{DynamicResource DARKPrimaryDark}" Content="显示时间时启用24小时制"
CheckedToggleBrush="{DynamicResource DARKPrimaryText}" Grid.Column="2"
Checked="Switch24h_Checked" Unchecked="Switch24h_Checked" />
<pu:NumberInput Grid.Row="1" Grid.Column="3" Minimum="0" MaxHeight="350" Margin="5"
<pu:NumberInput Grid.Row="1" Grid.Column="3" Minimum="-100" Maximum="600" Margin="5"
Value="{Binding ElementName=PlaceSilder, Path=Value}" CornerRadius="3" />
<Slider Grid.Row="1" Grid.Column="2" x:Name="PlaceSilder" Minimum="0" Maximum="350" Value="100"
<Slider Grid.Row="1" Grid.Column="2" x:Name="PlaceSilder" Minimum="-100" Maximum="600" Value="300"
VerticalAlignment="Center" Background="{DynamicResource DARKPrimaryLighter}"
pu:SliderHelper.CoveredBackground="{DynamicResource DARKPrimaryDarker}"
ValueChanged="PlaceSilder_ValueChanged" />

View File

@ -29,7 +29,7 @@ namespace VPet.Plugin.DemoClock
Master = master;
Set = Master.Set;
Switch24h.IsChecked = Set.Hour24;
PlaceSilder.Value = Set.PlaceBotton;
PlaceSilder.Value = Set.PlaceTop;
OpacitySilder.Value = Set.Opacity * 100;
SwitchAutoLayer.IsChecked = Set.PlaceAutoBack;
NumTimeDiff.Value = Set.TimeShifting;
@ -56,8 +56,8 @@ namespace VPet.Plugin.DemoClock
{
if (!AllowChange)
return;
Set.PlaceBotton = PlaceSilder.Value;
Master.WPFTimeClock.Margin = new Thickness(0, 0, 0, Set.PlaceBotton);
Set.PlaceTop = PlaceSilder.Value;
Master.WPFTimeClock.Margin = new Thickness(0, Set.PlaceTop, 0, 0);
}
private void OpacitySilder_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)