-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Enable switching app theme based off of OS theme #14497
Conversation
…me-theme-switch-switch
…eme-switch-switch
…eme-switch-switch
…eme-switch-switch
} | ||
|
||
if (!_globals->Themes().HasKey(_globals->Theme())) | ||
if (_globals->Theme().DarkName() == _globals->Theme().LightName()) |
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.
BTW I think it'd be advantageous for us in the long term if we consistently stopped calling WinRT functions repeatedly like that. These calls are about 4x as expensive as regular, non-inlined function calls and returning a runtimeclass reference involves at least 2 such calls each time. I realize that even then these calls are plenty fast for "cold paths" like this, but I think that it might lead to impacts down the road, for instance by impacting Debug build performance to a point where it begins to be annoying (Debug build WinRT calls are over 20x more expensive), or just because one of these function calls ends up not being O(1)
anymore but e.g. O(log N)
or something (an ordered map lookup instead of an unordered one for instance).
Just to be clear, I'm not saying that this is a problem right now, but I'm hoping to make a case for what I think might be beneficial for our long term code health.
@@ -1178,14 +1178,32 @@ void CascadiaSettings::_validateThemeExists() | |||
auto newTheme = winrt::make_self<Theme>(); | |||
newTheme->Name(L"system"); | |||
_globals->AddTheme(*newTheme); | |||
_globals->Theme(L"system"); | |||
_globals->Theme(*winrt::make_self<ThemePair>(L"system")); |
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.
Why not just Model::ThemePair{ L"system" }
?
I know we need |
Hello @zadjii-msft! 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 (
|
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.
✅
🎉 Handy links: |
Documents a whole pile of stuff from 1.17: * `useMica` microsoft/terminal#13935 * theme pairs microsoft/terminal#14497 * scheme pairs microsoft/terminal#14064 * closes #626
* fix(powerline): update oh-my-posh CLI (#632) * Themes updates for 1.17 (#634) Documents a whole pile of stuff from 1.17: * `useMica` microsoft/terminal#13935 * theme pairs microsoft/terminal#14497 * scheme pairs microsoft/terminal#14064 * closes #626 * Default prompt icon info, resolves #625 (#642) * Add app execution alias section (#643) * Add autoHideWindows Resolves #633 * Add color theme FAQs * Remove code brackets from headers Resolves #637 * Fix default if no command specified Called out in #638 * Add note differentiating null from no setting for Starting Directory. Resolves #624 --------- Co-authored-by: Jan De Dobbeleer <2492783+JanDeDobbeleer@users.noreply.github.com> Co-authored-by: Mike Griese <migrie@microsoft.com>
* fix(powerline): update oh-my-posh CLI (#632) * Themes updates for 1.17 (#634) Documents a whole pile of stuff from 1.17: * `useMica` microsoft/terminal#13935 * theme pairs microsoft/terminal#14497 * scheme pairs microsoft/terminal#14064 * closes #626 * Default prompt icon info, resolves #625 (#642) * Add app execution alias section (#643) * Add autoHideWindows Resolves #633 * Add color theme FAQs * Remove code brackets from headers Resolves #637 * Fix default if no command specified Called out in #638 * Add note differentiating null from no setting for Starting Directory. Resolves #624 * add the adobe-target metadata for A/B testing (#646) could you please help to merge this metadata change (adobe-target=true) to main branch and then to live? This is to enable A/B testing ability across many url base paths so we can improve Learn user experience based on data-driven decisions. This meta (adobe-target) itself will not change how your content is displayed or modify any other UI behaviors so it is safe to merge. --------- Co-authored-by: Jan De Dobbeleer <2492783+JanDeDobbeleer@users.noreply.github.com> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com>
* fix(powerline): update oh-my-posh CLI (#632) * Themes updates for 1.17 (#634) Documents a whole pile of stuff from 1.17: * `useMica` microsoft/terminal#13935 * theme pairs microsoft/terminal#14497 * scheme pairs microsoft/terminal#14064 * closes #626 * Default prompt icon info, resolves #625 (#642) * Add app execution alias section (#643) * Add autoHideWindows Resolves #633 * Add color theme FAQs * Remove code brackets from headers Resolves #637 * Fix default if no command specified Called out in #638 * Add note differentiating null from no setting for Starting Directory. Resolves #624 * add the adobe-target metadata for A/B testing (#646) could you please help to merge this metadata change (adobe-target=true) to main branch and then to live? This is to enable A/B testing ability across many url base paths so we can improve Learn user experience based on data-driven decisions. This meta (adobe-target) itself will not change how your content is displayed or modify any other UI behaviors so it is safe to merge. * Add documentation to include information about enable/disable read-only mode functionality (#645) * Update actions to include new enable and disable functionality * Update panes to include new enable and disable functionality * Many updates to commandline args docs, and some missing actions too (#649) * Many updates to commandline args docs, and some missing actions too * Fix anchor link warnings --------- Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> * Remove Dynamic SSH profiles from doc since it has not been implemente… (#650) * Remove Dynamic SSH profiles from doc since it has not been implemented yet. * Updated authors and date * Shelfing read-only mode docs until it goes in a future release (#653) * Added maximum history size (#657) * added maximum history size * empty commit to poke the bot * remove instances of Preview for 1.15 features (#669) * remove enableReadOnlyMode and disableReadyOnlyMode docs in panes until it goes live in a future release (#672) --------- Co-authored-by: Jan De Dobbeleer <2492783+JanDeDobbeleer@users.noreply.github.com> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> Co-authored-by: juchen-ms <partychen.acm@gmail.com> Co-authored-by: Alex Noble <6237394+Swinkid@users.noreply.github.com>
* fix(powerline): update oh-my-posh CLI (#632) * Themes updates for 1.17 (#634) Documents a whole pile of stuff from 1.17: * `useMica` microsoft/terminal#13935 * theme pairs microsoft/terminal#14497 * scheme pairs microsoft/terminal#14064 * closes #626 * Default prompt icon info, resolves #625 (#642) * Add app execution alias section (#643) * Add autoHideWindows Resolves #633 * Add color theme FAQs * Remove code brackets from headers Resolves #637 * Fix default if no command specified Called out in #638 * Add note differentiating null from no setting for Starting Directory. Resolves #624 * add the adobe-target metadata for A/B testing (#646) could you please help to merge this metadata change (adobe-target=true) to main branch and then to live? This is to enable A/B testing ability across many url base paths so we can improve Learn user experience based on data-driven decisions. This meta (adobe-target) itself will not change how your content is displayed or modify any other UI behaviors so it is safe to merge. * Add documentation to include information about enable/disable read-only mode functionality (#645) * Update actions to include new enable and disable functionality * Update panes to include new enable and disable functionality * Many updates to commandline args docs, and some missing actions too (#649) * Many updates to commandline args docs, and some missing actions too * Fix anchor link warnings --------- Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> * Remove Dynamic SSH profiles from doc since it has not been implemente… (#650) * Remove Dynamic SSH profiles from doc since it has not been implemented yet. * Updated authors and date * Shelfing read-only mode docs until it goes in a future release (#653) * Added maximum history size (#657) * added maximum history size * empty commit to poke the bot * remove instances of Preview for 1.15 features (#669) * remove enableReadOnlyMode and disableReadyOnlyMode docs in panes until it goes live in a future release (#672) * Update Docs with Release 1.18 (#674) * Stashed dynamic SSH profiles doc * Add portable mode docs to release branch 1.18 (#655) * added first draft of docs * changed headings and subheadings * Reword, add an Upgrading section --------- Co-authored-by: Dustin Howett <duhowett@microsoft.com> * Retool the portable mode documentation to explain our distributions (#656) * Retool portable mode to be 'distributions' * Fix warnings * add preinstallation to the feature matrix * add dci to matrix * reword * couple more notes * better version note * Use a data matrix table, re-alt-text the portable mode image * add distributions to the toc * address L's feedbacc * Document 'activeOnly' value for 'showCloseButton' property. (#660) * Shelfing read-only mode docs until it goes in a future release (#653) * Added maximum history size (#657) * added maximum history size * empty commit to poke the bot * Document 'activeOnly' value for 'showCloseButton' property. --------- Co-authored-by: Christopher Nguyen <91625426+nguyen-dows@users.noreply.github.com> * Add a small section on tab tearout in the overview page (#666) * Shelfing read-only mode docs until it goes in a future release (#653) * Added maximum history size (#657) * added maximum history size * empty commit to poke the bot * initial commit * added preview links and small grammatical fixes * added important preview flag * moved Important flag to the end of the section to fit Actions docs * omit unrelated changes that got pulled in from master * omit actions and profiles changes * Add preview text and re-add missing enableReadOnlyMode docs (#673) * add preview text and readd enableReadOnlyMode that was lost in the most recent commit * add preview text for activeOnly value in showCloseButton property docs --------- Co-authored-by: Dustin Howett <duhowett@microsoft.com> Co-authored-by: kovdu <koen.vandurme@gmail.com> --------- Co-authored-by: Jan De Dobbeleer <2492783+JanDeDobbeleer@users.noreply.github.com> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> Co-authored-by: juchen-ms <partychen.acm@gmail.com> Co-authored-by: Alex Noble <6237394+Swinkid@users.noreply.github.com> Co-authored-by: Dustin Howett <duhowett@microsoft.com> Co-authored-by: kovdu <koen.vandurme@gmail.com>
…ocs (#678) * fix(powerline): update oh-my-posh CLI (#632) * Themes updates for 1.17 (#634) Documents a whole pile of stuff from 1.17: * `useMica` microsoft/terminal#13935 * theme pairs microsoft/terminal#14497 * scheme pairs microsoft/terminal#14064 * closes #626 * Default prompt icon info, resolves #625 (#642) * Add app execution alias section (#643) * Add autoHideWindows Resolves #633 * Add color theme FAQs * Remove code brackets from headers Resolves #637 * Fix default if no command specified Called out in #638 * Add note differentiating null from no setting for Starting Directory. Resolves #624 * add the adobe-target metadata for A/B testing (#646) could you please help to merge this metadata change (adobe-target=true) to main branch and then to live? This is to enable A/B testing ability across many url base paths so we can improve Learn user experience based on data-driven decisions. This meta (adobe-target) itself will not change how your content is displayed or modify any other UI behaviors so it is safe to merge. * Add documentation to include information about enable/disable read-only mode functionality (#645) * Update actions to include new enable and disable functionality * Update panes to include new enable and disable functionality * Many updates to commandline args docs, and some missing actions too (#649) * Many updates to commandline args docs, and some missing actions too * Fix anchor link warnings --------- Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> * Remove Dynamic SSH profiles from doc since it has not been implemente… (#650) * Remove Dynamic SSH profiles from doc since it has not been implemented yet. * Updated authors and date * Shelfing read-only mode docs until it goes in a future release (#653) * Added maximum history size (#657) * added maximum history size * empty commit to poke the bot * remove instances of Preview for 1.15 features (#669) * remove enableReadOnlyMode and disableReadyOnlyMode docs in panes until it goes live in a future release (#672) * Update Docs with Release 1.18 (#674) * Stashed dynamic SSH profiles doc * Add portable mode docs to release branch 1.18 (#655) * added first draft of docs * changed headings and subheadings * Reword, add an Upgrading section --------- Co-authored-by: Dustin Howett <duhowett@microsoft.com> * Retool the portable mode documentation to explain our distributions (#656) * Retool portable mode to be 'distributions' * Fix warnings * add preinstallation to the feature matrix * add dci to matrix * reword * couple more notes * better version note * Use a data matrix table, re-alt-text the portable mode image * add distributions to the toc * address L's feedbacc * Document 'activeOnly' value for 'showCloseButton' property. (#660) * Shelfing read-only mode docs until it goes in a future release (#653) * Added maximum history size (#657) * added maximum history size * empty commit to poke the bot * Document 'activeOnly' value for 'showCloseButton' property. --------- Co-authored-by: Christopher Nguyen <91625426+nguyen-dows@users.noreply.github.com> * Add a small section on tab tearout in the overview page (#666) * Shelfing read-only mode docs until it goes in a future release (#653) * Added maximum history size (#657) * added maximum history size * empty commit to poke the bot * initial commit * added preview links and small grammatical fixes * added important preview flag * moved Important flag to the end of the section to fit Actions docs * omit unrelated changes that got pulled in from master * omit actions and profiles changes * Add preview text and re-add missing enableReadOnlyMode docs (#673) * add preview text and readd enableReadOnlyMode that was lost in the most recent commit * add preview text for activeOnly value in showCloseButton property docs --------- Co-authored-by: Dustin Howett <duhowett@microsoft.com> Co-authored-by: kovdu <koen.vandurme@gmail.com> * Add a tutorial for enabling shell integration (#676) * it's basically just the blog post * fix urls * Right-click context menu, allowHeadless docs (#677) * right-click context menu docs * allowHeadless too while I'm here --------- Co-authored-by: Jan De Dobbeleer <2492783+JanDeDobbeleer@users.noreply.github.com> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> Co-authored-by: juchen-ms <partychen.acm@gmail.com> Co-authored-by: Alex Noble <6237394+Swinkid@users.noreply.github.com> Co-authored-by: Dustin Howett <duhowett@microsoft.com> Co-authored-by: kovdu <koen.vandurme@gmail.com>
This is basically just like #14064, but with the
theme
instead.If you define a pair of
theme
names:then the Terminal will use the one relevant for the current OS theme. This cooperates with #14064, who sets the
scheme
based on the app's theme.This was spec'd as a part of #3327 / #12530, but never promoted to its own issue.
Gif below.