mirror of
https://github.com/AtomUI/AtomUI.git
synced 2026-10-23 01:38:40 +08:00
remove ghost for navmenu
This commit is contained in:
@@ -65,10 +65,11 @@ public class MenuFlyout : Flyout
|
||||
{
|
||||
_presenter = new MenuFlyoutPresenter
|
||||
{
|
||||
ItemsSource = Items,
|
||||
[!ItemsControl.ItemTemplateProperty] = this[!ItemTemplateProperty],
|
||||
[!ItemsControl.ItemContainerThemeProperty] = this[!ItemContainerThemeProperty],
|
||||
MenuFlyout = this
|
||||
ItemsSource = Items,
|
||||
[!ItemsControl.ItemTemplateProperty] = this[!ItemTemplateProperty],
|
||||
[!ItemsControl.ItemContainerThemeProperty] = this[!ItemContainerThemeProperty],
|
||||
[!MenuFlyoutPresenter.IsMotionEnabledProperty] = this[!IsMotionEnabledProperty],
|
||||
MenuFlyout = this
|
||||
};
|
||||
BindUtils.RelayBind(this, IsShowArrowEffectiveProperty, _presenter, MenuFlyoutPresenter.IsShowArrowProperty);
|
||||
BindUtils.RelayBind(this, IsMotionEnabledProperty, _presenter, MenuFlyoutPresenter.IsMotionEnabledProperty);
|
||||
|
||||
+12
-12
@@ -88,18 +88,6 @@ namespace AtomUI.Theme.Styling
|
||||
public static readonly TokenResourceKey TextFontWeight = new TokenResourceKey("Badge.TextFontWeight");
|
||||
}
|
||||
|
||||
public static class ButtonSpinnerTokenKey
|
||||
{
|
||||
public static readonly TokenResourceKey ControlWidth = new TokenResourceKey("ButtonSpinner.ControlWidth");
|
||||
public static readonly TokenResourceKey FilledHandleBg = new TokenResourceKey("ButtonSpinner.FilledHandleBg");
|
||||
public static readonly TokenResourceKey HandleActiveBg = new TokenResourceKey("ButtonSpinner.HandleActiveBg");
|
||||
public static readonly TokenResourceKey HandleBg = new TokenResourceKey("ButtonSpinner.HandleBg");
|
||||
public static readonly TokenResourceKey HandleBorderColor = new TokenResourceKey("ButtonSpinner.HandleBorderColor");
|
||||
public static readonly TokenResourceKey HandleHoverColor = new TokenResourceKey("ButtonSpinner.HandleHoverColor");
|
||||
public static readonly TokenResourceKey HandleIconSize = new TokenResourceKey("ButtonSpinner.HandleIconSize");
|
||||
public static readonly TokenResourceKey HandleWidth = new TokenResourceKey("ButtonSpinner.HandleWidth");
|
||||
}
|
||||
|
||||
public static class ButtonTokenKey
|
||||
{
|
||||
public static readonly TokenResourceKey BorderColorDisabled = new TokenResourceKey("Button.BorderColorDisabled");
|
||||
@@ -151,6 +139,18 @@ namespace AtomUI.Theme.Styling
|
||||
public static readonly TokenResourceKey TextHoverBg = new TokenResourceKey("Button.TextHoverBg");
|
||||
}
|
||||
|
||||
public static class ButtonSpinnerTokenKey
|
||||
{
|
||||
public static readonly TokenResourceKey ControlWidth = new TokenResourceKey("ButtonSpinner.ControlWidth");
|
||||
public static readonly TokenResourceKey FilledHandleBg = new TokenResourceKey("ButtonSpinner.FilledHandleBg");
|
||||
public static readonly TokenResourceKey HandleActiveBg = new TokenResourceKey("ButtonSpinner.HandleActiveBg");
|
||||
public static readonly TokenResourceKey HandleBg = new TokenResourceKey("ButtonSpinner.HandleBg");
|
||||
public static readonly TokenResourceKey HandleBorderColor = new TokenResourceKey("ButtonSpinner.HandleBorderColor");
|
||||
public static readonly TokenResourceKey HandleHoverColor = new TokenResourceKey("ButtonSpinner.HandleHoverColor");
|
||||
public static readonly TokenResourceKey HandleIconSize = new TokenResourceKey("ButtonSpinner.HandleIconSize");
|
||||
public static readonly TokenResourceKey HandleWidth = new TokenResourceKey("ButtonSpinner.HandleWidth");
|
||||
}
|
||||
|
||||
public static class CalendarTokenKey
|
||||
{
|
||||
public static readonly TokenResourceKey CellActiveWithRangeBg = new TokenResourceKey("Calendar.CellActiveWithRangeBg");
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
IsLightDismissEnabled="False"
|
||||
IsDetectMouseClickEnabled="False"
|
||||
Placement="RightEdgeAlignedTop"
|
||||
IsMotionEnabled="{TemplateBinding IsMotionEnabled}"
|
||||
IsMotionAwareOpen="{TemplateBinding IsSubMenuOpen, Mode=TwoWay}">
|
||||
<Border Name="{x:Static atom:MenuItemThemeConstants.PopupFramePart}">
|
||||
<atom:MenuScrollViewer IsScrollChainingEnabled="False">
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
IsLightDismissEnabled="False"
|
||||
IsDetectMouseClickEnabled="False"
|
||||
Placement="RightEdgeAlignedTop"
|
||||
IsMotionEnabled="{TemplateBinding IsMotionEnabled}"
|
||||
IsMotionAwareOpen="{TemplateBinding IsSubMenuOpen, Mode=OneWay}">
|
||||
<Border Name="{x:Static atom:NavMenuItemThemeConstants.PopupFramePart}">
|
||||
<atom:MenuScrollViewer>
|
||||
|
||||
@@ -674,15 +674,17 @@ public class Popup : AvaloniaPopup,
|
||||
|
||||
var shadowAwareLayer = _buddyLayer as IShadowAwareLayer;
|
||||
Debug.Assert(shadowAwareLayer != null);
|
||||
|
||||
shadowAwareLayer.RunCloseMotion(null, () =>
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
_buddyLayer?.Detach();
|
||||
Close();
|
||||
closed?.Invoke();
|
||||
_closeAnimating = false;
|
||||
_motionAwareOpened = false;
|
||||
_isNeedDetectFlip = true;
|
||||
shadowAwareLayer.RunCloseMotion(null, () =>
|
||||
{
|
||||
_buddyLayer?.Detach();
|
||||
Close();
|
||||
closed?.Invoke();
|
||||
_closeAnimating = false;
|
||||
_motionAwareOpened = false;
|
||||
_isNeedDetectFlip = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -311,7 +311,6 @@ internal class PopupBuddyLayer : SceneLayer, IShadowAwareLayer
|
||||
{
|
||||
disposable.Dispose();
|
||||
}
|
||||
MotionActor?.UnFollow();
|
||||
}
|
||||
|
||||
public void RunOpenMotion(Action? aboutToStart = null, Action? completedAction = null)
|
||||
@@ -474,9 +473,9 @@ internal class PopupBuddyLayer : SceneLayer, IShadowAwareLayer
|
||||
if (_popupHost is PopupRoot popupRoot)
|
||||
{
|
||||
var popupMotionAction = popupRoot.FindDescendantOfType<MotionActor>();
|
||||
if (popupMotionAction != null)
|
||||
if (popupMotionAction != null && MotionActor != null)
|
||||
{
|
||||
MotionActor?.Follow(popupMotionAction);
|
||||
popupMotionAction.Follow(MotionActor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -616,10 +615,6 @@ internal class PopupBuddyLayer : SceneLayer, IShadowAwareLayer
|
||||
Height = popupPresenter.DesiredSize.Height,
|
||||
};
|
||||
_ghostContentPresenter.Opacity = 1.0;
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
popupPresenter.Opacity = 0.0;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user