From 6332cbff481a789257e6e935d6f0443d7cf2f904 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Tue, 24 Sep 2019 15:58:09 +0100 Subject: [PATCH] Change the color of the bubbles for each launcher from stylesheet Change-Id: Ie08b84b8e2cb9687c866ad1386ea606a16dd2d6e --- resources/style/demo-theme.json.in | 21 +++++++++++++++++++++ resources/style/examples-theme.json.in | 21 +++++++++++++++++++++ resources/style/mobile/demo-theme.json.in | 21 +++++++++++++++++++++ resources/style/mobile/examples-theme.json.in | 21 +++++++++++++++++++++ resources/style/mobile/tests-theme.json.in | 21 +++++++++++++++++++++ resources/style/tests-theme.json.in | 21 +++++++++++++++++++++ shared/dali-table-view.cpp | 15 +++++++-------- 7 files changed, 133 insertions(+), 8 deletions(-) diff --git a/resources/style/demo-theme.json.in b/resources/style/demo-theme.json.in index 1c2dc27..1203c52 100644 --- a/resources/style/demo-theme.json.in +++ b/resources/style/demo-theme.json.in @@ -38,6 +38,27 @@ "units": "USER_SPACE", "stopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]] } + }, + + "BubbleColor1": + { + "color": [ 0.3255, 0.3412, 0.6353, 0.32 ] + }, + + "BubbleColor2": + { + "color": [ 0.3647, 0.7569, 0.8157, 0.32 ] + }, + + "BubbleColor3": + { + "color": [ 0.3804, 0.7412, 0.6510, 0.32 ] + }, + + "BubbleColor4": + { + "color": [ 1, 1, 1, 0.13 ] } + } } diff --git a/resources/style/examples-theme.json.in b/resources/style/examples-theme.json.in index 054a3a9..4dd7a86 100644 --- a/resources/style/examples-theme.json.in +++ b/resources/style/examples-theme.json.in @@ -45,6 +45,27 @@ "units": "USER_SPACE", "stopColor": [[0,0,0,1.0],[0.556863,0.054902,0,1.0]] } + }, + + "BubbleColor1": + { + "color": [ 0.8255, 0.2412, 0.1353, 0.32 ] + }, + + "BubbleColor2": + { + "color": [ 0.8647, 0.4569, 0.3157, 0.32 ] + }, + + "BubbleColor3": + { + "color": [ 0.9804, 0.5412, 0.5510, 0.32 ] + }, + + "BubbleColor4": + { + "color": [ 1, 0, 0, 0.13 ] } + } } diff --git a/resources/style/mobile/demo-theme.json.in b/resources/style/mobile/demo-theme.json.in index acf3c91..05578b7 100644 --- a/resources/style/mobile/demo-theme.json.in +++ b/resources/style/mobile/demo-theme.json.in @@ -38,6 +38,27 @@ "units": "USER_SPACE", "stopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]] } + }, + + "BubbleColor1": + { + "color": [ 0.3255, 0.3412, 0.6353, 0.32 ] + }, + + "BubbleColor2": + { + "color": [ 0.3647, 0.7569, 0.8157, 0.32 ] + }, + + "BubbleColor3": + { + "color": [ 0.3804, 0.7412, 0.6510, 0.32 ] + }, + + "BubbleColor4": + { + "color": [ 1, 1, 1, 0.13 ] } + } } diff --git a/resources/style/mobile/examples-theme.json.in b/resources/style/mobile/examples-theme.json.in index 591b5b2..f6e1c6b 100644 --- a/resources/style/mobile/examples-theme.json.in +++ b/resources/style/mobile/examples-theme.json.in @@ -45,6 +45,27 @@ "units": "USER_SPACE", "stopColor": [[0,0,0,1.0],[0.556863,0.054902,0,1.0]] } + }, + + "BubbleColor1": + { + "color": [ 0.8255, 0.2412, 0.1353, 0.32 ] + }, + + "BubbleColor2": + { + "color": [ 0.8647, 0.4569, 0.3157, 0.32 ] + }, + + "BubbleColor3": + { + "color": [ 0.9804, 0.5412, 0.5510, 0.32 ] + }, + + "BubbleColor4": + { + "color": [ 1, 0, 0, 0.13 ] } + } } diff --git a/resources/style/mobile/tests-theme.json.in b/resources/style/mobile/tests-theme.json.in index 078a049..90d8049 100644 --- a/resources/style/mobile/tests-theme.json.in +++ b/resources/style/mobile/tests-theme.json.in @@ -44,6 +44,27 @@ "units": "USER_SPACE", "stopColor": [[0.392157,0.254902,0.647059,1.0],[0.164706,0.0313725,0.270588,1.0]] } + }, + + "BubbleColor1": + { + "color": [ 0.8255, 0.2412, 0.9353, 0.32 ] + }, + + "BubbleColor2": + { + "color": [ 0.8647, 0.4569, 0.8157, 0.32 ] + }, + + "BubbleColor3": + { + "color": [ 0.9804, 0.5412, 0.9510, 0.32 ] + }, + + "BubbleColor4": + { + "color": [ 1, 1, 1, 0.13 ] } + } } diff --git a/resources/style/tests-theme.json.in b/resources/style/tests-theme.json.in index c8111c8..c25d961 100644 --- a/resources/style/tests-theme.json.in +++ b/resources/style/tests-theme.json.in @@ -44,6 +44,27 @@ "units": "USER_SPACE", "stopColor": [[0.392157,0.254902,0.647059,1.0],[0.164706,0.0313725,0.270588,1.0]] } + }, + + "BubbleColor1": + { + "color": [ 0.8255, 0.2412, 0.9353, 0.32 ] + }, + + "BubbleColor2": + { + "color": [ 0.8647, 0.4569, 0.8157, 0.32 ] + }, + + "BubbleColor3": + { + "color": [ 0.9804, 0.5412, 0.9510, 0.32 ] + }, + + "BubbleColor4": + { + "color": [ 1, 1, 1, 0.13 ] } + } } diff --git a/shared/dali-table-view.cpp b/shared/dali-table-view.cpp index de20ab1..93d39ca 100644 --- a/shared/dali-table-view.cpp +++ b/shared/dali-table-view.cpp @@ -69,15 +69,14 @@ const float EFFECT_SNAP_DURATION = 0.66f; ///< Scroll Snap const float EFFECT_FLICK_DURATION = 0.5f; ///< Scroll Flick Duration for Effects const Vector3 ANGLE_CUBE_PAGE_ROTATE(Math::PI * 0.5f, Math::PI * 0.5f, 0.0f); - -const Vector4 BUBBLE_COLOR[] = +const char * const BUBBLE_COLOR_STYLE_NAME[] = { - Vector4( 0.3255f, 0.3412f, 0.6353f, 0.32f ), - Vector4( 0.3647f, 0.7569f, 0.8157f, 0.32f ), - Vector4( 0.3804f, 0.7412f, 0.6510f, 0.32f ), - Vector4( 1.f, 1.f, 1.f, 0.13f ) + "BubbleColor1", + "BubbleColor2", + "BubbleColor3", + "BubbleColor4" }; -const int NUMBER_OF_BUBBLE_COLOR( sizeof(BUBBLE_COLOR) / sizeof(BUBBLE_COLOR[0]) ); +const int NUMBER_OF_BUBBLE_COLORS( sizeof( BUBBLE_COLOR_STYLE_NAME ) / sizeof( BUBBLE_COLOR_STYLE_NAME[ 0 ] ) ); const char * const SHAPE_IMAGE_TABLE[] = { @@ -750,7 +749,7 @@ void DaliTableView::AddBackgroundActors( Actor layer, int count ) imageMap.Add( Toolkit::Visual::Property::SHADER, effect ); dfActor.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap ); - dfActor.SetColor( BUBBLE_COLOR[ i%NUMBER_OF_BUBBLE_COLOR ] ); + dfActor.SetStyleName( BUBBLE_COLOR_STYLE_NAME[ i%NUMBER_OF_BUBBLE_COLORS ] ); layer.Add( dfActor ); } -- 2.7.4