Commit 9166cf20c6ff83679746357f8956874ae1568ff8
1 parent
ca623618
Added Demo specific stylesheets
Change-Id: I05a17ea530a14e94040f24db332178335ce3ce52
Showing
7 changed files
with
173 additions
and
5 deletions
build/tizen/CMakeLists.txt
| ... | ... | @@ -20,10 +20,14 @@ SET(RESOURCE_DIR ${ROOT_SRC_DIR}/resources) |
| 20 | 20 | SET(LOCAL_IMAGES_DIR ${RESOURCE_DIR}/images) |
| 21 | 21 | SET(LOCAL_MODELS_DIR ${RESOURCE_DIR}/models) |
| 22 | 22 | SET(LOCAL_SCRIPTS_DIR ${RESOURCE_DIR}/scripts) |
| 23 | +IF(NOT DEFINED LOCAL_STYLE_DIR) | |
| 24 | + SET(LOCAL_STYLE_DIR ${RESOURCE_DIR}/style) | |
| 25 | +ENDIF() | |
| 23 | 26 | |
| 24 | 27 | SET(IMAGES_DIR ${APP_DATA_DIR}/images/) |
| 25 | 28 | SET(MODELS_DIR ${APP_DATA_DIR}/models/) |
| 26 | 29 | SET(SCRIPTS_DIR ${APP_DATA_DIR}/scripts/) |
| 30 | +SET(STYLE_DIR ${APP_DATA_DIR}/style/) | |
| 27 | 31 | |
| 28 | 32 | IF(NOT DEFINED LOCALE_DIR) |
| 29 | 33 | SET(LOCALE_DIR ${PREFIX}/share/locale) |
| ... | ... | @@ -32,6 +36,8 @@ ENDIF() |
| 32 | 36 | SET(DALI_IMAGE_DIR \\"${IMAGES_DIR}\\") |
| 33 | 37 | SET(DALI_MODEL_DIR \\"${MODELS_DIR}\\") |
| 34 | 38 | SET(DALI_SCRIPT_DIR \\"${SCRIPTS_DIR}\\") |
| 39 | +SET(DALI_STYLE_DIR \\"${STYLE_DIR}\\") | |
| 40 | +SET(DALI_DEMO_THEME_PATH \\"${STYLE_DIR}/demo-theme.json\\") | |
| 35 | 41 | SET(DALI_EXAMPLE_BIN \\"${BINDIR}/\\") |
| 36 | 42 | SET(DALI_LOCALE_DIR \\"${LOCALE_DIR}\\") |
| 37 | 43 | SET(DALI_LANG \\"${LANG}\\") |
| ... | ... | @@ -58,6 +64,8 @@ FOREACH(flag ${LOCAL_SCRIPTS_LIST}) |
| 58 | 64 | INSTALL(FILES ${LOCAL_SCRIPTS_DIR}/${flag} DESTINATION ${SCRIPTS_DIR}) |
| 59 | 65 | ENDFOREACH(flag) |
| 60 | 66 | |
| 67 | +INSTALL(FILES ${LOCAL_STYLE_DIR}/demo-theme.json DESTINATION ${STYLE_DIR}) | |
| 68 | + | |
| 61 | 69 | SET(PKG_LIST dali |
| 62 | 70 | dali-toolkit) |
| 63 | 71 | |
| ... | ... | @@ -68,7 +76,7 @@ FOREACH(flag ${REQUIRED_PKGS_CFLAGS}) |
| 68 | 76 | SET(REQUIRED_CFLAGS "${REQUIRED_CFLAGS} ${flag}") |
| 69 | 77 | ENDFOREACH(flag) |
| 70 | 78 | |
| 71 | -SET(DALI_DEMO_CFLAGS "-DDALI_IMAGE_DIR=${DALI_IMAGE_DIR} -DDALI_MODEL_DIR=${DALI_MODEL_DIR} -DDALI_SCRIPT_DIR=${DALI_SCRIPT_DIR} -DDALI_EXAMPLE_BIN=${DALI_EXAMPLE_BIN} -DDALI_LOCALE_DIR=${DALI_LOCALE_DIR} -fvisibility=hidden -DHIDE_DALI_INTERNALS -DDALI_LANG=${DALI_LANG}") | |
| 79 | +SET(DALI_DEMO_CFLAGS "-DDALI_IMAGE_DIR=${DALI_IMAGE_DIR} -DDALI_MODEL_DIR=${DALI_MODEL_DIR} -DDALI_SCRIPT_DIR=${DALI_SCRIPT_DIR} -DDALI_DEMO_THEME_PATH=${DALI_DEMO_THEME_PATH} -DDALI_EXAMPLE_BIN=${DALI_EXAMPLE_BIN} -DDALI_LOCALE_DIR=${DALI_LOCALE_DIR} -fvisibility=hidden -DHIDE_DALI_INTERNALS -DDALI_LANG=${DALI_LANG}") | |
| 72 | 80 | |
| 73 | 81 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${REQUIRED_CFLAGS} ${DALI_DEMO_CFLAGS} -Werror -Wall") |
| 74 | 82 | SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}") | ... | ... |
demo/dali-demo.cpp
| ... | ... | @@ -15,6 +15,10 @@ |
| 15 | 15 | * |
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | +// EXTERNAL INCLUDES | |
| 19 | +#include <dali/dali.h> | |
| 20 | + | |
| 21 | +// INTERNAL INCLUDES | |
| 18 | 22 | #include "dali-table-view.h" |
| 19 | 23 | #include "shared/dali-demo-strings.h" |
| 20 | 24 | |
| ... | ... | @@ -29,6 +33,7 @@ int main(int argc, char **argv) |
| 29 | 33 | |
| 30 | 34 | Application app = Application::New(&argc, &argv); |
| 31 | 35 | |
| 36 | + // Create the demo launcher | |
| 32 | 37 | DaliTableView demo(app); |
| 33 | 38 | |
| 34 | 39 | demo.AddExample(Example("bubble-effect.example", DALI_DEMO_STR_TITLE_BUBBLES)); |
| ... | ... | @@ -52,6 +57,8 @@ int main(int argc, char **argv) |
| 52 | 57 | demo.AddExample(Example("text-label-emojis.example", DALI_DEMO_STR_TITLE_EMOJI_TEXT)); |
| 53 | 58 | demo.AddExample(Example("animated-shapes.example", DALI_DEMO_STR_TITLE_ANIMATED_SHAPES)); |
| 54 | 59 | demo.AddExample(Example("path-animation.example", DALI_DEMO_STR_TITLE_PATH_ANIMATION)); |
| 60 | + | |
| 61 | + // Start the event loop | |
| 55 | 62 | app.MainLoop(); |
| 56 | 63 | |
| 57 | 64 | return 0; | ... | ... |
demo/dali-table-view.cpp
| ... | ... | @@ -22,6 +22,7 @@ |
| 22 | 22 | #include <algorithm> |
| 23 | 23 | #include <sstream> |
| 24 | 24 | #include <unistd.h> |
| 25 | +#include <dali-toolkit/public-api/styling/style-manager.h> | |
| 25 | 26 | |
| 26 | 27 | // INTERNAL INCLUDES |
| 27 | 28 | #include "shared/view.h" |
| ... | ... | @@ -216,6 +217,10 @@ void DaliTableView::SortAlphabetically( bool sortAlphabetically ) |
| 216 | 217 | |
| 217 | 218 | void DaliTableView::Initialize( Application& application ) |
| 218 | 219 | { |
| 220 | + // Provide the stylesheet | |
| 221 | + StyleManager styleManager = StyleManager::Get(); | |
| 222 | + styleManager.RequestThemeChange( DALI_DEMO_THEME_PATH ); | |
| 223 | + | |
| 219 | 224 | Stage::GetCurrent().KeyEventSignal().Connect( this, &DaliTableView::OnKeyEvent ); |
| 220 | 225 | |
| 221 | 226 | const Vector2 stageSize = Stage::GetCurrent().GetSize(); |
| ... | ... | @@ -492,6 +497,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit |
| 492 | 497 | TextLabel label = TextLabel::New(); |
| 493 | 498 | label.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| 494 | 499 | label.SetSize( parentSize ); |
| 500 | + label.SetProperty( Control::Property::STYLE_NAME, "launcherlabel" ); | |
| 495 | 501 | label.SetProperty( TextLabel::Property::MULTI_LINE, true ); |
| 496 | 502 | label.SetProperty( TextLabel::Property::TEXT, title ); |
| 497 | 503 | label.SetProperty( TextLabel::Property::ALIGNMENT, "CENTER" ); | ... | ... |
packaging/com.samsung.dali-demo.spec
| ... | ... | @@ -39,6 +39,7 @@ of the capability of the toolkit. |
| 39 | 39 | %define dali_icon_dir /usr/share/icons/ |
| 40 | 40 | %define smack_rule_dir /etc/smack/accesses2.d/ |
| 41 | 41 | %define locale_dir %{dali_app_ro_dir}/res/locale |
| 42 | +%define local_style_dir ../../resources/style/mobile | |
| 42 | 43 | |
| 43 | 44 | ############################## |
| 44 | 45 | # Build |
| ... | ... | @@ -52,7 +53,7 @@ LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -fPIC" |
| 52 | 53 | CXXFLAGS+=" -D_ARCH_ARM_" |
| 53 | 54 | %endif |
| 54 | 55 | |
| 55 | -cd %{_builddir}/%{name}-%{version}/build/tizen && cmake -DDALI_APP_DIR=%{dali_app_ro_dir} -DLOCALE_DIR=%{locale_dir} . | |
| 56 | +cd %{_builddir}/%{name}-%{version}/build/tizen && cmake -DDALI_APP_DIR=%{dali_app_ro_dir} -DLOCALE_DIR=%{locale_dir} -DLOCAL_STYLE_DIR=%{local_style_dir} . | |
| 56 | 57 | |
| 57 | 58 | make %{?jobs:-j%jobs} |
| 58 | 59 | |
| ... | ... | @@ -110,6 +111,7 @@ exit 0 |
| 110 | 111 | %{dali_app_ro_dir}/images/* |
| 111 | 112 | %{dali_app_ro_dir}/models/* |
| 112 | 113 | %{dali_app_ro_dir}/scripts/* |
| 114 | +%{dali_app_ro_dir}/style/* | |
| 113 | 115 | %{dali_xml_file_dir}/%{name}.xml |
| 114 | 116 | %{dali_icon_dir}/* |
| 115 | 117 | %{locale_dir}/* | ... | ... |
resources/style/demo-theme.json
0 → 100644
| 1 | +/* | |
| 2 | +Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved | |
| 3 | + | |
| 4 | +This file is part of Dali Toolkit | |
| 5 | + | |
| 6 | +PROPRIETARY/CONFIDENTIAL | |
| 7 | + | |
| 8 | +This software is the confidential and proprietary information of | |
| 9 | +SAMSUNG ELECTRONICS ("Confidential Information"). You shall not | |
| 10 | +disclose such Confidential Information and shall use it only in | |
| 11 | +accordance with the terms of the license agreement you entered | |
| 12 | +into with SAMSUNG ELECTRONICS. | |
| 13 | + | |
| 14 | +SAMSUNG make no representations or warranties about the suitability | |
| 15 | +of the software, either express or implied, including but not limited | |
| 16 | +to the implied warranties of merchantability, fitness for a particular | |
| 17 | +purpose, or non-infringement. SAMSUNG shall not be liable for any | |
| 18 | +damages suffered by licensee as a result of using, modifying or | |
| 19 | +distributing this software or its derivatives. | |
| 20 | +*/ | |
| 21 | + | |
| 22 | +{ | |
| 23 | + "styles": | |
| 24 | + { | |
| 25 | + "textlabel": | |
| 26 | + { | |
| 27 | + "font-family":"HelveticaNeue", | |
| 28 | + "font-style":"Regular" | |
| 29 | + }, | |
| 30 | + | |
| 31 | + "launcherlabel": | |
| 32 | + { | |
| 33 | + "point-size":18 | |
| 34 | + }, | |
| 35 | + | |
| 36 | + "toolbarlabel": | |
| 37 | + { | |
| 38 | + "point-size":18 | |
| 39 | + }, | |
| 40 | + | |
| 41 | + "textfield": | |
| 42 | + { | |
| 43 | + "font-family":"HelveticaNeue", | |
| 44 | + "font-style":"Regular", | |
| 45 | + "point-size":18 | |
| 46 | + }, | |
| 47 | + | |
| 48 | + "scrollview": | |
| 49 | + { | |
| 50 | + "overshoot-effect-color":"B018" | |
| 51 | + } | |
| 52 | + } | |
| 53 | +} | ... | ... |
resources/style/mobile/demo-theme.json
0 → 100644
| 1 | +/* | |
| 2 | +Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved | |
| 3 | + | |
| 4 | +This file is part of Dali Toolkit | |
| 5 | + | |
| 6 | +PROPRIETARY/CONFIDENTIAL | |
| 7 | + | |
| 8 | +This software is the confidential and proprietary information of | |
| 9 | +SAMSUNG ELECTRONICS ("Confidential Information"). You shall not | |
| 10 | +disclose such Confidential Information and shall use it only in | |
| 11 | +accordance with the terms of the license agreement you entered | |
| 12 | +into with SAMSUNG ELECTRONICS. | |
| 13 | + | |
| 14 | +SAMSUNG make no representations or warranties about the suitability | |
| 15 | +of the software, either express or implied, including but not limited | |
| 16 | +to the implied warranties of merchantability, fitness for a particular | |
| 17 | +purpose, or non-infringement. SAMSUNG shall not be liable for any | |
| 18 | +damages suffered by licensee as a result of using, modifying or | |
| 19 | +distributing this software or its derivatives. | |
| 20 | +*/ | |
| 21 | + | |
| 22 | +{ | |
| 23 | + "styles": | |
| 24 | + { | |
| 25 | + "textlabel": | |
| 26 | + { | |
| 27 | + "font-family":"SamsungSans", | |
| 28 | + "font-style":"Regular" | |
| 29 | + }, | |
| 30 | + | |
| 31 | + "textlabel-font-size-0": | |
| 32 | + { | |
| 33 | + "point-size":8 | |
| 34 | + }, | |
| 35 | + "textlabel-font-size-1": | |
| 36 | + { | |
| 37 | + "point-size":10 | |
| 38 | + }, | |
| 39 | + "textlabel-font-size-2": | |
| 40 | + { | |
| 41 | + "point-size":15 | |
| 42 | + }, | |
| 43 | + "textlabel-font-size-3": | |
| 44 | + { | |
| 45 | + "point-size":19 | |
| 46 | + }, | |
| 47 | + "textlabel-font-size-4": | |
| 48 | + { | |
| 49 | + "point-size":25 | |
| 50 | + }, | |
| 51 | + | |
| 52 | + "launcherlabel": | |
| 53 | + { | |
| 54 | + "point-size":10 | |
| 55 | + }, | |
| 56 | + | |
| 57 | + "toolbarlabel": | |
| 58 | + { | |
| 59 | + "point-size":10 | |
| 60 | + }, | |
| 61 | + | |
| 62 | + "textfield": | |
| 63 | + { | |
| 64 | + "font-family":"SamsungSans", | |
| 65 | + "font-style":"Regular" | |
| 66 | + }, | |
| 67 | + | |
| 68 | + "textfield-font-size-0": | |
| 69 | + { | |
| 70 | + "point-size":10 | |
| 71 | + }, | |
| 72 | + "textfield-font-size-1": | |
| 73 | + { | |
| 74 | + "point-size":10 | |
| 75 | + }, | |
| 76 | + "textfield-font-size-2": | |
| 77 | + { | |
| 78 | + "point-size":10 | |
| 79 | + }, | |
| 80 | + "textfield-font-size-3": | |
| 81 | + { | |
| 82 | + "point-size":10 | |
| 83 | + }, | |
| 84 | + "textfield-font-size-4": | |
| 85 | + { | |
| 86 | + "point-size":10 | |
| 87 | + }, | |
| 88 | + | |
| 89 | + "scrollview": | |
| 90 | + { | |
| 91 | + "overshoot-effect-color":"B018" | |
| 92 | + } | |
| 93 | + } | |
| 94 | +} | ... | ... |
shared/view.h
| ... | ... | @@ -95,11 +95,9 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, |
| 95 | 95 | label.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT ); |
| 96 | 96 | label.SetSize( stage.GetSize().width, style.mToolBarHeight ); |
| 97 | 97 | label.SetDrawMode( Dali::DrawMode::OVERLAY ); |
| 98 | + label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "toolbarlabel" ); | |
| 98 | 99 | label.SetProperty( Dali::Toolkit::TextLabel::Property::TEXT, title ); |
| 99 | 100 | label.SetProperty( Dali::Toolkit::TextLabel::Property::ALIGNMENT, "CENTER" ); |
| 100 | - label.SetProperty( Dali::Toolkit::TextLabel::Property::FONT_FAMILY, DEFAULT_TEXT_STYLE_FONT_FAMILY ); | |
| 101 | - label.SetProperty( Dali::Toolkit::TextLabel::Property::FONT_STYLE, DEFAULT_TEXT_STYLE_FONT_STYLE ); | |
| 102 | - label.SetProperty( Dali::Toolkit::TextLabel::Property::POINT_SIZE, ScalePointSize(DEFAULT_TEXT_STYLE_POINT_SIZE) ); | |
| 103 | 101 | label.SetColor( DEFAULT_TEXT_STYLE_COLOR ); |
| 104 | 102 | toolBarLayer.Add( label ); |
| 105 | 103 | } | ... | ... |