From f3e048048253c67d5b7e637dd71473a6ed164762 Mon Sep 17 00:00:00 2001 From: akiyosi Date: Sun, 1 Jan 2023 00:16:04 +0900 Subject: [PATCH] Minor fixes --- editor/imetooltip.go | 10 +++++----- editor/workspace.go | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/editor/imetooltip.go b/editor/imetooltip.go index fc787498..d74768bb 100644 --- a/editor/imetooltip.go +++ b/editor/imetooltip.go @@ -169,12 +169,12 @@ func (i *IMETooltip) parsePreeditString(preeditStr string) { h := &Highlight{} g.foreground = i.s.ws.foreground g.background = i.s.ws.background - if i.s.ws.screenbg == "dark" { - h.foreground = warpColor(editor.colors.fg, 30) - h.background = warpColor(editor.colors.bg, 30) + if i.s.ws.screenbg == "light" { + h.foreground = warpColor(i.s.ws.background, -30) + h.background = warpColor(i.s.ws.foreground, -30) } else { - h.foreground = warpColor(editor.colors.fg, -30) - h.background = warpColor(editor.colors.fg, -30) + h.foreground = warpColor(i.s.ws.foreground, 30) + h.background = warpColor(i.s.ws.background, 30) } h.underline = true diff --git a/editor/workspace.go b/editor/workspace.go index c973171c..4e1bbecc 100644 --- a/editor/workspace.go +++ b/editor/workspace.go @@ -2815,6 +2815,12 @@ func (w *Workspace) InputMethodEvent(event *gui.QInputMethodEvent) { // InputMethodQuery is func (w *Workspace) InputMethodQuery(query core.Qt__InputMethodQuery) *core.QVariant { + if w.screen == nil { + return core.NewQVariant() + } + if w.screen.tooltip == nil { + return core.NewQVariant() + } if !w.screen.tooltip.isShown { return core.NewQVariant() }