Bug 867 - [PATCH] Items in a disabled ListView disappear from view
Summary: [PATCH] Items in a disabled ListView disappear from view
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: Windows.Forms ()
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-09-16 15:55 UTC by Stephen McConnel
Modified: 2011-10-17 06:43 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
The attached program was built with both Microsoft Visual Studio 2008 and MonoDevelop 2.4 using version 2.10.4 of the mono libraries. It works fine on Windows using Microsoft's .Net implementation. (6.30 KB, application/x-compressed-tar)
2011-09-16 15:55 UTC, Stephen McConnel
Details
proposed patch (1.22 KB, patch)
2011-09-16 15:59 UTC, Stephen McConnel
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Stephen McConnel 2011-09-16 15:55:18 UTC
Created attachment 408 [details]
The attached program was built with both Microsoft Visual Studio 2008 and MonoDevelop 2.4 using version 2.10.4 of the mono libraries.  It works fine on Windows using Microsoft's .Net implementation.

When a ListView control is disabled, for instance by bringing up a dialog, all of the items in it totally disappear.  This is due to a combination of two factors:
1) ThemeWin32Classic.DrawListViewItem() draws the text of a list item with SystemBrushes.ControlLight.
2) The constructor for X11DesktopColors effectively defines ThemeEngine.Current.ColorControlLight (and ThemeEngine.Current.ColorControlLightLight) as White (RGB=0xFFFFFF).
Comment 1 Stephen McConnel 2011-09-16 15:59:48 UTC
Created attachment 409 [details]
proposed patch

The proposed patch works by changing the definitions of the ControlLight and ControlLightLight colors to be visible on a white background.
An alternative would be to either ignore control.Enabled in ThemeWin32Classic.DrawListViewItem(), or change the brush used to draw the text to something that would be visible against a white background.
Comment 2 Tom Hindle 2011-10-17 06:43:52 UTC
commit 52d4b4342f3ee58bb4d19690041e7aac610c974b