mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-15 06:35:29 -05:00
Add highdpi text/control setting, detect dark
Detects for system dark mode on startup since many users don't know about dark mode. Won't override any existing setting, just detects if no cfg exists `new()`. Text/control dpi scaling is opt-in for high dpi users, reduces font blurriness. https://github.com/kwsch/PKHeX/discussions/4458#discussioncomment-12362513 The hover-preview was rewritten in the past year to directly paint instead of updating many controls, so it works fine with `DpiUnawareGdiScaled`. I've not checked extensively to see if anything becomes broken, so user beware 💫
This commit is contained in:
@@ -39,6 +39,8 @@ static Program()
|
||||
|
||||
if (Settings.Startup.DarkMode)
|
||||
Application.SetColorMode(SystemColorMode.Dark);
|
||||
if (Settings.Startup.HighDpiText)
|
||||
Application.SetHighDpiMode(HighDpiMode.DpiUnawareGdiScaled);
|
||||
}
|
||||
|
||||
[STAThread]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using PKHeX.Core;
|
||||
|
||||
namespace PKHeX.WinForms;
|
||||
@@ -12,11 +13,14 @@ public sealed class StartupSettings : IStartupSettings
|
||||
public string Version { get; set; } = string.Empty;
|
||||
|
||||
[LocalizedDescription("Use the Dark color mode for the application on startup.")]
|
||||
public bool DarkMode { get; set; }
|
||||
public bool DarkMode { get; set; } = Application.SystemColorMode == SystemColorMode.Dark; // auto-detect for new settings, json load preserves any choice.
|
||||
|
||||
[LocalizedDescription("Force HaX mode on Program Launch")]
|
||||
public bool ForceHaXOnLaunch { get; set; }
|
||||
|
||||
[LocalizedDescription("Toggles a higher Dpi rendering mode for the application on startup.")]
|
||||
public bool HighDpiText { get; set; } // opt-in
|
||||
|
||||
[LocalizedDescription("Skips displaying the splash screen on Program Launch.")]
|
||||
public bool SkipSplashScreen { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user