Skip to content

Commit

Permalink
Fix ListBox overflow on high DPI (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
JDDKCN authored Sep 7, 2024
1 parent fafff80 commit e6a2d26
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 10 deletions.
1 change: 1 addition & 0 deletions Source/GrasscutterTools/Forms/FormMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Source/GrasscutterTools/Pages/PageAchievement.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Source/GrasscutterTools/Pages/PageAchievement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,9 @@ private void BtnProgress_Click(object sender, EventArgs e)
GenSelected("/achievement progress", NUDProgress.Text);
}

private void ListAchievements_MeasureItem(object sender, MeasureItemEventArgs e)
{
e.ItemHeight = ListAchievements.Font.Height * 3 / 2;
}
}
}
1 change: 1 addition & 0 deletions Source/GrasscutterTools/Pages/PageGiveArtifact.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Source/GrasscutterTools/Pages/PageGiveArtifact.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,5 +265,10 @@ private void LnkCharacterBuilder_LinkClicked(object sender, LinkLabelLinkClicked
{
UIUtil.OpenURL("https://github.com/Penelopeep/CharacterBuilder");
}

private void ListSubAttributionChecked_MeasureItem(object sender, MeasureItemEventArgs e)
{
e.ItemHeight = ListSubAttributionChecked.Font.Height * 3 / 2;
}
}
}
2 changes: 2 additions & 0 deletions Source/GrasscutterTools/Pages/PageGiveItem.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Source/GrasscutterTools/Pages/PageGiveItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ private void LblClearGiveItemLogs_Click(object sender, EventArgs e)
}

#endregion -- 物品记录 --


private void ListGameItems_MeasureItem(object sender, MeasureItemEventArgs e)
{
e.ItemHeight = ListGameItems.Font.Height * 3 / 2;
}
}
}
1 change: 1 addition & 0 deletions Source/GrasscutterTools/Pages/PageGiveWeapon.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Source/GrasscutterTools/Pages/PageGiveWeapon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,10 @@ private void BtnGiveAllWeapons_Click(object sender, EventArgs e)
{
SetCommand("/give", $"weapons x{NUDWeaponAmout.Value} lv{NUDWeaponLevel.Value} r{NUDWeaponRefinement.Value}");
}

private void ListWeapons_MeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e)
{
e.ItemHeight = ListWeapons.Font.Height * 3 / 2;
}
}
}
19 changes: 10 additions & 9 deletions Source/GrasscutterTools/Pages/PageMail.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Source/GrasscutterTools/Pages/PageMail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,5 +299,9 @@ private void BtnClearMail_Click(object sender, EventArgs e)

#endregion -- 邮件列表 Mail list --

private void ListMailItems_MeasureItem(object sender, MeasureItemEventArgs e)
{
e.ItemHeight = ListMailItems.Font.Height * 3 / 2;
}
}
}
1 change: 1 addition & 0 deletions Source/GrasscutterTools/Pages/PageQuest.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Source/GrasscutterTools/Pages/PageQuest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,10 @@ private void ListQuest_SelectedIndexChanged(object sender, EventArgs e)
var id = ItemMap.ToId(item);
SetCommand($"/quest add {id} | /quest finish {id}");
}

private void ListQuest_MeasureItem(object sender, MeasureItemEventArgs e)
{
e.ItemHeight = ListQuest.Font.Height * 3 / 2;
}
}
}
1 change: 1 addition & 0 deletions Source/GrasscutterTools/Pages/PageScene.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Source/GrasscutterTools/Pages/PageScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,10 @@ private void BtnFreezeTime_Click(object sender, EventArgs e)
{
SetCommand("/prop", "is_game_time_locked on");
}

private void ListScenes_MeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e)
{
e.ItemHeight = ListScenes.Font.Height * 3 / 2;
}
}
}
1 change: 1 addition & 0 deletions Source/GrasscutterTools/Pages/PageSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public PageSettings()
CmbGcVersions.SelectedIndexChanged += (o, e) => CommandVersion.Current = CommandVersion.List[CmbGcVersions.SelectedIndex];
CommandVersion.VersionChanged += (o, e) => Settings.Default.CommandVersion = CommandVersion.Current.ToString(3);

ChkListPages.ItemHeight = ChkListPages.Font.Height * 3 / 2;
}

/// <summary>
Expand Down

0 comments on commit e6a2d26

Please sign in to comment.