增加粉色

This commit is contained in:
2026-04-04 14:27:37 +08:00
parent 121d30f403
commit 218ec19559
5 changed files with 43 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ namespace CMLeonOS.Gui.UILib
{
hostWindow = parent;
OnClick = (_, _) => ToggleExpanded();
OnUnfocused = Collapse;
OnUnfocused = HandleUnfocused;
}
private readonly Window hostWindow;
@@ -149,6 +149,17 @@ namespace CMLeonOS.Gui.UILib
Render();
}
private void HandleUnfocused()
{
Window nextFocus = WM.PendingFocusTarget;
if (nextFocus == popupTable || nextFocus == popupWindow)
{
return;
}
Collapse();
}
private void ToggleExpanded()
{
if (Expanded)
@@ -288,6 +299,8 @@ namespace CMLeonOS.Gui.UILib
popupTable.SelectedBorder = Highlight;
popupTable.SelectedForeground = Foreground;
popupTable.TableCellSelected = PopupSelected;
popupTable.OnUnfocused = Collapse;
popupWindow.OnUnfocused = Collapse;
for (int i = 0; i < Items.Count; i++)
{