mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-14 02:26:50 -07:00
fixes (#1599)
This commit is contained in:
parent
d6ed2cbf51
commit
cc9a46a3f0
3 changed files with 16 additions and 10 deletions
|
@ -276,3 +276,10 @@ long long CalculatorApp::ViewModel::Common::Utilities::GetConst_WINEVENT_KEYWORD
|
|||
return WINEVENT_KEYWORD_RESPONSE_TIME;
|
||||
}
|
||||
|
||||
bool CalculatorApp::ViewModel::Common::Utilities::GetIntegratedDisplaySize(double* size)
|
||||
{
|
||||
if (SUCCEEDED(::GetIntegratedDisplaySize(size)))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -719,6 +719,7 @@ namespace CalculatorApp
|
|||
static Windows::UI::Xaml::Media::SolidColorBrush ^ GetContrastColor(Windows::UI::Color backgroundColor);
|
||||
static int GetWindowId();
|
||||
static long long GetConst_WINEVENT_KEYWORD_RESPONSE_TIME();
|
||||
static bool GetIntegratedDisplaySize(double* size);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ using System.Collections.ObjectModel;
|
|||
using System.ComponentModel;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Windows.Graphics.Display;
|
||||
using Windows.Storage;
|
||||
using Windows.UI.Core;
|
||||
using Windows.UI.ViewManagement;
|
||||
|
@ -39,16 +40,13 @@ namespace CalculatorApp
|
|||
m_model.PropertyChanged += OnAppPropertyChanged;
|
||||
m_accessibilitySettings = new AccessibilitySettings();
|
||||
|
||||
// CSHARP_MIGRAION: TODO: find another implementation for C#
|
||||
//double sizeInInches = 0.0;
|
||||
|
||||
//if (SUCCEEDED(GetIntegratedDisplaySize(&sizeInInches)))
|
||||
//{
|
||||
// if (sizeInInches < 7.0) // If device's display size (diagonal length) is less than 7 inches then keep the calc always in Portrait mode only
|
||||
// {
|
||||
// DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait | DisplayOrientations.PortraitFlipped;
|
||||
// }
|
||||
//}
|
||||
if(Utilities.GetIntegratedDisplaySize(out var sizeInInches))
|
||||
{
|
||||
if(sizeInInches < 7.0) // If device's display size (diagonal length) is less than 7 inches then keep the calc always in Portrait mode only
|
||||
{
|
||||
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait | DisplayOrientations.PortraitFlipped;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CalculatorApp.ViewModel.ApplicationViewModel Model
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue