TextEditor - Update the decoration box's size. 38/81038/4
authorVictor Cebollada <v.cebollada@samsung.com>
Thu, 21 Jul 2016 10:46:03 +0000 (11:46 +0100)
committerVíctor Cebollada <v.cebollada@samsung.com>
Tue, 2 Aug 2016 10:57:45 +0000 (03:57 -0700)
* Sets the decoration bounding box the size of the text-editor control.
  This prevents the popup to be positioned on top of the virtual keyboard
  or the top bar.

Change-Id: I317d2289e740725b8e39746feeccad5ff664827e
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
examples/text-editor/text-editor-example.cpp

index 5ec61b7..eb83eec 100644 (file)
@@ -131,6 +131,13 @@ public:
 
     mEditor.SetBackgroundColor( TEXT_EDITOR_BACKGROUND_COLOR );
 
+    const Size boundingBoxSize( stageSize * TEXT_EDITOR_RELATIVE_SIZE.GetVectorXY() );
+    Rect<int> boundingBox( 0,
+                           static_cast<int>( toolBarHeight ),
+                           static_cast<int>( boundingBoxSize.width ),
+                           static_cast<int>( boundingBoxSize.height - toolBarHeight ) );
+
+    mEditor.SetProperty( TextEditor::Property::DECORATION_BOUNDING_BOX, boundingBox );
     mEditor.SetProperty( TextEditor::Property::TEXT_COLOR, Color::BLACK );
     mEditor.SetProperty( TextEditor::Property::TEXT,
                          "Lorem ipsum dolor sit amet, aeque definiebas ea mei, posse iracundia ne cum.\n"