Skip to content

Commit

Permalink
add support of xcb input panel offset
Browse files Browse the repository at this point in the history
  • Loading branch information
Reverier-Xu committed Apr 6, 2022
1 parent 5b659c5 commit 2376c29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/ui/classic/theme.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ FCITX_CONFIGURATION(
this, "FullWidthHighlight",
_("Use all horizontal space for highlight when it is vertical list"),
true};
Option<int> offsetX{this, "OffsetX", _("InputPanel X offset"), 0};
Option<int> offsetY{this, "OffsetY", _("InputPanel Y offset"), 0};
Option<Color> highlightColor{this, "HighlightColor",
_("Highlight text color"), Color("#ffffffff")};
Option<Color> highlightBackgroundColor{this, "HighlightBackgroundColor",
Expand Down
8 changes: 6 additions & 2 deletions src/ui/classic/xcbinputwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ void XCBInputWindow::updatePosition(InputContext *inputContext) {
y = newY;
}

// add support of input panel offset here.
auto &theme = parent_->theme();

xcb_params_configure_window_t wc;
wc.x = x;
wc.y = y;
wc.x = x + theme.inputPanel->offsetX.value();
wc.y = y + theme.inputPanel->offsetY.value();

wc.stack_mode = XCB_STACK_MODE_ABOVE;
xcb_aux_configure_window(ui_->connection(), wid_,
XCB_CONFIG_WINDOW_STACK_MODE |
Expand Down

0 comments on commit 2376c29

Please sign in to comment.