Skip to content

Commit

Permalink
hack: trim label end as linux ui impl specific
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Mar 31, 2024
1 parent 338724c commit 758e760
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fcitx5-webview
Submodule fcitx5-webview updated 1 files
+12 −5 page/api.ts
9 changes: 8 additions & 1 deletion webpanel/webpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,14 @@ void WebPanel::update(UserInterfaceComponent component,
instance_
->outputFilter(inputContext, list->candidate(i).text())
.toString());
labels.emplace_back(list->label(i).toString());
auto label = list->label(i).toString();
// HACK: fcitx5's Linux UI concatenates label and text and
// expects engine to append a ' ' to label.
auto length = label.length();
if (length && label[length - 1] == ' ') {
label = label.substr(0, length - 1);
}
labels.emplace_back(label);
}
highlighted = list->cursorIndex();
// }
Expand Down

0 comments on commit 758e760

Please sign in to comment.