diff options
author | Bartosz Fenski <fenio@debian.org> | 2005-11-04 17:25:27 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:19 +0200 |
commit | 55a3aa9e6a59c1bf0248869d9f08e31ec4057c61 (patch) | |
tree | e45fc349e224501aa3c3dfedbbd6e8f04a8ab62e /CategoriesListBox.c | |
parent | 435b6ae69f41d58f3eefdfcbd63e739387868057 (diff) | |
parent | 2c8c1a156130aa40be7dcaeb3ce2977a03cf50c2 (diff) | |
download | debian_htop-55a3aa9e6a59c1bf0248869d9f08e31ec4057c61.tar.gz debian_htop-55a3aa9e6a59c1bf0248869d9f08e31ec4057c61.tar.bz2 debian_htop-55a3aa9e6a59c1bf0248869d9f08e31ec4057c61.zip |
Imported Debian patch 0.5.4-1debian/0.5.4-1
Diffstat (limited to 'CategoriesListBox.c')
-rw-r--r-- | CategoriesListBox.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/CategoriesListBox.c b/CategoriesListBox.c index c2b6c67..249f75c 100644 --- a/CategoriesListBox.c +++ b/CategoriesListBox.c @@ -3,6 +3,7 @@ #include "AvailableMetersListBox.h" #include "MetersListBox.h" #include "DisplayOptionsListBox.h" +#include "ColorsListBox.h" #include "ListBox.h" @@ -26,6 +27,9 @@ char* MetersFunctions[10] = {" ", " ", " ", "Type ", "Add L ", " /* private property */ char* DisplayOptionsFunctions[10] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done "}; +/* private property */ +char* ColorsFunctions[10] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done "}; + CategoriesListBox* CategoriesListBox_new(Settings* settings, ScreenManager* scr) { CategoriesListBox* this = (CategoriesListBox*) malloc(sizeof(CategoriesListBox)); ListBox* super = (ListBox*) this; @@ -38,6 +42,7 @@ CategoriesListBox* CategoriesListBox_new(Settings* settings, ScreenManager* scr) ListBox_setHeader(super, RichString_quickString(CRT_colors[PANEL_HEADER_FOCUS], "Setup")); ListBox_add(super, (Object*) ListItem_new(String_copy("Meters"))); ListBox_add(super, (Object*) ListItem_new(String_copy("Display options"))); + ListBox_add(super, (Object*) ListItem_new(String_copy("Colors"))); return this; } @@ -73,7 +78,10 @@ HandlerResult CategoriesListBox_eventHandler(ListBox* super, int ch) { CategoriesListBox_makeMetersPage(this); break; case 1: - CategoriesListBox_makeProcessListPage(this); + CategoriesListBox_makeDisplayOptionsPage(this); + break; + case 2: + CategoriesListBox_makeColorsPage(this); break; } } @@ -84,6 +92,8 @@ HandlerResult CategoriesListBox_eventHandler(ListBox* super, int ch) { return result; } +// TODO: factor out common code from these functions into a generic makePage + void CategoriesListBox_makeMetersPage(CategoriesListBox* this) { FunctionBar* fuBar = FunctionBar_new(10, MetersFunctions, NULL, NULL); ListBox* lbLeftMeters = (ListBox*) MetersListBox_new(this->settings, "Left column", this->settings->header->leftMeters, this->scr); @@ -95,9 +105,16 @@ void CategoriesListBox_makeMetersPage(CategoriesListBox* this) { ScreenManager_setFunctionBar(this->scr, fuBar); } -void CategoriesListBox_makeProcessListPage(CategoriesListBox* this) { +void CategoriesListBox_makeDisplayOptionsPage(CategoriesListBox* this) { FunctionBar* fuBar = FunctionBar_new(10, DisplayOptionsFunctions, NULL, NULL); ListBox* lbDisplayOptions = (ListBox*) DisplayOptionsListBox_new(this->settings, this->scr); ScreenManager_add(this->scr, lbDisplayOptions, -1); ScreenManager_setFunctionBar(this->scr, fuBar); } + +void CategoriesListBox_makeColorsPage(CategoriesListBox* this) { + FunctionBar* fuBar = FunctionBar_new(10, ColorsFunctions, NULL, NULL); + ListBox* lbColors = (ListBox*) ColorsListBox_new(this->settings, this->scr); + ScreenManager_add(this->scr, lbColors, -1); + ScreenManager_setFunctionBar(this->scr, fuBar); +} |