Skip to content

Commit

Permalink
Attempt to fix buttons' labels being invisible on some Forms
Browse files Browse the repository at this point in the history
The "workaround" in question is `GTK_DATA_PREFIX='' ./EmuHawkMono.sh`,
which I'll be recommending in the short term until I can figure out how
to load or not load it. (Though `GTK_DATA_PREFIX` is likely part of the
answer).
  • Loading branch information
YoshiRulz committed Sep 6, 2024
1 parent a13333b commit 404f28f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/BizHawk.Client.EmuHawk/FormBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class FormBase : Form
{
private const string PLACEHOLDER_TITLE = "(will take value from WindowTitle/WindowTitleStatic)";

private static readonly bool IsUsingGTKThemeWorkaround = string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("GTK_DATA_PREFIX") ?? "UNSET");

/// <summary>
/// Under Mono, <see cref="SystemColors.Control">SystemColors.Control</see> returns an ugly beige.<br/>
/// This method recursively replaces the <see cref="Control.BackColor"/> of the given <paramref name="control"/> (can be a <see cref="Form"/>) with <see cref="Color.WhiteSmoke"/>
Expand Down Expand Up @@ -76,7 +78,7 @@ protected override void OnLoad(EventArgs e)
Close();
return;
}
if (OSTailoredCode.IsUnixHost) FixBackColorOnControls(this);
if (OSTailoredCode.IsUnixHost && !IsUsingGTKThemeWorkaround) FixBackColorOnControls(this);
UpdateWindowTitle();
}

Expand Down

0 comments on commit 404f28f

Please sign in to comment.