diff options
Diffstat (limited to 'ColorsPanel.c')
-rw-r--r-- | ColorsPanel.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/ColorsPanel.c b/ColorsPanel.c index 00868457..bab23fc8 100644 --- a/ColorsPanel.c +++ b/ColorsPanel.c @@ -37,32 +37,14 @@ static char* ColorSchemes[] = { NULL }; -ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr) { - ColorsPanel* this = (ColorsPanel*) malloc(sizeof(ColorsPanel)); - Panel* super = (Panel*) this; - Panel_init(super, 1, 1, 1, 1, CHECKITEM_CLASS, true); - ((Object*)this)->delete = ColorsPanel_delete; - - this->settings = settings; - this->scr = scr; - super->eventHandler = ColorsPanel_EventHandler; - - Panel_setHeader(super, "Colors"); - for (int i = 0; ColorSchemes[i] != NULL; i++) { - Panel_add(super, (Object*) CheckItem_new(String_copy(ColorSchemes[i]), NULL, false)); - } - CheckItem_set((CheckItem*)Panel_get(super, settings->colorScheme), true); - return this; -} - -void ColorsPanel_delete(Object* object) { +static void ColorsPanel_delete(Object* object) { Panel* super = (Panel*) object; ColorsPanel* this = (ColorsPanel*) object; Panel_done(super); free(this); } -HandlerResult ColorsPanel_EventHandler(Panel* super, int ch) { +static HandlerResult ColorsPanel_EventHandler(Panel* super, int ch) { ColorsPanel* this = (ColorsPanel*) super; HandlerResult result = IGNORED; @@ -93,3 +75,20 @@ HandlerResult ColorsPanel_EventHandler(Panel* super, int ch) { return result; } +ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr) { + ColorsPanel* this = (ColorsPanel*) malloc(sizeof(ColorsPanel)); + Panel* super = (Panel*) this; + Panel_init(super, 1, 1, 1, 1, CHECKITEM_CLASS, true); + ((Object*)this)->delete = ColorsPanel_delete; + + this->settings = settings; + this->scr = scr; + super->eventHandler = ColorsPanel_EventHandler; + + Panel_setHeader(super, "Colors"); + for (int i = 0; ColorSchemes[i] != NULL; i++) { + Panel_add(super, (Object*) CheckItem_new(String_copy(ColorSchemes[i]), NULL, false)); + } + CheckItem_set((CheckItem*)Panel_get(super, settings->colorScheme), true); + return this; +} |