pbek / QOwnNotes

QOwnNotes is a plain-text file notepad and todo-list manager with Markdown support and Nextcloud / ownCloud integration.
https://www.qownnotes.org/
GNU General Public License v2.0
4.63k stars 410 forks source link

Preedit words in Fcitx input method has incorrect color under Light Theme #725

Closed xuzhao9 closed 7 years ago

xuzhao9 commented 7 years ago

Expected behaviour

Preedit word has correct color under Light Theme.

Actual behaviour

Preedit word has incorrect color under Light theme.

Steps to reproduce

  1. Turn on Fcitx, use Chinese (Pinyin) or Japanese (Mozc) input method to input Chinese or Japanese.
  2. See the color of preedit words is incorrect (https://ibb.co/dJjuW5). The preedit word is "其实" (Chinese), which cannot be seen clearly because it is white.

FYI, the color of preedit words is correct in Dark Theme, screenshot: (http://ibb.co/eftcjQ). The double underline beneath the word "其实" shows it is a preediting word.

Output from the debug section in the settings dialog

Relevant log output (you have to enable enable the log widget)

pbek commented 7 years ago

Thank you for reporting, is there a way to reproduce this without using an other input method? Simply pasting 其实 didn't trigger this behavior.

pbek commented 7 years ago

Could you for example please post your note.

xuzhao9 commented 7 years ago

Right, simple pasting does not reproduce this behavior. You will need to use the Fcitx Mozc input method to trigger this failure. Here is the content of my note:

My Note Title

其实 其实

pbek commented 7 years ago

I have no problem when I view this note. Do you also get this problem when you open an other note and than this note again?

wengxt commented 7 years ago

It really depends on the context IMHO.

I'd rather say, some color in QMarkdownTextEditor is not optimal. I'm not so sure how @xuzhao9 get this "highlight context" in his screen shot, but for example

link text

The URL part is light grey, which is hard to read under white background, regardless of whether input method is used or not. From my own observation, the preedit text uses the current highlight color to display text, which is not a wrong thing to do.

But some usage of "light grey" color may be reconsidered. E.g, "aaaa" in following screenshot is not very 'eye' friendly. Also, when using input method to compose text, the current highlight seems not to get updated until the text is committed.

image

Also, when using input method to compose text, the current highlight seems not to get updated until the text is committed. In the screenshot below, before the "你会" is committed, the text will still follow the light grey color (which is used for =========).

image

In order to get rid of such problem, I'd suggest to avoid using "eye-unfriendly" color combination anywhere.

xuzhao9 commented 7 years ago

@pbek It is not related to opening the note, but rather editing the notes. I captured a video of the problem, please take a look: http://mie1403.xzhao.fastmail.com/1.flv

wengxt commented 7 years ago

Ok, after I tried qmarkdowntextedit and qownnotes, I think the problem is caused by qownnotes's yellow line highlight.

Under certain circumstance, input method may want to display the preedit text in a "selected" style.

https://github.com/fcitx/fcitx-qt5/blob/master/platforminputcontext/qfcitxplatforminputcontext.cpp#L491

For some reason, this color is overriden by the yellow "current line" highlight in QOwnNotes. Maybe you want to consider to use another way to implement QOwnNotesMarkdownTextEdit::highlightCurrentLine .

pbek commented 7 years ago

I'm currently only aware of this way to achieve highlighting of the "current line" or search results...

pbek commented 7 years ago

But of course you could also change the background color of the current line in the QON settings.

xuzhao9 commented 7 years ago

I fixed this problem by unchecking the "highlight current line" option in settings. Thank you all!

pbek commented 7 years ago

;)