Cemu icon indicating copy to clipboard operation
Cemu copied to clipboard

[Linux] Dark mode display issues

Open Shoegzer opened this issue 2 years ago • 7 comments

If a system-wide dark theme is used, two main issues can be observed:

  1. The main window displays title text as white against a white background (white horizontal strip). The title icons display on the left just fine, however, and the rest of the main window honors the system-wide dark theme.

  2. Check boxes are not visible, although they can be selected. For example, under "General", text for options such as "Remember main window position" can be seen although the box itself does not appear. Clicking the mouse on the text itself does have the intended effect of remembering the window position, however.

Relevant Information:

  • OS: Linux Mint 21 (Ubuntu 22.04 base) / kernel 5.15
  • System theme: Mint-Y-Dark
  • GPU: Nvidia GTX 3070 / driver 515.65
  • Commit: 3349d7b

Shoegzer avatar Sep 10 '22 02:09 Shoegzer

I concur, same specs, successful build, same observation : n°2 for me as shown in the attachment. image

b4too avatar Sep 10 '22 08:09 b4too

Thanks for the screenshot, and yes that captures what I'm seeing. Just text, no boxes. I assume you're also seeing the same with my first point i.e. white-on-white text in the main window?

Shoegzer avatar Sep 10 '22 18:09 Shoegzer

I'm not a developer, but it seems that Cemu currently have "Game List" background colors hardcoded. Also, text colors are not set by default, only the background.

I changed the file "Cemu/src/gui/components/wxGameList.cpp" like this:

void wxGameList::UpdateItemColors(sint32 startIndex)
{
	wxWindowUpdateLocker lock(this);
	for (int i = startIndex; i < GetItemCount(); ++i)
	{
		const auto titleId = (uint64)GetItemData(i);
		if (GetConfig().IsGameListFavorite(titleId))//entry->favorite)
		{
			SetItemBackgroundColour(i, kFavoriteColor);
			SetItemTextColour(i, 0x000000UL);
		}
		else if ((i&1) != 0)
		{
			SetItemBackgroundColour(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
			SetItemTextColour(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
		}
		else
		{
			SetItemBackgroundColour(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWFRAME));
			SetItemTextColour(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
		}
	}
}

That's the result (Didn't test on Windows or Mac ): Screenshot_20220910_172746

kuunha avatar Sep 10 '22 20:09 kuunha

Thanks. That's a decent workaround and looks much better than master. Can you submit that as a PR for easier testing across platforms?

Shoegzer avatar Sep 10 '22 20:09 Shoegzer

Thanks. That's a decent workaround and looks much better than master. Can you submit that as a PR for easier testing across platforms?

Sorry, I'm not very good at this. Can you, or someone else, do this? Also, I've used this https://docs.wxwidgets.org/stable/settings_8h.html as reference

kuunha avatar Sep 10 '22 21:09 kuunha

I'm not a developer, but it seems that Cemu currently have "Game List" background colors hardcoded. Also, text colors are not set by default, only the background.

I changed the file "Cemu/src/gui/components/wxGameList.cpp" like this:

void wxGameList::UpdateItemColors(sint32 startIndex)
{
	wxWindowUpdateLocker lock(this);
	for (int i = startIndex; i < GetItemCount(); ++i)
	{
		const auto titleId = (uint64)GetItemData(i);
		if (GetConfig().IsGameListFavorite(titleId))//entry->favorite)
		{
			SetItemBackgroundColour(i, kFavoriteColor);
			SetItemTextColour(i, 0x000000UL);
		}
		else if ((i&1) != 0)
		{
			SetItemBackgroundColour(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
			SetItemTextColour(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
		}
		else
		{
			SetItemBackgroundColour(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWFRAME));
			SetItemTextColour(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
		}
	}
}

That's the result (Didn't test on Windows or Mac ): Screenshot_20220910_172746

I tried under windows 10, It looks not so good as above.
image

lijunyu-cn avatar Sep 11 '22 08:09 lijunyu-cn

Thanks for testing. From your screenshot it looks like the main issue is with the grey bars making the dark text you use with your light theme harder to see.

I've made a few changes to hopefully improve this by assigning the background and text to menu rather than window colors as they probably should be. It looks better than before on my own system at least. If you and @lijunyu-cn would please try it out and let me know I'd appreciate it - and let's move the discussion to the PR itself so it's more easily noticed by other testers. Thanks!

Shoegzer avatar Sep 11 '22 18:09 Shoegzer

Fixed with https://github.com/cemu-project/Cemu/pull/439

qurious-pixel avatar Dec 02 '22 21:12 qurious-pixel