Dark mode UI#859
Conversation
SeanFeldman
left a comment
There was a problem hiding this comment.
@awilliansd there are a few comments that apply to multiple places.
Also, the screenshots are missing.
The AI-generated documentation has the "Build script" section, mentioning a build script build-dark-theme.ps1, but that's not in the PR. Nor should there be, as it should work with the existing build infrastructure.
|
I've fixed the comments, added the script I used, and refactored several times. I've also added screenshots in the folder. Sorry for my mistake. Thanks for the feedback. |
|
@paolosalvatori and @ErikMogensen, a nice UI update for those that crave dark mode. Thoughts? |
|
If the feature works as expected, I'm more than happy to approve and merge it. Did you guys tried it @SeanFeldman / @ErikMogensen? |
| var color = e.Item.Selected | ||
| ? ThemeManager.SurfaceLighter | ||
| : ThemeManager.SurfaceLight; | ||
| e.Graphics.FillRectangle(new SolidBrush(color), e.Item.ContentRectangle); |
There was a problem hiding this comment.
The SolidBrush is not being disposed of. Unlike above where you are using a using statement.
| } | ||
|
|
||
| protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) | ||
| => e.Graphics.FillRectangle(new SolidBrush(ThemeManager.Surface), e.AffectedBounds); |
| if (e.Item.Selected || e.Item.Pressed) | ||
| { | ||
| var color = e.Item.Pressed ? ThemeManager.Accent : ThemeManager.SurfaceLighter; | ||
| e.Graphics.FillRectangle(new SolidBrush(color), new Rectangle(Point.Empty, e.Item.Size)); |
| { | ||
| ApplyToControl(control); | ||
| ApplyRecursive(control); | ||
| control.ControlAdded += (s, e) => ApplyRecursive(e.Control); |
There was a problem hiding this comment.
Each Apply() call (e.g., during Toggle()/SetTheme()) adds another handler. After toggling twice, every new control added gets themed twice. Guard against this or unsubscribe first.
There was a problem hiding this comment.
I changed duplicate event subscriptions in ThemeManager.Apply
| MainFormThemeExtension.InitTheme(this, mainMenuStrip); | ||
| ThemeManager.Apply(this); |
There was a problem hiding this comment.
InitTheme(MainForm, MenuStrip) already calls ThemeManager.Apply(form) . The second call in MainForm's constructor (line after) is a duplicate that also registers a second ControlAdded handler.
|
I think it is a very cool feature. I started a build from the branch but the Themes menu item was not visible when I ran it. I haven't looked into it so it may be something on my side. @awilliansd, since normally application default to the light theme I think we should stick to that. |
…commit includes:\n- Translation of theme manager components to English\n- Updates to EventGrid library files\n- Improvements to ContainerForm UI layout\n- Enhancements to various controls (HandleEventGridSubscriptionControl, HandleQueueControl)\n- Dark mode implementation refinements
In my branch, this is the button to choose theme |
I pulled ten commits and now I see it. It is quite a different look even for the light theme: @paolosalvatori, you are the author - what do you think of it? |
I tried to get the closest color. But if you want, I can try to get even closer; it's a bit difficult. |
Resolve conflicts by prioritizing upstream dashboard and control logic while preserving dark-mode integration in MainForm, HandleQueueControl, and HandleSubscriptionControl.
|
@awilliansd is the latest round of changes addressing the issue @ErikMogensen brought up? |
Yes, I merged it with the main version, just check my last commits. |









Add Dark/Light Theme Toggle
Summary
Adds a runtime dark/light theme toggle to Service Bus Explorer.
Default is dark, switchable via View → Theme → Dark / Light, with persistence across sessions.
Changes
New
Helpers/ThemeManager.cs— theming engine (recursive apply, persistence, custom control support)Helpers/MainFormThemeExtension.cs— menu injection + native dark title barUpdated
MainForm.cs— initializes themingFormsandUserControls— apply theme afterInitializeComponent().Designer.cs— neutralized hardcoded colorsTechnical Overview
ThemeManager.Apply(Control)SetTheme/ToggleConfigurationManagerToolStrip,MenuStrip,TabControlThemes
Dark
#212121#2A2A2A#484848#ECECEC#007ACCLight
SystemColors(native Windows appearance)Notes
AboutFormexcluded due to custom backgroundTesting