X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-font-style.cpp;h=927f27781437a55ac83696bba142345be8a97989;hp=249157e3563d358bc23fd65ca66c4fc12da180db;hb=528aa3699cd51dab5115bca1aaebb65d4bc67c15;hpb=8177827cf40d243367b4c92ea8d5e3c40d42f3ae diff --git a/dali-toolkit/internal/text/text-font-style.cpp b/dali-toolkit/internal/text/text-font-style.cpp index 249157e..927f277 100644 --- a/dali-toolkit/internal/text/text-font-style.cpp +++ b/dali-toolkit/internal/text/text-font-style.cpp @@ -45,10 +45,6 @@ const std::string TYPE_KEY( "type" ); const std::string SYSTEM_TOKEN( "system" ); -#if defined(DEBUG_ENABLED) -Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_CONTROLS"); -#endif - } // namespace void SetFontFamilyProperty( ControllerPtr controller, const Property::Value& value ) @@ -216,6 +212,28 @@ void SetFontStyleProperty( ControllerPtr controller, const Property::Value& valu } break; } + case FontStyle::PLACEHOLDER: + { + // Sets the placeholder text font's style values. + if( !weightDefined || + ( weightDefined && ( controller->GetPlaceholderTextFontWeight() != weight ) ) ) + { + controller->SetPlaceholderTextFontWeight( weight ); + } + + if( !widthDefined || + ( widthDefined && ( controller->GetPlaceholderTextFontWidth() != width ) ) ) + { + controller->SetPlaceholderTextFontWidth( width ); + } + + if( !slantDefined || + ( slantDefined && ( controller->GetPlaceholderTextFontSlant() != slant ) ) ) + { + controller->SetPlaceholderTextFontSlant( slant ); + } + break; + } } // switch } // map not empty else @@ -236,6 +254,13 @@ void SetFontStyleProperty( ControllerPtr controller, const Property::Value& valu controller->SetInputFontSlant( TextAbstraction::FontSlant::NONE ); break; } + case FontStyle::PLACEHOLDER: + { + controller->SetPlaceholderTextFontWeight( TextAbstraction::FontWeight::NONE ); + controller->SetPlaceholderTextFontWidth( TextAbstraction::FontWidth::NONE ); + controller->SetPlaceholderTextFontSlant( TextAbstraction::FontSlant::NONE ); + break; + } } // switch } // map.Empty() } // controller @@ -245,7 +270,6 @@ void GetFontStyleProperty( ControllerPtr controller, Property::Value& value, Fon { if( controller ) { - const bool isDefaultStyle = FontStyle::DEFAULT == type; const bool isSetbyString = controller->IsFontStyleSetByString(); bool weightDefined = false; @@ -255,46 +279,74 @@ void GetFontStyleProperty( ControllerPtr controller, Property::Value& value, Fon FontWidth width = TextAbstraction::FontWidth::NONE; FontSlant slant = TextAbstraction::FontSlant::NONE; - if( isDefaultStyle ) + switch( type ) { - weightDefined = controller->IsDefaultFontWeightDefined(); - widthDefined = controller->IsDefaultFontWidthDefined(); - slantDefined = controller->IsDefaultFontSlantDefined(); - - if( weightDefined ) + case FontStyle::DEFAULT: { - weight = controller->GetDefaultFontWeight(); - } + weightDefined = controller->IsDefaultFontWeightDefined(); + widthDefined = controller->IsDefaultFontWidthDefined(); + slantDefined = controller->IsDefaultFontSlantDefined(); - if( widthDefined ) - { - width = controller->GetDefaultFontWidth(); - } + if( weightDefined ) + { + weight = controller->GetDefaultFontWeight(); + } - if( slantDefined ) - { - slant = controller->GetDefaultFontSlant(); - } - } - else - { - weightDefined = controller->IsInputFontWeightDefined(); - widthDefined = controller->IsInputFontWidthDefined(); - slantDefined = controller->IsInputFontSlantDefined(); + if( widthDefined ) + { + width = controller->GetDefaultFontWidth(); + } - if( weightDefined ) - { - weight = controller->GetInputFontWeight(); + if( slantDefined ) + { + slant = controller->GetDefaultFontSlant(); + } + break; } - - if( widthDefined ) + case FontStyle::INPUT: { - width = controller->GetInputFontWidth(); - } + weightDefined = controller->IsInputFontWeightDefined(); + widthDefined = controller->IsInputFontWidthDefined(); + slantDefined = controller->IsInputFontSlantDefined(); - if( slantDefined ) + if( weightDefined ) + { + weight = controller->GetInputFontWeight(); + } + + if( widthDefined ) + { + width = controller->GetInputFontWidth(); + } + + if( slantDefined ) + { + slant = controller->GetInputFontSlant(); + } + break; + } + case FontStyle::PLACEHOLDER: { - slant = controller->GetInputFontSlant(); + // The type is FontStyle::PLACEHOLDER + weightDefined = controller->IsPlaceholderTextFontWeightDefined(); + widthDefined = controller->IsPlaceholderTextFontWidthDefined(); + slantDefined = controller->IsPlaceholderTextFontSlantDefined(); + + if( weightDefined ) + { + weight = controller->GetPlaceholderTextFontWeight(); + } + + if( widthDefined ) + { + width = controller->GetPlaceholderTextFontWidth(); + } + + if( slantDefined ) + { + slant = controller->GetPlaceholderTextFontSlant(); + } + break; } }