Commit 63dbf76614161aca03e60e90ec0a3286b5687399

Authored by Ferran Sole
1 parent 4a48b0f0

Bug fix: ItemView example's multiple selection checkbox renders below the image

Also fixes a bug where the checkbox of the first items was not being rendered

Change-Id: I7d6b9edec90f1997dc1e9baab0c911e4bb5d74ff
examples/item-view/item-view-example.cpp
... ... @@ -26,6 +26,7 @@
26 26 #include <dali/dali.h>
27 27 #include <dali-toolkit/dali-toolkit.h>
28 28 #include <dali/devel-api/images/atlas.h>
  29 +#include <dali/devel-api/rendering/cull-face.h>
29 30  
30 31 using namespace Dali;
31 32 using namespace Dali::Toolkit;
... ... @@ -291,6 +292,9 @@ public:
291 292 mReplaceButton.SetVisible( false );
292 293 stage.Add( mReplaceButton );
293 294  
  295 + // Store one 1x1 white image for multiple items to share for backgrounds:
  296 + mWhiteImage = BufferImage::WHITE();
  297 +
294 298 // Create the item view actor
295 299 mImageAtlas = CreateImageAtlas();
296 300 mItemView = ItemView::New(*this);
... ... @@ -322,9 +326,6 @@ public:
322 326 // Set the title and icon to the current layout
323 327 SetLayoutTitle();
324 328 SetLayoutImage();
325   -
326   - // Store one 1x1 white image for multiple items to share for backgrounds:
327   - mWhiteImage = BufferImage::WHITE();
328 329 }
329 330  
330 331 Actor OnKeyboardPreFocusChange( Actor current, Actor proposed, Control::KeyboardFocus::Direction direction )
... ... @@ -891,7 +892,8 @@ public: // From ItemFactory
891 892 checkbox.SetSize( spiralItemSize.width * 0.2f, spiralItemSize.width * 0.2f );
892 893 checkbox.SetPosition( -SELECTION_BORDER_WIDTH, SELECTION_BORDER_WIDTH );
893 894 checkbox.SetZ( 1.0f );
894   - checkbox.SetSortModifier( -50.0f );
  895 + SetCullFace(checkbox, Dali::CullBack);
  896 + checkbox.SetSortModifier( 150.0f );
895 897 if( MODE_REMOVE_MANY != mMode &&
896 898 MODE_INSERT_MANY != mMode &&
897 899 MODE_REPLACE_MANY != mMode )
... ... @@ -907,8 +909,9 @@ public: // From ItemFactory
907 909 tick.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
908 910 tick.SetSize( spiralItemSize.width * 0.2f, spiralItemSize.width * 0.2f );
909 911 tick.SetZ( 1.0f );
910   - tick.SetSortModifier( -50.0f );
  912 + tick.SetSortModifier( 150.0f );
911 913 tick.SetVisible( false );
  914 + SetCullFace(tick, Dali::CullBack);
912 915 checkbox.Add( tick );
913 916  
914 917 // Connect new items for various editing modes
... ...