Skip to content

Commit

Permalink
2.2.16 (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mochengvia authored Jan 18, 2022
1 parent 94534c3 commit cb6a5ca
Show file tree
Hide file tree
Showing 103 changed files with 1,357 additions and 546 deletions.
Binary file modified DotNet/WPF/Src/Core31/Panuon.UI.Silver/Resources/PanuonIcon.ttf
Binary file not shown.
2 changes: 1 addition & 1 deletion DotNet/WPF/Src/Core31/Panuon.UI.Silver/Themes/Generic.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome ResizeBorderThickness="3"
GlassFrameThickness="3"
GlassFrameThickness="0,1,0,0"
CornerRadius="0" />
</Setter.Value>
</Setter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<Resource Include="Resources\PanuonIcon.ttf" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Resource Include="Resources\PanuonIcon.ttf" />
<Resource Include="Resources\Fonts\PanuonIcon.ttf" />
</ItemGroup>
<ItemGroup>
Expand Down
Binary file modified DotNet/WPF/Src/Net40/Panuon.UI.Silver/Resources/PanuonIcon.ttf
Binary file not shown.
2 changes: 1 addition & 1 deletion DotNet/WPF/Src/Net40/Panuon.UI.Silver/Themes/Generic.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Setter Property="shell:WindowChrome.WindowChrome">
<Setter.Value>
<shell:WindowChrome ResizeBorderThickness="3"
GlassFrameThickness="3"
GlassFrameThickness="0,1,0,0"
CornerRadius="0" />
</Setter.Value>
</Setter>
Expand Down
Binary file modified DotNet/WPF/Src/Net45/Panuon.UI.Silver/Resources/PanuonIcon.ttf
Binary file not shown.
2 changes: 1 addition & 1 deletion DotNet/WPF/Src/Net45/Panuon.UI.Silver/Themes/Generic.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome ResizeBorderThickness="3"
GlassFrameThickness="3"
GlassFrameThickness="0,1,0,0"
CornerRadius="0" />
</Setter.Value>
</Setter>
Expand Down
Binary file modified DotNet/WPF/Src/Net472/Panuon.UI.Silver/Resources/PanuonIcon.ttf
Binary file not shown.
2 changes: 1 addition & 1 deletion DotNet/WPF/Src/Net472/Panuon.UI.Silver/Themes/Generic.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome ResizeBorderThickness="3"
GlassFrameThickness="5"
GlassFrameThickness="0,1,0,0"
CornerRadius="0" />
</Setter.Value>
</Setter>
Expand Down
9 changes: 9 additions & 0 deletions DotNet/WPF/Src/Samples/Views/MainView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
Click="BtnTestPendingBox_Click" />
</StackPanel>
<ScrollViewer Grid.Row="1"
Visibility="Collapsed"
Margin="0,15,0,0"
VerticalScrollBarVisibility="Disabled"
HorizontalScrollBarVisibility="Auto"
Expand Down Expand Up @@ -105,6 +106,14 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<Button Grid.Row="1"
Height="50"
Width="200"
pu:ButtonHelper.Icon="/Samples;component/Resources/Logo.png"
Content="Go"/>
<Grid Grid.Row="1">

</Grid>
<TextBlock Grid.Row="2"
FontSize="14"
Foreground="Gray"
Expand Down
4 changes: 2 additions & 2 deletions DotNet/WPF/Src/Samples/Views/Tools/IconFontView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@
<Setter Property="BorderThickness"
Value="2" />
<Setter Property="FontFamily"
Value="/Samples;component/Resources/#PanuonIcon" />
Value="/Panuon.UI.Silver;component/Resources/Fonts/#PanuonIcon" />
<Setter Property="ToolTip">
<Setter.Value>
<StackPanel>
<TextBlock Text="{Binding Icon}"
Foreground="Black"
FontFamily="/Samples;component/Resources/#PanuonIcon"
FontFamily="/Panuon.UI.Silver;component/Resources/Fonts/#PanuonIcon"
FontSize="50" />
<TextBlock HorizontalAlignment="Center"
Text="{Binding Code}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ public PendingBoxWindow(Window owner, bool interopOwnersMask, Rect? ownerRect, s
_cancelButtonStyle = XamlUtil.FromXaml<Style>(cancelButtonStyle);
_spinnerStyle = XamlUtil.FromXaml<Style>(spinnerStyle);

WindowStartupLocation = owner == null
? (ownerRect == null ? WindowStartupLocation.CenterScreen : WindowStartupLocation.Manual)
: WindowStartupLocation.CenterOwner;
if(ownerRect == null)
{
WindowStartupLocation = owner == null
? WindowStartupLocation.CenterScreen
: WindowStartupLocation.CenterOwner;
}

if (ownerRect == null)
{
Expand All @@ -88,6 +91,7 @@ public PendingBoxWindow(Window owner, bool interopOwnersMask, Rect? ownerRect, s
}));
_owner = ownerX;
}
Loaded += PendingBoxWindow_Loaded;
}

#endregion
Expand All @@ -113,9 +117,16 @@ public override void OnApplyTemplate()
_cancelButton.Visibility = _canCancel ? Visibility.Visible : Visibility.Collapsed;
_cancelButton.Click += CancelButton_Click;
}
if(captionTextBlock != null)
if (captionTextBlock != null)
{
captionTextBlock.Text = _captionText;
if (_captionText == null)
{
captionTextBlock.Visibility = Visibility.Collapsed;
}
else
{
captionTextBlock.Text = _captionText;
}
}
if (_messageTextBlock != null)
{
Expand Down Expand Up @@ -160,23 +171,8 @@ protected override void OnClosed(EventArgs e)
}
#endregion

#region
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
{
if (_ownerRect is Rect ownerRect)
{
var source = PresentationSource.FromVisual(this).CompositionTarget.TransformToDevice;

var width = (int)(sizeInfo.NewSize.Width * source.M11);
var height = (int)(sizeInfo.NewSize.Height * source.M22);
var left = ownerRect.X + (ownerRect.Width - width) / 2;
var top = ownerRect.Y + (ownerRect.Height - height) / 2;
#region OnRenderSizeChanged

Left = left / source.M11;
Top = top / source.M22;
}
base.OnRenderSizeChanged(sizeInfo);
}
#endregion

#endregion
Expand Down Expand Up @@ -208,6 +204,23 @@ public void UpdateMessage(string message)
#endregion

#region Event Handlers
private void PendingBoxWindow_Loaded(object sender, RoutedEventArgs e)
{
if (_ownerRect is Rect ownerRect)
{
var hwndSource = PresentationSource.FromVisual(this) as HwndSource;
var source = hwndSource.CompositionTarget.TransformToDevice;

var width = (int)(ActualWidth * source.M11);
var height = (int)(ActualHeight * source.M22);
var left = ownerRect.X + (ownerRect.Width - width) / 2;
var top = ownerRect.Y + (ownerRect.Height - height) / 2;

Left = left / source.M11;
Top = top / source.M22;
}
}

private void CancelButton_Click(object sender, RoutedEventArgs e)
{
if (_handler.TriggerCancel())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public override object Convert(object[] values, Type targetType, object paramete
{
Children = new DrawingCollection()
{
new GeometryDrawing(_stackBrush, null, new RectangleGeometry(new Rect(1, 1, width - 2, height - 2))),
new GeometryDrawing(_stackBrush, null, new RectangleGeometry(new Rect(1, 1, Math.Max(0, width - 2), Math.Max(0, height - 2)))),
new GeometryDrawing(background, null, new RectangleGeometry(new Rect(0, 0, width, height))),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@ public PendingHandlerImpl()
#region Methods
public void Close()
{
if(_window.IsAlive && _window.Target is PendingBoxWindow window)
if (_window.IsAlive && _window.Target is PendingBoxWindow window)
{
if (window.Dispatcher.CheckAccess())
window.Dispatcher.Invoke(new Action(() =>
{
window.Dispatcher.Invoke(new Action(() =>
{
window.Close();
}));
}
window.Close();
}));
}
}
#endregion
Expand All @@ -60,13 +57,10 @@ public void UpdateMessage(string message)
{
if (_window.IsAlive && _window.Target is PendingBoxWindow window)
{
if (window.Dispatcher.CheckAccess())
window.Dispatcher.Invoke(new Action(() =>
{
window.Dispatcher.Invoke(new Action(() =>
{
window.UpdateMessage(message);
}));
}
window.UpdateMessage(message);
}));
}
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Controls\CalendarXDayPresenter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\NoticeBoxWindow.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\ClippingBorder.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\ContentControlX.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\CustomPopup.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\IconPresenter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\InternalSpinner.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\MessageBoxXWindow.cs" />
Expand Down Expand Up @@ -130,14 +128,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Styles\CalendarXItemStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Styles\CalendarXStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Styles\CardStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
<Setter Property="Height"
Value="{Binding FontSize, Converter={StaticResource {x:Static rs:ConverterKeys.DoublePlusConverter}}, ConverterParameter=6, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />
</Style>


<Style x:Key="{x:Static rs:ComponentKeys.ButtonHelperPendingSpinnerStyle}"
TargetType="local:Spinner"
BasedOn="{StaticResource {ComponentResourceKey ResourceId=PendingSpinnerStyle, TypeInTargetAssembly={x:Type local:ButtonHelper}}}" />

<Style x:Key="{x:Static rs:StyleKeys.ButtonStyle}"
TargetType="Button">
<Setter Property="i:VisualStateHelper.Regist"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
Value="{Binding Path=(i:VisualStateHelper.Foreground), RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />
</Style>

<Style x:Key="{x:Static rs:ComponentKeys.ColorPickerClearButtonStyle}"
TargetType="Button"
BasedOn="{StaticResource {ComponentResourceKey ResourceId=ClearButtonStyle, TypeInTargetAssembly={x:Type local:ColorPicker}}}" />

<DataTemplate x:Key="{ComponentResourceKey ResourceId=PreviewTemplate, TypeInTargetAssembly={x:Type local:ColorPicker}}">
<Border Background="{Binding}"
BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource AncestorType=local:ColorPicker}, Mode=OneWay}"
Expand Down Expand Up @@ -66,10 +70,18 @@
</Style.Triggers>
</Style>

<Style x:Key="{x:Static rs:ComponentKeys.ColorPickerToggleArrowTransformControlStyle}"
TargetType="local:TransformControl"
BasedOn="{StaticResource {ComponentResourceKey ResourceId=ToggleArrowTransformControlStyle, TypeInTargetAssembly={x:Type local:ColorPicker}}}" />

<Style x:Key="{ComponentResourceKey ResourceId=ColorSelectorStyle, TypeInTargetAssembly={x:Type local:ColorPicker}}"
TargetType="local:ColorSelector">
</Style>

<Style x:Key="{x:Static rs:ComponentKeys.ColorPickerColorSelectorStyle}"
TargetType="local:ColorSelector"
BasedOn="{StaticResource {ComponentResourceKey ResourceId=ColorSelectorStyle, TypeInTargetAssembly={x:Type local:ColorPicker}}}" />

<Style TargetType="local:ColorPicker">
<Setter Property="i:VisualStateHelper.Regist"
Value="True" />
Expand Down
Loading

0 comments on commit cb6a5ca

Please sign in to comment.