GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Unreadable text on the Rename window when using unofficial dark themes

The Rename window looks fine with the Windows 10 default theme, but when using some unofficial Windows themes, mainly the dark ones, there're two instances where the text can become unreadable: The preset currently highlighted and the new names of renamed files.

Looks like all the text on the file renamer inherits the text colors from the colors and fonts tab on the preferences window or the current theme, except these two that are hard coded black. I don't really know if this a feature request or a bug report, so I'm gonna tag as both. :eyes:

Which tool and theme do we need to install to get the same thing?

On Windows 10 you need to install UXThemePatcher to enable custom themes support. I'm using niivu's xTheme right now, but any theme with dark window background should work, happened with two others that I tested too.

Thanks!

But that is a bug in the theme, not in Opus. None of the colours in those ListView controls are custom-drawn or overridden. They are entirely chosen by Windows and the visual style.

I made a quick test app to confirm it happens outside of Opus:

image

How it looks with the standard Win10 theme:

image

This is the entirety of the code that deals with the listview control:

	if (HWND hwndList = ::GetDlgItem(GetSafeHwnd(), IDC_LIST1))
	{
		DWORD dwListViewStyleEx = LVS_EX_DOUBLEBUFFER|LVS_EX_FULLROWSELECT;
		::SendMessage(hwndList, LVM_SETEXTENDEDLISTVIEWSTYLE, dwListViewStyleEx, dwListViewStyleEx);
		::SetWindowTheme(hwndList, L"Explorer", NULL);

		LVCOLUMN columnInfo{};
		columnInfo.mask = LVCF_TEXT;
		columnInfo.pszText = L"Column 1";
		::SendMessage(hwndList, LVM_INSERTCOLUMN, 0, reinterpret_cast< LPARAM >( &columnInfo ));

		int iItem = 0;

		LVITEM lvi{};
		lvi.mask = LVIF_TEXT;
		lvi.iItem = iItem++;
		lvi.pszText = L"Item 1";
		::SendMessage(hwndList, LVM_INSERTITEM, 0, reinterpret_cast< LPARAM >( &lvi ));
		lvi.pszText = L"Item 2";
		::SendMessage(hwndList, LVM_INSERTITEM, 0, reinterpret_cast< LPARAM >( &lvi ));
		lvi.pszText = L"Item 3";
		::SendMessage(hwndList, LVM_INSERTITEM, 0, reinterpret_cast< LPARAM >( &lvi ));

		::SendMessage(hwndList, LVM_SETCOLUMNWIDTH, 0, LVSCW_AUTOSIZE_USEHEADER);
	}

All it does is add a column and some items to the list, set it to fullrow selection, and apply the "Explorer" theme (which is what turns on hot selection and some other features). No painting or color code whatsoever; that's all down to what Windows does as standard.

The unofficial theme you're using must not be handling the "Explorer" listview theme correctly, resulting in it drawing black text over a near-black selection.

Hmm, that's weird, I thought it was a bug because other lists like the preferences window works fine, but looks like both are different views, right? If the same thing happens with other themes, maybe it's not a bug, but a limitation from the windows themes engine itself. Or maybe I just have to find one that "themes" this right. Thanks for the help.

It's because not all ListView controls are set to use the Explorer theme. (They don't use it by default, but it's the documented/official way to enable hot tracking and some other features, as well as get a more modern, non-Win95 look.)

I noticed the visual style had very different/inconsistent colors for selected items in a few controls. Sometimes selection was grey, sometimes black and barely visible against the background. I'm guessing it hasn't been tested well against lots of control types and the different themes you can apply to them.