summaryrefslogtreecommitdiff
path: root/textscreen/txt_separator.c
diff options
context:
space:
mode:
Diffstat (limited to 'textscreen/txt_separator.c')
-rw-r--r--textscreen/txt_separator.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/textscreen/txt_separator.c b/textscreen/txt_separator.c
index 6b779626..89db0b03 100644
--- a/textscreen/txt_separator.c
+++ b/textscreen/txt_separator.c
@@ -65,7 +65,7 @@ static void TXT_SeparatorDrawer(TXT_UNCAST_ARG(separator), int selected)
{
TXT_GotoXY(x, y);
- TXT_BGColor(TXT_COLOR_BLUE, 0);
+ TXT_BGColor(TXT_WINDOW_BACKGROUND, 0);
TXT_FGColor(TXT_COLOR_BRIGHT_GREEN);
TXT_DrawString(" ");
TXT_DrawString(separator->label);
@@ -80,6 +80,20 @@ static void TXT_SeparatorDestructor(TXT_UNCAST_ARG(separator))
free(separator->label);
}
+void TXT_SetSeparatorLabel(txt_separator_t *separator, char *label)
+{
+ free(separator->label);
+
+ if (label != NULL)
+ {
+ separator->label = strdup(label);
+ }
+ else
+ {
+ separator->label = NULL;
+ }
+}
+
txt_widget_class_t txt_separator_class =
{
TXT_NeverSelectable,
@@ -99,14 +113,8 @@ txt_separator_t *TXT_NewSeparator(char *label)
TXT_InitWidget(separator, &txt_separator_class);
- if (label != NULL)
- {
- separator->label = strdup(label);
- }
- else
- {
- separator->label = NULL;
- }
+ separator->label = NULL;
+ TXT_SetSeparatorLabel(separator, label);
return separator;
}