summaryrefslogtreecommitdiffstats
path: root/FunctionBar.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-12-16 21:46:11 +0100
committerChristian Göttsche <cgzones@googlemail.com>2020-12-20 17:01:50 +0100
commite3862aa67e37ecef0eb8f82ba1f4a710ffac9c02 (patch)
treeaa906dac3ffca307c01b9dc78ed75082aecf238c /FunctionBar.c
parent7e7a53c415b82cceee6173922987b772b1d51c10 (diff)
Rework drawing of FunctionBar
Draw the FunctionBar within Panel_draw instead of manually throughout the code. Add an optional PanelClass function drawFunctionBar, to allow specific panels to override the default FunctionBar_draw call. Rework the code on color change, to really change all colors (selection markers and panel headers). Closes: #402
Diffstat (limited to 'FunctionBar.c')
-rw-r--r--FunctionBar.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/FunctionBar.c b/FunctionBar.c
index 627bc777..1c260ab7 100644
--- a/FunctionBar.c
+++ b/FunctionBar.c
@@ -112,10 +112,11 @@ void FunctionBar_drawExtra(const FunctionBar* this, const char* buffer, int attr
attrset(attr);
}
mvaddstr(LINES - 1, x, buffer);
- attrset(CRT_colors[RESET_COLOR]);
x += strlen(buffer);
}
+ attrset(CRT_colors[RESET_COLOR]);
+
if (setCursor) {
CRT_cursorX = x;
curs_set(1);
@@ -132,10 +133,10 @@ void FunctionBar_append(const char* buffer, int attr) {
} else {
attrset(attr);
}
- mvaddstr(LINES - 1, currentLen, buffer);
+ mvaddstr(LINES - 1, currentLen + 1, buffer);
attrset(CRT_colors[RESET_COLOR]);
- currentLen += strlen(buffer);
+ currentLen += strlen(buffer) + 1;
}
int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy