mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-19 21:03:11 -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;
|
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 Windows::UI::Xaml::Media::SolidColorBrush ^ GetContrastColor(Windows::UI::Color backgroundColor);
|
||||||
static int GetWindowId();
|
static int GetWindowId();
|
||||||
static long long GetConst_WINEVENT_KEYWORD_RESPONSE_TIME();
|
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 System.ComponentModel;
|
||||||
using Windows.Foundation;
|
using Windows.Foundation;
|
||||||
using Windows.Foundation.Collections;
|
using Windows.Foundation.Collections;
|
||||||
|
using Windows.Graphics.Display;
|
||||||
using Windows.Storage;
|
using Windows.Storage;
|
||||||
using Windows.UI.Core;
|
using Windows.UI.Core;
|
||||||
using Windows.UI.ViewManagement;
|
using Windows.UI.ViewManagement;
|
||||||
|
@ -39,16 +40,13 @@ namespace CalculatorApp
|
||||||
m_model.PropertyChanged += OnAppPropertyChanged;
|
m_model.PropertyChanged += OnAppPropertyChanged;
|
||||||
m_accessibilitySettings = new AccessibilitySettings();
|
m_accessibilitySettings = new AccessibilitySettings();
|
||||||
|
|
||||||
// CSHARP_MIGRAION: TODO: find another implementation for C#
|
if(Utilities.GetIntegratedDisplaySize(out var sizeInInches))
|
||||||
//double sizeInInches = 0.0;
|
{
|
||||||
|
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
|
||||||
//if (SUCCEEDED(GetIntegratedDisplaySize(&sizeInInches)))
|
{
|
||||||
//{
|
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait | DisplayOrientations.PortraitFlipped;
|
||||||
// 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
|
public CalculatorApp.ViewModel.ApplicationViewModel Model
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue