Repository navigation
Conversation
Closes #9. The XAML asked for brush keys (ResultsBackground, PrimaryForeground, ...) that only the demo app's DarkTheme.xaml ever defined, and the tool window used Windows SystemColors plus fixed colours, so inside SSMS the pane stayed light whatever the theme. SsmsThemeAdapter (Package, C#) now fills those keys on the hosted control from VSColorTheme and refills them on ThemeChanged; the tool window creates it before showing the control and disposes it. C# rather than XAML keeps VSSDK out of SqlPilot.UI and avoids naming a Shell assembly that differs between the 15.x and 17.x builds. SystemColors and fixed colours are gone from the tool window and SearchControl; the search box sets its colours directly (its local Style blocked the host's), the placeholder is an overlay so it can be themed, and buttons and the context menu get small templates because the stock ones hard-code light hover colours and a light icon gutter. No theme setting. Checked in the demo app and a XAML harness with dark and light palettes; not yet run inside SSMS.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 43 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Theme keys resolve in SSMS 18/20 as well as 22; what a tool window does not get for free; where SSMS 22 keeps its themes.
mourier
marked this pull request as ready for review
November 19, 2026 00:31
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9 (the theme half; the multi-server half is #10).
Why the pane ignored the theme
SearchControl.xamlasks for brush keys (ResultsBackground,PrimaryForeground,SecondaryForeground,IconForeground, …) that onlyDarkTheme.xamldefines, and only the demo app merges that dictionary. Inside SSMS nothing supplied them.SqlPilotToolWindowControl.xamlused WindowsSystemColors, plus#0078D4/White on the update bar;SearchControl.xamlhad fixed Gray and Gold.Stylekept any host styling from reaching it.Change
Integration/SsmsThemeAdapter.cs(Package, linked into Legacy): fills the brush keys on the hosted control fromVSColorTheme.GetThemedColorand refills them onVSColorTheme.ThemeChanged.SqlPilotToolWindowcreates it before the control is shown and disposes it. Falls back to the matching Windows system colour for a key the shell can't resolve. Adopts the shell's scroll bar style when it publishes one.SystemColors, no fixed colours. Small themed templates for buttons and the context menu, because the stock ones hard-code light hover colours and a light icon gutter.SearchControl: search box colours set as plain properties; placeholder is now an overlayTextBlock(themeable) instead of aVisualBrush; favourite star uses a key.ScopeControl: tree items take the host's text colour.DarkTheme.xaml/LightTheme.xaml: the new keys the shared controls use. Demo app and installer untouched. No theme setting.ARCHITECTURE.md, "Following the SSMS theme" in the integration notes. README already claims theme awareness, so it is unchanged.Verified
Deployed to real SSMS and driven through UI Automation:
Also: full solution builds, 83 core + 5 installer tests pass, demo app renders correctly with
DarkTheme.xaml.Visible change on SSMS 18/20: buttons are flat themed ones instead of stock Windows buttons, and the context menu takes the shell's menu colour.
Not exercised in SSMS: the update notification bar (no update was pending) and a list long enough to show the scroll bar. The bar was checked in a standalone WPF host with dark and light palettes.