mirror of
https://github.com/cyanfish/naps2.git
synced 2024-10-05 03:47:10 +03:00
Fix toolbar font size on mono
This commit is contained in:
parent
38a26f8059
commit
46854419ec
@ -8,5 +8,7 @@ namespace NAPS2.Compat
|
||||
public class DefaultRuntimeCompat : IRuntimeCompat
|
||||
{
|
||||
public bool UseToolStripRenderHack => true;
|
||||
|
||||
public bool SetToolbarFont => false;
|
||||
}
|
||||
}
|
||||
|
@ -8,5 +8,7 @@ namespace NAPS2.Compat
|
||||
public interface IRuntimeCompat
|
||||
{
|
||||
bool UseToolStripRenderHack { get; }
|
||||
|
||||
bool SetToolbarFont { get; }
|
||||
}
|
||||
}
|
||||
|
@ -8,5 +8,7 @@ namespace NAPS2.Compat
|
||||
public class MonoRuntimeCompat : IRuntimeCompat
|
||||
{
|
||||
public bool UseToolStripRenderHack => false;
|
||||
|
||||
public bool SetToolbarFont => true;
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using NAPS2.Compat;
|
||||
using NAPS2.Config;
|
||||
using NAPS2.ImportExport;
|
||||
using NAPS2.Lang;
|
||||
@ -175,11 +176,15 @@ namespace NAPS2.WinForms
|
||||
|
||||
private void RelayoutToolbar()
|
||||
{
|
||||
// Wrap text as necessary
|
||||
// Resize and wrap text as necessary
|
||||
using (var g = CreateGraphics())
|
||||
{
|
||||
foreach (var btn in tStrip.Items.OfType<ToolStripItem>())
|
||||
{
|
||||
if (PlatformCompat.Runtime.SetToolbarFont)
|
||||
{
|
||||
btn.Font = new Font("Segoe UI", 9);
|
||||
}
|
||||
btn.Text = stringWrapper.Wrap(btn.Text ?? "", 80, g, btn.Font);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user