#include <algorithm>
#include <sstream>
#include <unistd.h>
-#include <dali-toolkit/public-api/styling/style-manager.h>
// INTERNAL INCLUDES
#include "shared/view.h"
void DaliTableView::Initialize( Application& application )
{
- // Provide the stylesheet
- StyleManager styleManager = StyleManager::Get();
- styleManager.RequestThemeChange( DALI_DEMO_THEME_PATH );
+ DemoHelper::RequestThemeChange();
Stage::GetCurrent().KeyEventSignal().Connect( this, &DaliTableView::OnKeyEvent );
#include <dali/dali.h>
#include <dali-toolkit/dali-toolkit.h>
+#include "shared/view.h"
+
using namespace Dali;
namespace
// The Init signal is received once (only) during the Application lifetime
void Create( Application& application )
{
+ DemoHelper::RequestThemeChange();
+
// Get a handle to the stage
Stage stage = Stage::GetCurrent();
*/
void Create(Application& application)
{
+ DemoHelper::RequestThemeChange();
+
Stage::GetCurrent().KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent);
// Creates a default view with a default tool bar.
// The Init signal is received once (only) during the Application lifetime
void Create(Application& app)
{
+ DemoHelper::RequestThemeChange();
+
Stage stage = Stage::GetCurrent();
Vector2 stageSize = stage.GetSize();
{
if(!mTitleActor)
{
- mTitleActor = TextLabel::New();
+ mTitleActor = DemoHelper::CreateToolBarLabel( "" );
// Add title to the tool bar.
mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter );
}
Actor MenuItem(const std::string& text)
{
- int size = static_cast<int>(DemoHelper::ScalePointSize(6));
-
- std::ostringstream fontString;
- fontString << "<font size="<< size <<">"<< ShortName( text ) << "</font>";
-
- TextLabel label = TextLabel::New( fontString.str() );
+ TextLabel label = TextLabel::New( ShortName( text ) );
+ label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "builderlabel" );
label.SetResizePolicy( FILL_TO_PARENT, WIDTH );
// Hook up tap detector
void Create(Application& app)
{
+ DemoHelper::RequestThemeChange();
+
Stage stage = Stage::GetCurrent();
Stage::GetCurrent().KeyEventSignal().Connect(this, &ExampleApp::OnKeyEvent);
{
// The Init signal is received once (only) during the Application lifetime
+ DemoHelper::RequestThemeChange();
+
// Respond to key events
Stage::GetCurrent().KeyEventSignal().Connect(this, &ButtonsController::OnKeyEvent);
*/
void Create(Application& application)
{
+ DemoHelper::RequestThemeChange();
+
Stage::GetCurrent().KeyEventSignal().Connect(this, &ClusterController::OnKeyEvent);
Vector2 stageSize = Stage::GetCurrent().GetSize();
void CubeTransitionApp::OnInit( Application& application )
{
+ DemoHelper::RequestThemeChange();
+
Stage::GetCurrent().KeyEventSignal().Connect(this, &CubeTransitionApp::OnKeyEvent);
// Creates a default view with a default tool bar, the view is added to the stage.
void DissolveEffectApp::OnInit( Application& application )
{
+ DemoHelper::RequestThemeChange();
+
Stage::GetCurrent().KeyEventSignal().Connect(this, &DissolveEffectApp::OnKeyEvent);
// Creates a default view with a default tool bar, the view is added to the stage.
{
std::cout << "ImageScalingScaleToFillController::Create" << std::endl;
+ DemoHelper::RequestThemeChange();
+
// Get a handle to the stage:
Stage stage = Stage::GetCurrent();
*/
void OnInit(Application& app)
{
+ DemoHelper::RequestThemeChange();
+
Stage stage = Dali::Stage::GetCurrent();
stage.KeyEventSignal().Connect(this, &ItemViewExample::OnKeyEvent);
{
// The Init signal is received once (only) during the Application lifetime
+ DemoHelper::RequestThemeChange();
+
mCurrentLogger = 0;
mPerformanceLoggers.reserve( NUM_LOGGERS );
mPerformanceLoggers.resize( NUM_LOGGERS );
*/
void Create( Application& application )
{
+ DemoHelper::RequestThemeChange();
+
Stage::GetCurrent().KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent);
mStageSize = Stage::GetCurrent().GetSize();
{
// The Init signal is received once (only) during the Application lifetime
+ DemoHelper::RequestThemeChange();
+
Stage::GetCurrent().KeyEventSignal().Connect(this, &MotionStretchExampleApp::OnKeyEvent);
// Creates a default view with a default tool bar.
void NewWindowController::Create( Application& app )
{
+ DemoHelper::RequestThemeChange();
+
Stage stage = Stage::GetCurrent();
stage.SetBackgroundColor(Color::YELLOW);
#include <string.h>
#include <iostream>
+#include "shared/view.h"
+
using namespace Dali;
using namespace Dali::Toolkit;
{
// The Init signal is received once ( only ) during the Application lifetime
+ DemoHelper::RequestThemeChange();
+
Stage::GetCurrent().KeyEventSignal().Connect(this, &PageTurnController::OnKeyEvent);
Stage stage = Stage::GetCurrent();
*/
void Create( Application& application )
{
+ DemoHelper::RequestThemeChange();
+
// Get a handle to the stage:
Stage stage = Stage::GetCurrent();
void RadialMenuExample::OnInit(Application& app)
{
+ DemoHelper::RequestThemeChange();
+
Stage stage = Dali::Stage::GetCurrent();
// The Init signal is received once (only) during the Application lifetime
// The Init signal is received once (only) during the Application lifetime
void Create(Application& application)
{
+ DemoHelper::RequestThemeChange();
+
Stage stage = Stage::GetCurrent();
mStageHalfSize = stage.GetSize() * 0.5f;
#include <sys/stat.h>
#include <dali/integration-api/debug.h>
+// INTERNAL INCLUDES
+#include "shared/view.h"
using namespace Dali;
void Launcher::Create( Dali::Application& application )
{
+ DemoHelper::RequestThemeChange();
+
TextLabel textActor = TextLabel::New( "JSON & JavaScript Launcher..." );
// Reposition the actor
*/
void OnInit(Application& app)
{
+ DemoHelper::RequestThemeChange();
+
Stage stage = Dali::Stage::GetCurrent();
stage.KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent);
*/
void Create(Application& app)
{
+ DemoHelper::RequestThemeChange();
+
srand(0); // Want repeatable path
Stage::GetCurrent().KeyEventSignal().Connect(this, &TestApp::OnKeyEvent);
{
// The Init signal is received once (only) during the Application lifetime
+ DemoHelper::RequestThemeChange();
+
Stage stage = Stage::GetCurrent();
// Respond to key events
#include <dali-toolkit/dali-toolkit.h>
#include <dali/public-api/text-abstraction/text-abstraction.h>
+// INTERNAL INCLUDES
+#include "shared/view.h"
+
using namespace Dali;
using namespace Dali::Toolkit;
*/
void Create( Application& application )
{
+ DemoHelper::RequestThemeChange();
+
Stage stage = Stage::GetCurrent();
stage.KeyEventSignal().Connect(this, &TextFieldExample::OnKeyEvent);
* @brief Basic usage of TextLabel control
*/
-// INTERNAL INCLUDES
-#include "shared/multi-language-strings.h"
-
// EXTERNAL INCLUDES
#include <dali-toolkit/dali-toolkit.h>
#include <dali/public-api/text-abstraction/text-abstraction.h>
+// INTERNAL INCLUDES
+#include "shared/multi-language-strings.h"
+#include "shared/view.h"
+
using namespace Dali;
using namespace Dali::Toolkit;
using namespace MultiLanguageStrings;
*/
void Create( Application& application )
{
+ DemoHelper::RequestThemeChange();
+
Stage stage = Stage::GetCurrent();
stage.KeyEventSignal().Connect(this, &TextLabelMultiLanguageExample::OnKeyEvent);
// INTERNAL INCLUDES
#include "shared/multi-language-strings.h"
+#include "shared/view.h"
using namespace Dali;
using namespace Dali::Toolkit;
*/
void Create( Application& application )
{
+ DemoHelper::RequestThemeChange();
+
Stage stage = Stage::GetCurrent();
stage.KeyEventSignal().Connect(this, &TextLabelExample::OnKeyEvent);
"textlabel":
{
"font-family":"HelveticaNeue",
- "font-style":"Regular"
+ "font-style":"Regular",
+ "point-size":18
},
"launcherlabel":
"point-size":18
},
+ "builderlabel":
+ {
+ "point-size":13
+ },
+
"textfield":
{
"font-family":"HelveticaNeue",
"point-size":10
},
+ "builderlabel":
+ {
+ "point-size":10
+ },
+
"textfield":
{
"font-family":"SamsungSans",
const Dali::Toolkit::Alignment::Padding DEFAULT_PLAY_PADDING(12.0f, 12.0f, 12.0f, 12.0f);
const Dali::Toolkit::Alignment::Padding DEFAULT_MODE_SWITCH_PADDING(8.0f, 8.0f, 8.0f, 8.0f);
+void RequestThemeChange()
+{
+ // Provide the stylesheet
+ Dali::Toolkit::StyleManager styleManager = Dali::Toolkit::StyleManager::Get();
+ styleManager.RequestThemeChange( DALI_DEMO_THEME_PATH );
+}
+
float ScalePointSize(int pointSize)
{
Dali::Vector2 dpi = Dali::Stage::GetCurrent().GetDpi();