Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an Appearances xaml object and AppearanceViewModel to TSE #10066

Merged
merged 31 commits into from
Jul 9, 2021
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b923b4b
initial
PankajBhojwani Apr 30, 2021
85a6392
hm
PankajBhojwani May 4, 2021
d750d56
cursor shape/height mostly work
PankajBhojwani May 5, 2021
ad35c70
remove navigated to
PankajBhojwani May 5, 2021
5920408
Color scheme ish
PankajBhojwani May 6, 2021
7eea902
background image stuff ish
PankajBhojwani May 6, 2021
f5078b8
bg image
PankajBhojwani May 10, 2021
f6cf9dd
Remove can delete appearance for now
PankajBhojwani May 10, 2021
0800d64
format
PankajBhojwani May 10, 2021
81a8b8b
dependency callback
PankajBhojwani May 11, 2021
f179248
font stuff
PankajBhojwani May 11, 2021
c8ee89f
format
PankajBhojwani May 11, 2021
62db2fa
comment
PankajBhojwani May 11, 2021
5f047a1
deduplicate file picker
PankajBhojwani May 11, 2021
6c7d997
Remove color scheme from profiles
PankajBhojwani May 11, 2021
3c3fede
abstract
PankajBhojwani May 12, 2021
05666f2
font lists back in profile, ref to profile
PankajBhojwani May 14, 2021
ef71e80
format
PankajBhojwani May 14, 2021
3dca0dd
conflict
PankajBhojwani May 17, 2021
e384b00
conflict, updates from merge main
PankajBhojwani May 21, 2021
8e604ba
format, rearrange
PankajBhojwani May 21, 2021
9ac1407
conflict
PankajBhojwani Jun 1, 2021
901d4bb
% sign changes
PankajBhojwani Jun 15, 2021
7e0264d
Merge branch 'main' of https://github.com/microsoft/terminal into dev…
PankajBhojwani Jun 18, 2021
f5b5bb9
move file/image picker to utils.h/cpp
PankajBhojwani Jun 18, 2021
fbfdb2d
tabstop false
PankajBhojwani Jun 18, 2021
6177c26
format
PankajBhojwani Jun 18, 2021
d7290a0
conflict
PankajBhojwani Jul 1, 2021
c089c20
vcxproj conflict
PankajBhojwani Jul 9, 2021
bbaf0ec
fix
PankajBhojwani Jul 9, 2021
b3df4af
clinclude
PankajBhojwani Jul 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove navigated to
PankajBhojwani committed May 5, 2021
commit ad35c70b1ed5ff5a23bfb048c45ba132834d2b02
22 changes: 11 additions & 11 deletions src/cascadia/TerminalSettingsEditor/Appearances.cpp
Original file line number Diff line number Diff line change
@@ -109,18 +109,18 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
xaml_typename<Editor::Appearances>(),
PropertyMetadata{ nullptr });
}
}

void Appearances::NavigatedTo()
{
//_ViewModelChangedRevoker = Appearance().PropertyChanged(winrt::auto_revoke, [=](auto&&, const PropertyChangedEventArgs& args) {
// const auto settingName{ args.PropertyName() };
// if (settingName == L"CursorShape")
// {
// _PropertyChangedHandlers(*this, PropertyChangedEventArgs{ L"CurrentCursorShape" });
// _PropertyChangedHandlers(*this, PropertyChangedEventArgs{ L"IsVintageCursor" });
// }
//});
if (Appearance())
{
_ViewModelChangedRevoker = Appearance().PropertyChanged(winrt::auto_revoke, [=](auto&&, const PropertyChangedEventArgs& args) {
const auto settingName{ args.PropertyName() };
if (settingName == L"CursorShape")
{
_PropertyChangedHandlers(*this, PropertyChangedEventArgs{ L"CurrentCursorShape" });
_PropertyChangedHandlers(*this, PropertyChangedEventArgs{ L"IsVintageCursor" });
}
});
}
}

bool Appearances::IsVintageCursor() const
2 changes: 0 additions & 2 deletions src/cascadia/TerminalSettingsEditor/Appearances.h
Original file line number Diff line number Diff line change
@@ -30,8 +30,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
public:
Appearances();

void NavigatedTo();

// CursorShape visibility logic
bool IsVintageCursor() const;

1 change: 0 additions & 1 deletion src/cascadia/TerminalSettingsEditor/Appearances.idl
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@ namespace Microsoft.Terminal.Settings.Editor
{
Appearances();
AppearanceViewModel Appearance;
void NavigatedTo();
static Windows.UI.Xaml.DependencyProperty AppearanceProperty { get; };

IInspectable CurrentCursorShape;
7 changes: 3 additions & 4 deletions src/cascadia/TerminalSettingsEditor/Profiles.cpp
Original file line number Diff line number Diff line change
@@ -87,7 +87,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation

ProfileViewModel::ProfileViewModel(const Model::Profile& profile) :
_profile{ profile },
_ShowAllFonts{ false }
_ShowAllFonts{ false },
_defaultAppearanceViewModel { winrt::make<implementation::AppearanceViewModel>(profile.DefaultAppearance().try_as<AppearanceConfig>()) }
{
// Add a property changed handler to our own property changed event.
// This propagates changes from the settings model to anybody listening to our
@@ -343,7 +344,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation

Editor::AppearanceViewModel ProfileViewModel::DefaultAppearance()
{
return winrt::make<implementation::AppearanceViewModel>(_profile.DefaultAppearance().try_as<AppearanceConfig>());
return _defaultAppearanceViewModel;
}

bool ProfileViewModel::UseDesktopBGImage()
@@ -599,8 +600,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation

// Navigate to the pivot in the provided navigation state
ProfilesPivot().SelectedIndex(static_cast<int>(_State.LastActivePivot()));

DefaultAppearanceXaml().NavigatedTo();
}

void Profiles::OnNavigatedFrom(const NavigationEventArgs& /*e*/)
1 change: 1 addition & 0 deletions src/cascadia/TerminalSettingsEditor/Profiles.h
Original file line number Diff line number Diff line change
@@ -103,6 +103,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
Model::Profile _profile;
winrt::hstring _lastBgImagePath;
winrt::hstring _lastStartingDirectoryPath;
Editor::AppearanceViewModel _defaultAppearanceViewModel;
bool _ShowAllFonts;

static Windows::Foundation::Collections::IObservableVector<Editor::Font> _MonospaceFontList;