summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b57c3cd)
Change-Id: Idc1940ad0e27ec5a20641912d982b3d5865fbc20
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
class TextEditorExample : public ConnectionTracker
{
public:
class TextEditorExample : public ConnectionTracker
{
public:
TextEditorExample( Application& application )
: mApplication( application )
{
TextEditorExample( Application& application )
: mApplication( application )
{
"Asšúm sapěret usu ůť.\n"
"Síť ut apeirián laboramúš percipitur, sůas hařum ín éos?\n" );
"Asšúm sapěret usu ůť.\n"
"Síť ut apeirián laboramúš percipitur, sůas hařum ín éos?\n" );
+ mEditor.InputStyleChangedSignal().Connect( this, &TextEditorExample::OnTextInputStyleChanged );
+
contents.Add( mEditor );
}
contents.Add( mEditor );
}
{
const std::string& name = button.GetName();
{
const std::string& name = button.GetName();
if( "color" == name.substr( 0u, 5u ) )
{
const unsigned int index = strtoul( name.substr( 5u, 1u ).c_str(), NULL, 10u );
if( "color" == name.substr( 0u, 5u ) )
{
const unsigned int index = strtoul( name.substr( 5u, 1u ).c_str(), NULL, 10u );
- mEditor.SetProperty( TextEditor::Property::INPUT_COLOR, COLORS[index] );
+ color = COLORS[index];
+ mEditor.SetProperty( TextEditor::Property::INPUT_COLOR, color );
+ mColorButtonOption.SetProperty( Button::Property::UNSELECTED_COLOR, color );
+ mColorButtonOption.SetProperty( Button::Property::SELECTED_COLOR, color );
+
mButtonContainer.SetVisible( false );
mButtonContainer.SetSensitive( false );
return true;
}
mButtonContainer.SetVisible( false );
mButtonContainer.SetSensitive( false );
return true;
}
+ void OnTextInputStyleChanged( TextEditor editor, TextEditor::InputStyle::Mask mask )
+ {
+ if( TextEditor::InputStyle::NONE != static_cast<TextEditor::InputStyle::Mask>( mask & TextEditor::InputStyle::COLOR ) )
+ {
+ const Vector4 color = editor.GetProperty( TextEditor::Property::INPUT_COLOR ).Get<Vector4>();
+
+ mColorButtonOption.SetProperty( Button::Property::UNSELECTED_COLOR, color );
+ mColorButtonOption.SetProperty( Button::Property::SELECTED_COLOR, color );
+ }
+
+ editor.Reset();
+ }
+
private:
Application& mApplication;
private:
Application& mApplication;