Always-on-Top mode implemented (#579)
This commit is contained in:
committed by
Pepe Rivera
parent
af8322617f
commit
796d171960
@@ -25,6 +25,9 @@ namespace CalculatorApp
|
||||
OBSERVABLE_PROPERTY_RW(CalculatorApp::Common::ViewMode, PreviousMode);
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(Platform::String ^, CategoryName);
|
||||
|
||||
// Indicates whether calculator is currently in standard mode _and_ supports CompactOverlay _and_ is not in Always-on-Top mode
|
||||
OBSERVABLE_PROPERTY_RW(bool, DisplayNormalAlwaysOnTopOption);
|
||||
|
||||
COMMAND_FOR_METHOD(CopyCommand, ApplicationViewModel::OnCopyCommand);
|
||||
COMMAND_FOR_METHOD(PasteCommand, ApplicationViewModel::OnPasteCommand);
|
||||
|
||||
@@ -64,6 +67,48 @@ namespace CalculatorApp
|
||||
}
|
||||
}
|
||||
|
||||
static property Platform::String ^ LaunchedLocalSettings
|
||||
{
|
||||
Platform::String ^ get()
|
||||
{
|
||||
return Platform::StringReference(L"calculatorAlwaysOnTopLaunched");
|
||||
}
|
||||
}
|
||||
|
||||
static property Platform::String ^ WidthLocalSettings
|
||||
{
|
||||
Platform::String ^ get()
|
||||
{
|
||||
return Platform::StringReference(L"calculatorAlwaysOnTopLastWidth");
|
||||
}
|
||||
}
|
||||
|
||||
static property Platform::String ^ HeightLocalSettings
|
||||
{
|
||||
Platform::String ^ get()
|
||||
{
|
||||
return Platform::StringReference(L"calculatorAlwaysOnTopLastHeight");
|
||||
}
|
||||
}
|
||||
|
||||
property bool IsAlwaysOnTop
|
||||
{
|
||||
bool get()
|
||||
{
|
||||
return m_isAlwaysOnTop;
|
||||
}
|
||||
void set(bool value)
|
||||
{
|
||||
if (m_isAlwaysOnTop != value)
|
||||
{
|
||||
m_isAlwaysOnTop = value;
|
||||
RaisePropertyChanged(L"IsAlwaysOnTop");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ToggleAlwaysOnTop(float width, float height);
|
||||
|
||||
private:
|
||||
bool TryRecoverFromNavigationModeFailure();
|
||||
|
||||
@@ -76,6 +121,10 @@ namespace CalculatorApp
|
||||
|
||||
CalculatorApp::Common::ViewMode m_mode;
|
||||
Windows::Foundation::Collections::IObservableVector<CalculatorApp::Common::NavCategoryGroup ^> ^ m_categories;
|
||||
Concurrency::task<void> HandleToggleAlwaysOnTop(float width, float height);
|
||||
void SetDisplayNormalAlwaysOnTopOption();
|
||||
|
||||
bool m_isAlwaysOnTop;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user