Skip to content

Commit

Permalink
Merge pull request #205 from chewing/fix-background-color
Browse files Browse the repository at this point in the history
fix: only use GetSysColor color index
  • Loading branch information
kanru authored Nov 9, 2024
2 parents d952111 + cba8f61 commit c533db4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
15 changes: 0 additions & 15 deletions libIME/DisplayAttributeInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,16 @@ class DisplayAttributeInfo : public ITfDisplayAttributeInfo {
return atom_;
}

void setTextColor(COLORREF color) {
attrib_.crText.type = TF_CT_COLORREF;
attrib_.crText.cr = color;
}

void setTextColor(int index) {
attrib_.crText.type = TF_CT_SYSCOLOR;
attrib_.crText.nIndex = index;
}

void setBackgroundColor(COLORREF color) {
attrib_.crBk.type = TF_CT_COLORREF;
attrib_.crBk.cr = color;
}

void setBackgroundColor(int index) {
attrib_.crBk.type = TF_CT_SYSCOLOR;
attrib_.crBk.nIndex = index;
}

void setLineColor(COLORREF color) {
attrib_.crLine.type = TF_CT_COLORREF;
attrib_.crLine.cr = color;
}

void setLineColor(int index) {
attrib_.crLine.type = TF_CT_SYSCOLOR;
attrib_.crLine.nIndex = index;
Expand Down
2 changes: 1 addition & 1 deletion libIME/ImeModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ ImeModule::ImeModule(HMODULE module, const CLSID& textServiceClsid):
// regiser default display attributes
inputAttrib_ = new DisplayAttributeInfo(g_inputDisplayAttributeGuid);
inputAttrib_->setTextColor(COLOR_WINDOWTEXT);
inputAttrib_->setBackgroundColor(COLOR_WINDOW);
inputAttrib_->setLineStyle(TF_LS_DOT);
inputAttrib_->setLineColor(COLOR_WINDOWTEXT);
inputAttrib_->setBackgroundColor(COLOR_WINDOW);
displayAttrInfos_.push_back(inputAttrib_);
// convertedAttrib_ = new DisplayAttributeInfo(g_convertedDisplayAttributeGuid);
// displayAttrInfos_.push_back(convertedAttrib_);
Expand Down

0 comments on commit c533db4

Please sign in to comment.