mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 18:43:54 -06:00
Fix support for the Tencent QQPinyin IME (#19046)
(cherry picked from commit b47fdfc7e63fd7c2f8c060a1abc930b3fc40fc19) Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgbjZ8A Service-Version: 1.23
This commit is contained in:
parent
dc3bb80c16
commit
dd2ebc5c09
5
.github/actions/spelling/allow/allow.txt
vendored
5
.github/actions/spelling/allow/allow.txt
vendored
@ -23,8 +23,8 @@ dze
|
|||||||
dzhe
|
dzhe
|
||||||
Emacspeak
|
Emacspeak
|
||||||
Fitt
|
Fitt
|
||||||
FTCS
|
|
||||||
flac
|
flac
|
||||||
|
FTCS
|
||||||
gantt
|
gantt
|
||||||
gfm
|
gfm
|
||||||
ghe
|
ghe
|
||||||
@ -60,8 +60,8 @@ Powerline
|
|||||||
ptys
|
ptys
|
||||||
pwn
|
pwn
|
||||||
pwshw
|
pwshw
|
||||||
QOL
|
|
||||||
qof
|
qof
|
||||||
|
QOL
|
||||||
qps
|
qps
|
||||||
quickfix
|
quickfix
|
||||||
rclt
|
rclt
|
||||||
@ -81,6 +81,7 @@ stakeholders
|
|||||||
subpage
|
subpage
|
||||||
sustainability
|
sustainability
|
||||||
sxn
|
sxn
|
||||||
|
Tencent
|
||||||
TLDR
|
TLDR
|
||||||
tonos
|
tonos
|
||||||
toolset
|
toolset
|
||||||
|
|||||||
@ -711,13 +711,28 @@ TextAttribute Implementation::_textAttributeFromAtom(TfGuidAtom atom) const
|
|||||||
TF_DISPLAYATTRIBUTE da;
|
TF_DISPLAYATTRIBUTE da;
|
||||||
THROW_IF_FAILED(dai->GetAttributeInfo(&da));
|
THROW_IF_FAILED(dai->GetAttributeInfo(&da));
|
||||||
|
|
||||||
if (da.crText.type != TF_CT_NONE)
|
// The Tencent QQPinyin IME creates TF_CT_COLORREF attributes with a color of 0x000000 (black).
|
||||||
|
// We respect their wish, which results in the preview text being invisible.
|
||||||
|
// (Note that sending this COLORREF is incorrect, and not a bug in our handling.)
|
||||||
|
//
|
||||||
|
// After some discussion, we realized that an IME which sets only one color but not
|
||||||
|
// the others is likely not properly tested anyway, so we reject those cases.
|
||||||
|
// After all, what behavior do we expect, if the IME sends e.g. foreground=blue,
|
||||||
|
// without knowing whether our terminal theme already uses a blue background?
|
||||||
|
if (da.crText.type == da.crBk.type && da.crText.type == da.crLine.type)
|
||||||
{
|
{
|
||||||
attr.SetForeground(_colorFromDisplayAttribute(da.crText));
|
if (da.crText.type != TF_CT_NONE)
|
||||||
}
|
{
|
||||||
if (da.crBk.type != TF_CT_NONE)
|
attr.SetForeground(_colorFromDisplayAttribute(da.crText));
|
||||||
{
|
}
|
||||||
attr.SetBackground(_colorFromDisplayAttribute(da.crBk));
|
if (da.crBk.type != TF_CT_NONE)
|
||||||
|
{
|
||||||
|
attr.SetBackground(_colorFromDisplayAttribute(da.crBk));
|
||||||
|
}
|
||||||
|
if (da.crLine.type != TF_CT_NONE)
|
||||||
|
{
|
||||||
|
attr.SetUnderlineColor(_colorFromDisplayAttribute(da.crLine));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (da.lsStyle >= TF_LS_NONE && da.lsStyle <= TF_LS_SQUIGGLE)
|
if (da.lsStyle >= TF_LS_NONE && da.lsStyle <= TF_LS_SQUIGGLE)
|
||||||
{
|
{
|
||||||
@ -737,10 +752,6 @@ TextAttribute Implementation::_textAttributeFromAtom(TfGuidAtom atom) const
|
|||||||
{
|
{
|
||||||
attr.SetUnderlineStyle(UnderlineStyle::DoublyUnderlined);
|
attr.SetUnderlineStyle(UnderlineStyle::DoublyUnderlined);
|
||||||
}
|
}
|
||||||
if (da.crLine.type != TF_CT_NONE)
|
|
||||||
{
|
|
||||||
attr.SetUnderlineColor(_colorFromDisplayAttribute(da.crLine));
|
|
||||||
}
|
|
||||||
|
|
||||||
return attr;
|
return attr;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user