Issue 59364 - HighContrastMode does not change when returned from HC
Summary: HighContrastMode does not change when returned from HC
Status: CLOSED FIXED
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: 680m142
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 2.0.2
Assignee: philipp.lohmann
QA Contact: issues@gsl
URL:
Keywords: accessibility
Depends on:
Blocks:
 
Reported: 2005-12-14 17:38 UTC by kendy
Modified: 2006-01-26 13:40 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Fix for this issue. (670 bytes, patch)
2005-12-14 17:39 UTC, kendy
no flags Details | Diff
Better version of the patch. (1.85 KB, patch)
2005-12-15 09:32 UTC, kendy
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description kendy 2005-12-14 17:38:06 UTC
Hi Philipp,

Seems that we can switch settings to the HighContrastMode, but we are unable to
leave it...  Could you please have a look at the attached patch?
Comment 1 kendy 2005-12-14 17:39:13 UTC
Created attachment 32405 [details]
Fix for this issue.
Comment 2 philipp.lohmann 2005-12-14 17:58:11 UTC
I don't know why that code was exactly as it is now. Personally I think instead
of duplicating the autodetection as in your patch we should (?) remove the first

if( !rSettings.GetStyleSettings().GetHighContrastMode() )

But i'm really not sure how this is supposed to work in the first place. I'll
discuss this with ssa who if i'm not mistaken implemented this.
Comment 3 kendy 2005-12-15 09:32:48 UTC
Created attachment 32439 [details]
Better version of the patch.
Comment 4 kendy 2005-12-15 09:41:50 UTC
You are right, my patch was not the nicest.  I've mocked it up quite in a hurry
- sorry for that.

I think that the reason for the 'if' was that creating a service factory is
quite expensive IIRC; but it could be something completely different, of course
;-)  With the new patch, I ask for the status of the "AutoDetectSystemHC" just
when we should use HC mode according to the darkness of the windows.

The other thing was that it seems to me that OOo enters HighContrast mode
regardless of the 'View->Accessibility->Automaticall detect high contrast mode
of the operating system', but that's probably for another bugreport, right?
Comment 5 philipp.lohmann 2005-12-15 10:04:23 UTC
The HighContrast mode setting actually is set (or not) in the windows specific
part of vcl as on Window HC is an additional bool like state. This is of course
not the case on Unix desktops where HC is just another theme (which is probably
the better approach, but ...). This is by the way also one thing that your new
patch would clobber; it would set high contrast to false if face and window
color were not dark, even if the Windows system setting says it were indeed HC.

Moreover it would clobber the high contrast mode setting with the auto hc
setting; that's not quite correct. The AutoHC setting tells whether we should
use an autodetection. The autodection for HC is currently (WindowColor.IsDark()
|| FaceColor.IsDark()).

I talked to ssa and he agreed that we have to think a little more about a
correct solution. My first idea was scratching the first if in there; in case
AutoHC is set we should autodetect else leave the HC setting untouched.

Actually the best solution might be to remove the HC setting once and for all.
It is way more reliable to check on the background in use to see whether some HC
handling is necessary or not. This need not bee Face or Window color, but is
really the current background of any control that has to handle high contrast.
Most parts of the office HC code are implemented that way anyway, but there are
some places where the HC setting is still used.
Comment 6 philipp.lohmann 2005-12-16 12:21:33 UTC
ssa and I discussed this issue further and found out that this code actually
implements spec'ed behaviout (see
http://ui.openoffice.org/specification/options_accessibility.html ). Now this
spec is concerned with desktops (well, Windows really) that have a specific
"high contrast mode". What we should do is emulate this behaviour in
SalFrame::UpdateSettings - which will render the "AutoHC" setting useless on
Unix since it will be effectively always on.

So i'll change the UpdateSettings methods of gtk and kde plugin to do this
IsDark() test always, this way the "high contrast mode" boolean stays an
implementation detail of the platform and we still have the behaviour as spec'ed.
Comment 7 kendy 2005-12-16 12:34:14 UTC
Sounds good, thank you very much! 
Comment 8 philipp.lohmann 2005-12-16 15:10:05 UTC
fixed in CWS vcl50
Comment 9 philipp.lohmann 2006-01-12 10:25:25 UTC
verified in CWS vcl50
Comment 10 philipp.lohmann 2006-01-26 13:40:43 UTC
fix is in 680m153, closing