Commit d1d28bf1c47023d4bcd3358449baade3b797eb3b
1 parent
42b6233b
Add to check disply size for rotation
Add to check disply size for rotation If the screen's width is greater than the height, AddAvailable is called with LANDSCAPE. Otherwise for the other case, AddAvailable is called with PORTRAIT. Change-Id: Id99ca9a2b840411194613d82f0f7870e2c81b79c
Showing
1 changed file
with
15 additions
and
4 deletions
shared/dali-table-view.cpp
| ... | ... | @@ -287,10 +287,21 @@ void DaliTableView::Initialize( Application& application ) |
| 287 | 287 | ApplyCubeEffectToPages(); |
| 288 | 288 | |
| 289 | 289 | Dali::Window winHandle = application.GetWindow(); |
| 290 | - winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT ); | |
| 291 | - winHandle.RemoveAvailableOrientation( Dali::Window::LANDSCAPE ); | |
| 292 | - winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT_INVERSE ); | |
| 293 | - winHandle.RemoveAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE ); | |
| 290 | + | |
| 291 | + if( stageSize.width <= stageSize.height ) | |
| 292 | + { | |
| 293 | + winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT ); | |
| 294 | + winHandle.RemoveAvailableOrientation( Dali::Window::LANDSCAPE ); | |
| 295 | + winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT_INVERSE ); | |
| 296 | + winHandle.RemoveAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE ); | |
| 297 | + } | |
| 298 | + else | |
| 299 | + { | |
| 300 | + winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE ); | |
| 301 | + winHandle.RemoveAvailableOrientation( Dali::Window::PORTRAIT ); | |
| 302 | + winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE ); | |
| 303 | + winHandle.RemoveAvailableOrientation( Dali::Window::PORTRAIT_INVERSE ); | |
| 304 | + } | |
| 294 | 305 | |
| 295 | 306 | // Set initial orientation |
| 296 | 307 | unsigned int degrees = 0; | ... | ... |