fix(input): add sliding-window multi-tap candidate bar and input tail-scrolling across plugins and fcitx5-t9

This commit is contained in:
Luxferre committed 2026-10-26 17:37:53 +02:00
1 parent a53a331111
commit 1f9138f0c6
24 files changed
+394 -125

No files matched your search

+32 -5
View File
@@ -215,7 +215,7 @@ enum class AtTextMode {
const char* kAtTapMap[10] = {
" 0+=",
"+?=,1\"':;/-_",
"+?=,1\"':;/-_*#@$%&()[]{}",
"ABC2",
"DEF3",
"GHI4",
@@ -969,18 +969,36 @@ int runModemApp(int argc, char** argv) {
(void)portNames;
// Row 0: AT Command Input Box (Y=contentY..contentY+46)
drawPango(layoutSmall, &colYellow, 8, contentY, 18,
std::string(kIconTerm) + " AT (# Input mode):");
bool focus0 = (atFocusRow == 0);
int mbW = pangoTextWidth(layoutSmall, modeBadge);
if (focus0 && atLastTapKey >= 0 && atLastTapKey <= 10 &&
(nowMs() - atLastTapMs) < 850) {
const char* seq = (atLastTapKey == 10)
? "+?=,1\"':;/-_*#"
: kAtTapMap[atLastTapKey];
std::string pref = (atLastTapKey == 10)
? "*:"
: (std::to_string(atLastTapKey) + ":");
std::string cand = formatMultiTapBar(
pref, seq, atLastTapIdx, atTextMode == AtTextMode::Upper, 5, 16);
drawPango(layoutSmall, &colYellow, 8, contentY, 18, cand,
kWinWidth - mbW - 18);
} else {
drawPango(layoutSmall, &colYellow, 8, contentY, 18,
std::string(kIconTerm) + " AT (# Input mode):");
}
drawPango(layoutSmall, &colGreen, kWinWidth - mbW - 8, contentY, 18, modeBadge);
bool focus0 = (atFocusRow == 0);
XSetForeground(dpy, gc, focus0 ? pt.spec.bgInputFocus : pt.spec.bgAltEven);
XFillRectangle(dpy, pix, gc, 6, contentY + 19, kWinWidth - 12, 26);
XSetForeground(dpy, gc, focus0 ? pt.spec.accent : pt.spec.border);
XDrawRectangle(dpy, pix, gc, 6, contentY + 19, kWinWidth - 13, 25);
std::string atDisp = atInput + (focus0 ? "_" : "");
if (focus0) {
atDisp = tailFitPangoText(layoutMain, atDisp, kWinWidth - 24);
}
drawPango(layoutMain, &colWhite, 12, contentY + 19, 26,
atInput + (focus0 ? "_" : ""), kWinWidth - 24);
atDisp, kWinWidth - 24);
// Row 1: Preset & AT Port Selector (Y=contentY+49..contentY+73)
bool focus1 = (atFocusRow == 1);
@@ -2061,6 +2079,15 @@ int runModemApp(int argc, char** argv) {
timeoutMs = static_cast<int>(bRem);
}
}
if (activeTab == TabId::AtConsole && atLastTapKey != -1) {
int64_t tRem = (atLastTapMs + 851) - now;
if (tRem <= 0) {
atLastTapKey = -1;
render();
} else if (timeoutMs < 0 || tRem < timeoutMs) {
timeoutMs = static_cast<int>(tRem);
}
}
// Periodic 10-second status refresh while visible on SIM/Radio tabs
if (modal == ModalMode::None && activeTab != TabId::ModemLog &&
activeTab != TabId::AtConsole) {