e_test_win: use setColor to change window's color 48/262148/1
authorJunseok, Kim <juns.kim@samsung.com>
Tue, 3 Aug 2021 05:43:11 +0000 (14:43 +0900)
committerJunseok, Kim <juns.kim@samsung.com>
Tue, 3 Aug 2021 05:43:11 +0000 (14:43 +0900)
Change-Id: Ib28cecbab7570d7257160aa4690170a26c38255a

src/e_test_win.cpp

index d1631c3..55a7ea6 100644 (file)
@@ -47,24 +47,7 @@ etWin::init(etWin *parent,
    this->bg.obj = elm_bg_add(elm_win);
    evas_object_size_hint_weight_set(this->bg.obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_win_resize_object_add(elm_win, this->bg.obj);
-
-   switch (color)
-     {
-      case E_TC_WIN_COLOR_BLACK:  elm_bg_color_set(this->bg.obj,   0,   0,   0); break;
-      case E_TC_WIN_COLOR_WHITE:  elm_bg_color_set(this->bg.obj, 255, 255, 255); break;
-      case E_TC_WIN_COLOR_RED:    elm_bg_color_set(this->bg.obj, 255,   0,   0); break;
-      case E_TC_WIN_COLOR_GREEN:  elm_bg_color_set(this->bg.obj,   0, 255,   0); break;
-      case E_TC_WIN_COLOR_BLUE:   elm_bg_color_set(this->bg.obj,   0,   0, 255); break;
-      case E_TC_WIN_COLOR_YELLOW: elm_bg_color_set(this->bg.obj, 255, 255,   0); break;
-      case E_TC_WIN_COLOR_CYAN:   elm_bg_color_set(this->bg.obj,   0, 255, 255); break;
-      case E_TC_WIN_COLOR_PURPLE: elm_bg_color_set(this->bg.obj, 255,   0, 255); break;
-      case E_TC_WIN_COLOR_ORANGE: elm_bg_color_set(this->bg.obj, 255, 165,   0); break;
-      case E_TC_WIN_COLOR_INDIGO: elm_bg_color_set(this->bg.obj, 75,    0, 130); break;
-      case E_TC_WIN_COLOR_KHAKI:  elm_bg_color_set(this->bg.obj, 240, 230, 140); break;
-      case E_TC_WIN_COLOR_GRAY:   elm_bg_color_set(this->bg.obj, 128, 128, 128); break;
-      default:                    elm_bg_color_set(this->bg.obj, 100, 100, 100); break;
-     }
-   evas_object_show(this->bg.obj);
+   this->setColor(color);
 
    elm_win_screen_size_get(elm_win, NULL, NULL, &screen_width, &screen_height);
 
@@ -174,8 +157,7 @@ static Eina_Bool _cb_timeout(void *data)
         b = (b + 10) % 255;
         if (!b) b = 10;
      }
-   elm_bg_color_set(tw->bg.obj, r, g, b);
-   evas_object_show(tw->bg.obj);
+   tw->setColor(r, g, b);
    return EINA_TRUE;
 }