Skip to content

Commit

Permalink
fixed: from candidates count positive to zero, ui update incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
fxliang committed Sep 12, 2023
1 parent 26fb7e7 commit 308ff35
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions WeaselUI/WeaselPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,9 @@ void WeaselPanel::Refresh()
// show schema menu status: schema_id == L".default"
bool show_schema_menu = m_status.schema_id == L".default";
bool margin_negative = (m_style.margin_x < 0 || m_style.margin_y < 0);
bool inline_no_candidates = m_style.inline_preedit && (m_ctx.cinfo.candies.size() == 0) && (!show_tips);
// when to hide_cadidates?
// 1. inline_no_candidates
// or
// 2. margin_negative, and not in show tips mode( ascii switching / half-full switching / simp-trad switching / error tips), and not in schema menu
hide_candidates = inline_no_candidates || (margin_negative && !show_tips && !show_schema_menu);
// 1. margin_negative, and not in show tips mode( ascii switching / half-full switching / simp-trad switching / error tips), and not in schema menu
hide_candidates = (margin_negative && !show_tips && !show_schema_menu);

// only RedrawWindow if no need to hide candidates window
if(!hide_candidates)
Expand Down Expand Up @@ -775,7 +772,7 @@ void WeaselPanel::DoPaint(CDCHandle dc)
delete[] btmys;
}
// background and candidates back, hilite back drawing start
if (!m_ctx.empty()) {
if ((!m_ctx.empty() && !m_style.inline_preedit) || (m_style.inline_preedit && (m_candidateCount || !m_ctx.aux.empty() ))) {
CRect backrc = m_layout->GetContentRect();
_HighlightText(memDC, backrc, m_color_scheme.back_color, m_color_scheme.shadow_color, m_style.round_corner_ex, BackType::BACKGROUND, IsToRoundStruct(), m_color_scheme.border_color);
}
Expand Down

0 comments on commit 308ff35

Please sign in to comment.