Re: Garbled text in editorcontrol in Dark mode
Daniel Sahlberg via TortoiseSVN-dev <[email protected]> Fri, 15 Nov 2024 01:27:39 -0800 (PST)
| Newsgroups | gmane.comp.version-control.subversion.tortoisesvn.devel |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_82030_712550397.1731662859848
Content-Type: multipart/alternative;
boundary="----=_Part_82031_332290441.1731662859848"
------=_Part_82031_332290441.1731662859848
Content-Type: text/plain; charset="UTF-8"
torsdag 14 november 2024 kl. 22:42:13 UTC+1 skrev Stefan:
I can reproduce it (under Windows 11 running in Hyper-V) if I use dark mode.
A (stupid!) solution would be to invalidate the whole edit control in
CEditPropertyValueDlg::OnEnChangePropvalue(). Surely there must be a better
solution..?
[[[
CRect rect;
CWnd* pWnd = GetDlgItem(IDC_PROPVALUE);
pWnd->GetWindowRect(&rect);
ScreenToClient(&rect);
InvalidateRect(&rect, TRUE);
]]]
why not just use
GetDlgItem(IDC_PROPVALUE)->Invalidate();
?
Thanks! This is far from my comfort zone so I don't know of all the APIs.
Unfortunately this (and my code - I'm assuming they are essentially the
same) causes flickering of the text box, in particular on edit. We could of
course do it only if dark mode, but still if the garbled text only affects
some users, and the Invalidate() flickering affects everyone, I'm not sure
if it is a good solution.
It would be good if it is possible to invalidate just the changed line of
text.
maybe there's something we could do differently in CTheme::MainSubclassProc
? I can't reproduce this here, not even in a VM. So I won't be of much help
:(
I'll have a look to see if I can figure out the difference between dark
mode and non-dark mode. Unfortunately I'm out of time for now so I'll have
this on my todo list.
Kind regards,
Daniel
--
You received this message because you are subscribed to the Google Groups "TortoiseSVN-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/tortoisesvn-dev/11467aa8-8f11-4042-abdb-e0aadb359b6dn%40googlegroups.com.
------=_Part_82031_332290441.1731662859848
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div><div dir=3D"auto">torsdag 14 november 2024 kl. 22:42:13 UTC+1 skrev St=
efan:<br /></div><blockquote style=3D"margin: 0px 0px 0px 0.8ex; border-lef=
t: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><blockquote style=
=3D"margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); p=
adding-left: 1ex;"><div><div><br /></div><div>I can reproduce it (under Win=
dows 11 running in Hyper-V) if I use dark mode.</div><div><br /></div><div>=
A (stupid!) solution would be to invalidate the whole edit control in CEdit=
PropertyValueDlg::OnEnChangePropvalue(). Surely there must be a better solu=
tion..?</div><div><br /></div><div>[[[</div><div>=C2=A0 =C2=A0 CRect rect;<=
br />=C2=A0 =C2=A0 CWnd* pWnd =3D GetDlgItem(IDC_PROPVALUE);<br />=C2=A0 =
=C2=A0 pWnd->GetWindowRect(&rect);<br />=C2=A0 =C2=A0 ScreenToClient=
(&rect);<br />=C2=A0 =C2=A0 InvalidateRect(&rect, TRUE);<br /></div=
><div>]]]</div></div></blockquote><div><br /></div></div><div><div>why not =
just use</div><div>GetDlgItem(IDC_PROPVALUE)->Invalidate();</div><div>?=
=C2=A0</div></div></blockquote><div><br /></div><div>Thanks! This is far fr=
om my comfort zone so I don't know of all the APIs.</div><div><br /></div><=
div>Unfortunately this (and my code - I'm assuming they are essentially the=
same) causes flickering of the text box, in particular on edit. We could o=
f course do it only if dark mode, but still if the garbled text only affect=
s some users, and the Invalidate() flickering affects everyone, I'm not sur=
e if it is a good solution.</div><div><br /></div><div>It would be good if =
it is possible to invalidate just the changed line of text.</div><div>=C2=
=A0</div><blockquote style=3D"margin: 0px 0px 0px 0.8ex; border-left: 1px s=
olid rgb(204, 204, 204); padding-left: 1ex;"><div><div>maybe there's someth=
ing we could do differently in=C2=A0CTheme::MainSubclassProc ? I can't repr=
oduce this here, not even in a VM. So I won't be of much help :(</div></div=
></blockquote><div><br /></div><div>I'll have a look to see if I can figure=
out the difference between dark mode and non-dark mode. Unfortunately I'm =
out of time for now so I'll have this on my todo list.</div><div><br /></di=
v><div>Kind regards,</div><div>Daniel</div><div><br /></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;TortoiseSVN-dev" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">tor=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
tortoisesvn-dev/11467aa8-8f11-4042-abdb-e0aadb359b6dn%40googlegroups.com?ut=
m_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/tor=
toisesvn-dev/11467aa8-8f11-4042-abdb-e0aadb359b6dn%40googlegroups.com</a>.<=
br />
------=_Part_82031_332290441.1731662859848--
------=_Part_82030_712550397.1731662859848--