diff options
author | Raptor Engineering Development Team <support@raptorengineering.com> | 2019-04-27 03:52:15 +0000 |
---|---|---|
committer | Raptor Engineering Development Team <support@raptorengineering.com> | 2019-04-27 05:30:39 +0000 |
commit | 464f7169625367a86978886fce250c245fe17972 (patch) | |
tree | 74a4215849f615bd6cfa82a6d4eed64e15f0fa35 /src/fbshell.cpp | |
parent | 6b11a9530f575d1851e63e92929b41bec7640c00 (diff) | |
download | fbterm-master.tar.gz fbterm-master.zip |
Replace cursor logic with progress bar drawing logicHEADmaster04-16-2019
This requires external SIGARLM to be sent after FIFO load
TODO: Figure out a better way to update the progress bar
when data written to FIFOs?
Diffstat (limited to 'src/fbshell.cpp')
-rw-r--r-- | src/fbshell.cpp | 64 |
1 files changed, 3 insertions, 61 deletions
diff --git a/src/fbshell.cpp b/src/fbshell.cpp index bce28c7..7e298ea 100644 --- a/src/fbshell.cpp +++ b/src/fbshell.cpp @@ -384,71 +384,13 @@ bool FbShell::moveChars(u16 sx, u16 sy, u16 dx, u16 dy, u16 w, u16 h) void FbShell::drawCursor(CharAttr attr, u16 x, u16 y, u16 c) { - u16 oldX = mCursor.x, oldY = mCursor.y; - - adjustCharAttr(attr); - mCursor.attr = attr; - mCursor.x = x; - mCursor.y = y; - mCursor.code = c; - mCursor.showed = false; - - updateCursor(); - - if (manager->activeShell() == this && (oldX != x || oldY != y)) { - reportCursor(); - } + // } void FbShell::updateCursor() { - if (manager->activeShell() != this || mCursor.x >= w() || mCursor.y >= h()) return; - mCursor.showed ^= true; - - u16 shape = mode(CursorShape); - if (shape == CurDefault) { - static bool inited = false; - static u32 default_shape = 0; - if (!inited) { - inited = true; - Config::instance()->getOption("cursor-shape", default_shape); - - if (!default_shape) default_shape = CurUnderline; - else default_shape = CurBlock; - } - - shape = default_shape; - } - - switch (shape) { - case CurNone: - break; - - case CurUnderline: - screen->fillRect(FW(mCursor.x), FH(mCursor.y + 1) - 1, FW(1), 1, mCursor.showed ? mCursor.attr.fcolor : mCursor.attr.bcolor); - if (mImProxy) { - Rectangle rect = { FW(mCursor.x), FH(mCursor.y + 1) - 1, FW(1), 1 }; - mImProxy->redrawImWin(rect); - } - break; - - default: { - bool dw = (mCursor.attr.type != CharAttr::Single); - - u16 x = mCursor.x; - if (mCursor.attr.type == CharAttr::DoubleRight) x--; - - CharAttr attr = mCursor.attr; - if (mCursor.showed) { - u8 temp = attr.fcolor; - attr.fcolor = attr.bcolor; - attr.bcolor = temp; - } - - drawChars(attr, x, mCursor.y, dw ? FW(2) : FW(1), 1, &mCursor.code, &dw); - break; - } - } + if (manager->activeShell() != this) return; + screen->drawProgressBar(); } void FbShell::enableCursor(bool enable) |