-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Rejuvenate the color schemes page #13269
Conversation
src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw
Outdated
Show resolved
Hide resolved
@@ -49,6 +50,16 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation | |||
return _Name; | |||
} | |||
|
|||
bool ColorSchemeViewModel::IsDefaultScheme() | |||
{ | |||
return _Name == _settings.ProfileDefaults().DefaultAppearance().ColorSchemeName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clever. renaming a scheme updates all profiles using it, so this will be true after a rename too. very clever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do this and fix the issues in post eh?
Hello @carlos-zamora! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
// when the window has already been closed.. We feel this is okay though, | ||
// because WE'RE ALREADY IN TEARDOWN! The app is exiting. We don't want a | ||
// XAML bug here to create a crash bucket. | ||
_app.UnhandledException([](auto&& /*sender*/, const UnhandledExceptionEventArgs& args) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i didn't notice this sneak in. gosh!
Huh, I guess the bot's broken today. Merging! |
## Summary of the Pull Request Fix a bug where if you pressed the "Save" button, WT would crash. This was caused by adding the possibility that no color scheme is selected in the main page. With no "current scheme", attempting to get its "name" would cause a null ptr exception. The fix is simple: just check if we actually have a current scheme. Bonus points: if we don't have a current scheme, don't bother looking throught the color schemes for a match because we'll never find one. ## References #13269 - Color Schemes Rejuv
🎉 Handy links: |
Update the color schemes page with the new Win 11 style.
With the rejuvenated experience, we now have two pages:
ColorSchemes.xaml
: "color scheme selection" pageitem. It is intended to have the user select a color scheme
they want to modify. The user can also click the "Add new"
button to add a new color scheme or the "delete" button to
delete the selected scheme.
and a disclaimer is shown.
color scheme for profiles.default (aka "base layer").
scheme, the default tag (if the scheme is the one set in base
layer), a text preview of the foreground/background, and a
grid of 16 color chips showing the colors for the scheme.
ColorSchemes
:show the disclaimer
ColorSchemesPageViewModel
view model functions. Thus, we include logic
to delete, edit, and set the selected scheme
as default.
page to navigate to upon saving/discarding
changes.
EditColorScheme.xaml
: "color scheme modification" pagethe page.
expander that starts as expanded.
there's no need for "renaming mode" anymore
EditColorScheme
:add the automation properties
rename editor
ColorSchemeViewModel
:directly to the view model functions.
had to expose knowledge of being the default
via "IsDefaultScheme()" which compares the
current name to the one in the settings model.
setting container style.
needed a way to refresh the view model's knowledge of being
the default. So we added a
RefreshIsDefault
API to theColorSchemeViewModel
to notify changes.button, so all that logic has been removed
MainPage
to handle navigating to the correctpage upon saving/discarding changes.
Closes #9775
Co-authored-by: Carlos Zamora cazamor@microsoft.com