aboutsummaryrefslogtreecommitdiffstats
path: root/Panel.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2020-08-27 07:48:10 +0200
committerDaniel Lange <DLange@git.local>2020-08-27 07:48:10 +0200
commitf3147ea2d1598914c2db53e8cfb34c8ff81e2ff4 (patch)
tree3ee82b2af2ab3d38b6e4b07f3994516aac72f742 /Panel.c
parentdf568a576f7b44ac5a2b9b7222c7f39d9932f626 (diff)
downloaddebian_htop-f3147ea2d1598914c2db53e8cfb34c8ff81e2ff4.tar.gz
debian_htop-f3147ea2d1598914c2db53e8cfb34c8ff81e2ff4.tar.bz2
debian_htop-f3147ea2d1598914c2db53e8cfb34c8ff81e2ff4.zip
New upstream version 3.0.0upstream/3.0.0
Diffstat (limited to 'Panel.c')
-rw-r--r--Panel.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Panel.c b/Panel.c
index 1e53b4a..348fd23 100644
--- a/Panel.c
+++ b/Panel.c
@@ -264,6 +264,14 @@ void Panel_setSelected(Panel* this, int selected) {
}
}
+void Panel_splice(Panel *this, Vector* from) {
+ assert (this != NULL);
+ assert (from != NULL);
+
+ Vector_splice(this->items, from);
+ this->needsRedraw = true;
+}
+
void Panel_draw(Panel* this, bool focus) {
assert (this != NULL);
@@ -372,7 +380,7 @@ void Panel_draw(Panel* this, bool focus) {
bool Panel_onKey(Panel* this, int key) {
assert (this != NULL);
-
+
int size = Vector_size(this->items);
switch (key) {
case KEY_DOWN:
@@ -455,7 +463,7 @@ bool Panel_onKey(Panel* this, int key) {
if (this->selected < 0 || size == 0) {
this->selected = 0;
this->needsRedraw = true;
- } else if (this->selected >= size) {
+ } else if (this->selected >= size) {
this->selected = size - 1;
this->needsRedraw = true;
}

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