mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-06-07 22:59:14 +08:00
Fix height issue of nav list items on high dpi
This commit is contained in:
parent
b37016a49c
commit
fafff8090f
@ -63,6 +63,7 @@ namespace GrasscutterTools.Forms
|
|||||||
this.ListPages.FormattingEnabled = true;
|
this.ListPages.FormattingEnabled = true;
|
||||||
this.ListPages.Name = "ListPages";
|
this.ListPages.Name = "ListPages";
|
||||||
this.ListPages.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ListPages_DrawItem);
|
this.ListPages.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ListPages_DrawItem);
|
||||||
|
this.ListPages.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.ListPages_MeasureItem);
|
||||||
this.ListPages.SelectedIndexChanged += new System.EventHandler(this.ListPages_SelectedIndexChanged);
|
this.ListPages.SelectedIndexChanged += new System.EventHandler(this.ListPages_SelectedIndexChanged);
|
||||||
this.ListPages.SizeChanged += new System.EventHandler(this.ListPages_SizeChanged);
|
this.ListPages.SizeChanged += new System.EventHandler(this.ListPages_SizeChanged);
|
||||||
//
|
//
|
||||||
|
@ -399,8 +399,6 @@ namespace GrasscutterTools.Forms
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 导航列表项居中绘制
|
/// 导航列表项居中绘制
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void ListPages_DrawItem(object sender, DrawItemEventArgs e)
|
private void ListPages_DrawItem(object sender, DrawItemEventArgs e)
|
||||||
{
|
{
|
||||||
e.DrawBackground();
|
e.DrawBackground();
|
||||||
@ -413,6 +411,15 @@ namespace GrasscutterTools.Forms
|
|||||||
e.Graphics.DrawString(ListPages.Items[e.Index].ToString(), e.Font, new SolidBrush(e.ForeColor), e.Bounds, strFmt);
|
e.Graphics.DrawString(ListPages.Items[e.Index].ToString(), e.Font, new SolidBrush(e.ForeColor), e.Bounds, strFmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 导航列表高度测量
|
||||||
|
/// </summary>
|
||||||
|
private void ListPages_MeasureItem(object sender, MeasureItemEventArgs e)
|
||||||
|
{
|
||||||
|
// 列表项高度为字体高度1.5倍
|
||||||
|
e.ItemHeight = ListPages.Font.Height * 3 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 导航列表大小改变时触发
|
/// 导航列表大小改变时触发
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user