diff options
author | Md. Farhan Mahtab <farhan.m1@samsung.com> | 2024-07-01 05:34:22 -0400 |
---|---|---|
committer | Md. Farhan Mahtab <farhan.m1@samsung.com> | 2024-07-01 05:34:22 -0400 |
commit | 7b45373f74edf3c677b5a06ee5d56291e0f3e744 (patch) | |
tree | 292cff566bc4cbf8193690f536bde23b6dfd9ae5 | |
parent | b1678a81e1f834329a4190bef23414943568dd5a (diff) | |
download | tray-7b45373f74edf3c677b5a06ee5d56291e0f3e744.tar.gz tray-7b45373f74edf3c677b5a06ee5d56291e0f3e744.tar.bz2 tray-7b45373f74edf3c677b5a06ee5d56291e0f3e744.zip |
Fix window position issue in low resolution.
[Problem] When opening in low resolution the window border is positioned on the left side not centered.
[Cause & Measure]
Cause : Window size and positions were initialized in base constructor.
Measure : Window size and positions are initialized in Main.
Change-Id: I6bbf7cbfa24f9e3309024846f0199f5cf20970d7
Signed-off-by: Md. Farhan Mahtab <farhan.m1@samsung.com>
-rwxr-xr-x | Apps/Apps.cs | 7 | ||||
-rw-r--r-- | Apps/Common/AppConstants.cs | 4 | ||||
-rw-r--r-- | Apps/Core/WindowManager.cs | 4 | ||||
-rw-r--r-- | packaging/org.tizen.Apps-1.0.1.tpk | bin | 160707 -> 160710 bytes |
4 files changed, 8 insertions, 7 deletions
diff --git a/Apps/Apps.cs b/Apps/Apps.cs index 1725ccc..28fa50a 100755 --- a/Apps/Apps.cs +++ b/Apps/Apps.cs @@ -30,7 +30,7 @@ namespace Apps private ViewManager viewManager; private Window window; - public Program() : base(new Size2D(960, 540), new Position2D(480, 248), ThemeOptions.PlatformThemeEnabled, new CustomBorder()) + public Program(Size2D windowSize, Position2D windowPosition) : base(windowSize, windowPosition, ThemeOptions.PlatformThemeEnabled, new CustomBorder()) { } @@ -57,7 +57,7 @@ namespace Apps window.OrientationChanged += OnWindowOrientationChanged; window.Hide(); viewManager = new ViewManager(); - } + } protected override void OnAppControlReceived(AppControlReceivedEventArgs e) { @@ -145,7 +145,8 @@ namespace Apps static void Main(string[] args) { - Program app = new Program(); + Rectangle rectangle = new Rectangle(960, 540, 480, 248); + Program app = new Program(new Size2D(rectangle.Width, rectangle.Height), new Position2D(rectangle.X, rectangle.Y)); app.Run(args); } } diff --git a/Apps/Common/AppConstants.cs b/Apps/Common/AppConstants.cs index 649f6c3..fc220b9 100644 --- a/Apps/Common/AppConstants.cs +++ b/Apps/Common/AppConstants.cs @@ -1,4 +1,4 @@ -using Tizen.NUI; +using Tizen.NUI; namespace Apps.Common { @@ -38,6 +38,6 @@ namespace Apps.Common Add("slant", new PropertyValue("normal")); public static float windowHeightRatio = 540f / 1080; - public static float windowWidthRation = 960f / 1920; + public static float windowWidthRatio = 960f / 1920; } } diff --git a/Apps/Core/WindowManager.cs b/Apps/Core/WindowManager.cs index afda2f7..841dec4 100644 --- a/Apps/Core/WindowManager.cs +++ b/Apps/Core/WindowManager.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -35,7 +35,7 @@ namespace Apps.Core int positionX, positionY; int width, height; - width = (int)(DeviceInfo.DisplayWidth * AppConstants.windowWidthRation); + width = (int)(DeviceInfo.DisplayWidth * AppConstants.windowWidthRatio); height = (int)(DeviceInfo.DisplayHeight * AppConstants.windowHeightRatio); positionX = ((DeviceInfo.IsPortrait? DeviceInfo.DisplayHeight : DeviceInfo.DisplayWidth) - width) / 2; diff --git a/packaging/org.tizen.Apps-1.0.1.tpk b/packaging/org.tizen.Apps-1.0.1.tpk Binary files differindex 7b78607..f5cfdb1 100644 --- a/packaging/org.tizen.Apps-1.0.1.tpk +++ b/packaging/org.tizen.Apps-1.0.1.tpk |