set app size and location
authorYurii Zinchuk/Tizen Services & IoT (PLT) /SRPOL/Engineer/Samsung Electronics <y.zinchuk@samsung.com>
Wed, 22 Nov 2023 15:41:11 +0000 (16:41 +0100)
committerPiotr Czaja/Tizen Services & IoT (PLT) /SRPOL/Engineer/Samsung Electronics <p.czaja@samsung.com>
Wed, 29 Nov 2023 10:21:42 +0000 (11:21 +0100)
SettingView/SettingView.cs

index 4ac06cb6424e38e8d006d217e08ef04b86963e56..f5fd6ca0770d1783da23752667eed79c59dceafb 100644 (file)
@@ -418,18 +418,17 @@ namespace SettingView
 
             // window size adjustments
             float bottomMargin = 0.1f;
-            float widthRatio = 0.7f;
-            float heightRatio = 0.7f;
+            float widthRatio = 0.45f;
+            float heightRatio = 0.5f;
 
-            _ = Information.TryGetValue("http://tizen.org/feature/screen.width", out int screenWidth);
-            _ = Information.TryGetValue("http://tizen.org/feature/screen.height", out int screenHeight);
+            var screenSize = GetScreenSize();
 
-            int width = (int)(screenWidth * widthRatio);
-            int height = (int)(screenHeight * (1 - bottomMargin) * heightRatio);
+            int width = (int)(screenSize.Width * widthRatio);
+            int height = (int)(screenSize.Height * (1 - bottomMargin) * heightRatio);
 
             // INFO: it looks like size of custom border is not included in total window size
             Size2D size = new Size2D(width, height);
-            Position2D position = new Position2D((screenWidth - width) / 2, (screenHeight - height) / 2 - (int)(bottomMargin * screenHeight));
+            Position2D position = new Position2D(((int)screenSize.Width - width) / 2, ((int)screenSize.Height - height) / 2 - (int)(bottomMargin * screenSize.Height));
 
             appCustomBorder = new SettingViewBorder();