summaryrefslogtreecommitdiffstats
path: root/ListItem.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-01-21 23:27:31 -0200
committerHisham Muhammad <hisham@gobolinux.org>2015-01-21 23:27:31 -0200
commit3383d8e5561dfc6fb2b65e0a194df94ccb5e08af (patch)
treedafba704561386b31b6b8af6dafb5b9a2ba7453c /ListItem.c
parent36b78328843d0dae0d0fadbd0e814a8a1546327c (diff)
Sorry about the mega-patch.
This is a work-in-progress, code is currently broken. (Some actions, and notably, the header, are missing.)
Diffstat (limited to 'ListItem.c')
-rw-r--r--ListItem.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ListItem.c b/ListItem.c
index 05f5e960..dbedfe12 100644
--- a/ListItem.c
+++ b/ListItem.c
@@ -22,6 +22,7 @@ typedef struct ListItem_ {
Object super;
char* value;
int key;
+ bool moving;
} ListItem;
}*/
@@ -33,14 +34,19 @@ static void ListItem_delete(Object* cast) {
}
static void ListItem_display(Object* cast, RichString* out) {
- ListItem* this = (ListItem*)cast;
+ ListItem* const this = (ListItem*)cast;
assert (this != NULL);
/*
int len = strlen(this->value)+1;
char buffer[len+1];
snprintf(buffer, len, "%s", this->value);
*/
- RichString_write(out, CRT_colors[DEFAULT_COLOR], this->value/*buffer*/);
+ if (this->moving) {
+ RichString_write(out, CRT_colors[DEFAULT_COLOR], "↕ ");
+ } else {
+ RichString_prune(out);
+ }
+ RichString_append(out, CRT_colors[DEFAULT_COLOR], this->value/*buffer*/);
}
ObjectClass ListItem_class = {
@@ -53,6 +59,7 @@ ListItem* ListItem_new(const char* value, int key) {
ListItem* this = AllocThis(ListItem);
this->value = strdup(value);
this->key = key;
+ this->moving = false;
return this;
}

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