From 786b4d15c5ffcdca47004430231184a25a5b5772 Mon Sep 17 00:00:00 2001 From: Mahdi Date: Thu, 22 Apr 2021 14:46:55 +0430 Subject: [PATCH 1/3] Fix Growl RTL #799 --- src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs | 5 +++-- src/Shared/HandyControl_Shared/Data/Info/GrowlInfo.cs | 3 +++ src/Shared/HandyControl_Shared/Themes/Styles/Growl.xaml | 6 +++--- src/Shared/HandyControl_Shared/Themes/Theme.xaml | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs b/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs index 733991b2c..c815411c2 100644 --- a/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs +++ b/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs @@ -369,7 +369,8 @@ private static void ShowGlobal(GrowlInfo growlInfo) ConfirmStr = growlInfo.ConfirmStr, CancelStr = growlInfo.CancelStr, Type = growlInfo.Type, - _waitTime = Math.Max(growlInfo.WaitTime, 2) + _waitTime = Math.Max(growlInfo.WaitTime, 2), + FlowDirection = growlInfo.FlowDirection }; GrowlWindow.GrowlPanel.Children.Insert(0, ctl); } @@ -784,7 +785,7 @@ private void Close(bool invokeActionBeforeClose = false, bool invokeParam = true _timerClose?.Stop(); var transform = new TranslateTransform(); _gridMain.RenderTransform = transform; - var animation = AnimationHelper.CreateAnimation(ActualWidth); + var animation = AnimationHelper.CreateAnimation(FlowDirection == FlowDirection.LeftToRight ? ActualWidth : -ActualWidth); animation.Completed += (s, e) => { if (Parent is Panel panel) diff --git a/src/Shared/HandyControl_Shared/Data/Info/GrowlInfo.cs b/src/Shared/HandyControl_Shared/Data/Info/GrowlInfo.cs index 27d25ff18..08ccd6fee 100644 --- a/src/Shared/HandyControl_Shared/Data/Info/GrowlInfo.cs +++ b/src/Shared/HandyControl_Shared/Data/Info/GrowlInfo.cs @@ -1,4 +1,5 @@ using System; +using System.Windows; namespace HandyControl.Data { @@ -29,5 +30,7 @@ public class GrowlInfo public bool ShowCloseButton { get; set; } = true; public string Token { get; set; } + + public FlowDirection FlowDirection { get; set; } } } diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Growl.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Growl.xaml index 6c455970e..3dc940e7d 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Growl.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Growl.xaml @@ -49,13 +49,13 @@ - +