* UINavMenu: 修复TipsText显示位置
This commit is contained in:
parent
a1ea6aaaaf
commit
4c96acd2c6
Binary file not shown.
Binary file not shown.
@ -38,7 +38,7 @@ namespace Sunny.UI.Demo
|
|||||||
Aside.CreateChildNode(parent, AddPage(new FOther(), ++pageIndex));
|
Aside.CreateChildNode(parent, AddPage(new FOther(), ++pageIndex));
|
||||||
//示例设置某个节点的小红点提示
|
//示例设置某个节点的小红点提示
|
||||||
Aside.ShowTips = true;
|
Aside.ShowTips = true;
|
||||||
Aside.SetNodeTipsText(parent.Nodes[0], "6", Color.Red, Color.White);
|
Aside.SetNodeTipsText(Aside.Nodes[0], "6", Color.Red, Color.White);
|
||||||
Aside.SetNodeTipsText(parent.Nodes[1], " ", Color.Lime, Color.White);
|
Aside.SetNodeTipsText(parent.Nodes[1], " ", Color.Lime, Color.White);
|
||||||
|
|
||||||
pageIndex = 2000;
|
pageIndex = 2000;
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
* 2021-12-13: V3.0.9 选中项可设置背景色渐变
|
* 2021-12-13: V3.0.9 选中项可设置背景色渐变
|
||||||
* 2022-01-02: V3.0.9 滚动条可设置颜色
|
* 2022-01-02: V3.0.9 滚动条可设置颜色
|
||||||
* 2022-03-19: V3.1.1 重构主题配色
|
* 2022-03-19: V3.1.1 重构主题配色
|
||||||
|
* 2022-03-24: V3.1.1 修复TipsText显示位置
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -734,6 +735,7 @@ namespace Sunny.UI
|
|||||||
SizeF tipsSize = e.Graphics.MeasureString(MenuHelper.GetTipsText(e.Node), TempFont);
|
SizeF tipsSize = e.Graphics.MeasureString(MenuHelper.GetTipsText(e.Node), TempFont);
|
||||||
float sfMax = Math.Max(tipsSize.Width, tipsSize.Height) + 1;
|
float sfMax = Math.Max(tipsSize.Width, tipsSize.Height) + 1;
|
||||||
float tipsLeft = Width - (ScrollBarVisible ? ScrollBarInfo.VerticalScrollBarWidth() : 0) - sfMax - sfMax;
|
float tipsLeft = Width - (ScrollBarVisible ? ScrollBarInfo.VerticalScrollBarWidth() : 0) - sfMax - sfMax;
|
||||||
|
if (e.Node.Nodes.Count > 0) tipsLeft -= 24;
|
||||||
float tipsTop = e.Bounds.Y + (ItemHeight - sfMax) / 2;
|
float tipsTop = e.Bounds.Y + (ItemHeight - sfMax) / 2;
|
||||||
|
|
||||||
if (MenuHelper[e.Node] != null)
|
if (MenuHelper[e.Node] != null)
|
||||||
|
@ -80,6 +80,8 @@ namespace Sunny.UI
|
|||||||
TipsTexts[tabPage] = tipsText;
|
TipsTexts[tabPage] = tipsText;
|
||||||
else
|
else
|
||||||
TipsTexts.TryAdd(tabPage, tipsText);
|
TipsTexts.TryAdd(tabPage, tipsText);
|
||||||
|
|
||||||
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetTipsText(TabPage tabPage)
|
private string GetTipsText(TabPage tabPage)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user