Colour the candidate window from the desktop accent via libmonet

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
justmeandClaude Sonnet 5.5 committed 2026-10-20 00:23:12 +08:00
1 parent 064ca6b4d4
commit 5bea01e224
6 files changed
+95 -3

No files matched your search

+19
View File
@@ -1180,6 +1180,25 @@ std::vector<Rect> Theme::mask(const BackgroundImageConfig &cfg, int width,
return result;
}
void Theme::applyMonet(const MonetColors &c) {
// A classic theme draws its panel from images, there is nothing to recolour.
if (inputPanel->surfaceColor->alpha() == 0) {
return;
}
auto *panel = inputPanel.mutableValue();
panel->surfaceColor.setValue(c.surface);
panel->outlineColor.setValue(c.outline);
panel->highlightFillColor.setValue(c.highlightFill);
panel->normalColor.setValue(c.normal);
panel->highlightColor.setValue(c.highlight);
panel->highlightBackgroundColor.setValue(c.highlightBackground);
panel->highlightCandidateColor.setValue(c.highlightCandidate);
panel->candidateLabelColor.setValue(c.candidateLabel);
panel->highlightCandidateLabelColor.setValue(c.highlightCandidateLabel);
panel->candidateCommentColor.setValue(c.candidateComment);
panel->highlightCandidateCommentColor.setValue(c.highlightCandidateComment);
}
void Theme::populateColor(std::optional<Color> accent) {
inputPanelBackground_ = *inputPanel->background->color;
inputPanelBorder_ = *inputPanel->background->borderColor;