mirror of
https://github.com/AtomUI/AtomUI.git
synced 2026-10-17 05:31:01 +08:00
Fix motion issue for linux
This commit is contained in:
@@ -545,7 +545,7 @@ public class Popup : AvaloniaPopup,
|
||||
_buddyLayer.AttachWithMotion(null, () =>
|
||||
{
|
||||
opened?.Invoke();
|
||||
popupRoot.Opacity = 1.0;
|
||||
popupRoot.Opacity = 1.0d;
|
||||
popupRoot.PlatformImpl?.SetTopmost(true);
|
||||
_isNeedWaitFlipSync = false;
|
||||
_openAnimating = false;
|
||||
@@ -588,8 +588,9 @@ public class Popup : AvaloniaPopup,
|
||||
_closeAnimating = true;
|
||||
var popupRoot = Host as PopupRoot;
|
||||
Debug.Assert(popupRoot != null);
|
||||
popupRoot.Opacity = 0d;
|
||||
_buddyLayer.DetachWithMotion(null, () =>
|
||||
_buddyLayer.DetachWithMotion(() => {
|
||||
popupRoot.Opacity = 0.0;
|
||||
}, () =>
|
||||
{
|
||||
closed?.Invoke();
|
||||
Close();
|
||||
|
||||
@@ -55,7 +55,7 @@ internal class PopupBuddyLayer : SceneLayer, IPopupBuddyLayer, IShadowAwareLayer
|
||||
private Popup _buddyPopup;
|
||||
private IPopupHost? _popupHost;
|
||||
|
||||
private PopupBuddyDecorator _buddyDecorator;
|
||||
internal PopupBuddyDecorator _buddyDecorator;
|
||||
|
||||
public PopupBuddyLayer(Popup buddyPopup, TopLevel parent)
|
||||
: base(parent)
|
||||
@@ -171,6 +171,13 @@ internal class PopupBuddyLayer : SceneLayer, IPopupBuddyLayer, IShadowAwareLayer
|
||||
Show();
|
||||
popupRoot?.Activate();
|
||||
}
|
||||
else if (OperatingSystem.IsLinux())
|
||||
{
|
||||
Show();
|
||||
var popupRoot = _popupHost as PopupRoot;
|
||||
popupRoot?.Hide();
|
||||
popupRoot?.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
Show();
|
||||
@@ -214,7 +221,6 @@ internal class PopupBuddyLayer : SceneLayer, IPopupBuddyLayer, IShadowAwareLayer
|
||||
public void DetachWithMotion(Action? aboutToStart = null,
|
||||
Action? completedAction = null)
|
||||
{
|
||||
aboutToStart?.Invoke();
|
||||
var motion = CloseMotion ?? new ZoomBigOutMotion();
|
||||
if (MotionDuration != TimeSpan.Zero)
|
||||
{
|
||||
@@ -222,11 +228,19 @@ internal class PopupBuddyLayer : SceneLayer, IPopupBuddyLayer, IShadowAwareLayer
|
||||
}
|
||||
_buddyDecorator.CaptureContentControl();
|
||||
NotifyAboutToRunDetachMotion();
|
||||
motion.Run(_buddyDecorator, null, () =>
|
||||
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
completedAction?.Invoke();
|
||||
NotifyDetachMotionCompleted();
|
||||
Detach();
|
||||
aboutToStart?.Invoke();
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
motion.Run(_buddyDecorator, null, () =>
|
||||
{
|
||||
completedAction?.Invoke();
|
||||
NotifyDetachMotionCompleted();
|
||||
Detach();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user