-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement MVVM for the Rendering page (#13391)
## Summary of the Pull Request Implements a `RenderingViewModel` for the Rendering page in the SUI ## PR Checklist * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Validation Steps Performed Rendering page still works
- Loading branch information
1 parent
238b5c2
commit bbc570d
Showing
10 changed files
with
82 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
import "RenderingViewModel.idl"; | ||
|
||
namespace Microsoft.Terminal.Settings.Editor | ||
{ | ||
runtimeclass RenderingPageNavigationState | ||
{ | ||
Microsoft.Terminal.Settings.Model.GlobalAppSettings Globals; | ||
}; | ||
|
||
[default_interface] runtimeclass Rendering : Windows.UI.Xaml.Controls.Page | ||
{ | ||
Rendering(); | ||
RenderingPageNavigationState State { get; }; | ||
RenderingViewModel ViewModel { get; }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/cascadia/TerminalSettingsEditor/RenderingViewModel.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
#include "pch.h" | ||
#include "RenderingViewModel.h" | ||
#include "RenderingViewModel.g.cpp" | ||
|
||
using namespace winrt::Windows::Foundation; | ||
using namespace winrt::Microsoft::Terminal::Settings::Model; | ||
|
||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation | ||
{ | ||
RenderingViewModel::RenderingViewModel(Model::GlobalAppSettings globalSettings) : | ||
_GlobalSettings{ globalSettings } | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
#pragma once | ||
|
||
#include "RenderingViewModel.g.h" | ||
#include "ViewModelHelpers.h" | ||
#include "Utils.h" | ||
|
||
namespace winrt::Microsoft::Terminal::Settings::Editor::implementation | ||
{ | ||
struct RenderingViewModel : RenderingViewModelT<RenderingViewModel>, ViewModelHelper<RenderingViewModel> | ||
{ | ||
public: | ||
RenderingViewModel(Model::GlobalAppSettings globalSettings); | ||
|
||
PERMANENT_OBSERVABLE_PROJECTED_SETTING(_GlobalSettings, ForceFullRepaintRendering); | ||
PERMANENT_OBSERVABLE_PROJECTED_SETTING(_GlobalSettings, SoftwareRendering); | ||
|
||
private: | ||
Model::GlobalAppSettings _GlobalSettings; | ||
}; | ||
}; | ||
|
||
namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation | ||
{ | ||
BASIC_FACTORY(RenderingViewModel); | ||
} |
17 changes: 17 additions & 0 deletions
17
src/cascadia/TerminalSettingsEditor/RenderingViewModel.idl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
import "EnumEntry.idl"; | ||
|
||
#include "ViewModelHelpers.idl.h" | ||
|
||
namespace Microsoft.Terminal.Settings.Editor | ||
{ | ||
runtimeclass RenderingViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged | ||
{ | ||
RenderingViewModel(Microsoft.Terminal.Settings.Model.GlobalAppSettings globalSettings); | ||
|
||
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ForceFullRepaintRendering); | ||
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, SoftwareRendering); | ||
} | ||
} |