DYN-6228 Light theme supported - #17342
edwin-vasquez-ucaldas wants to merge 16 commits into
Conversation
…the Option A plan agreed on the ticket.
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-6228
| static InPorts() | ||
| { | ||
| _primaryCharcoal200Brush.Freeze(); | ||
| _portLabelForegroundBrush.Freeze(); |
| static OutPorts() | ||
| { | ||
| _primaryCharcoal200Brush.Freeze(); | ||
| _portLabelForegroundBrush.Freeze(); |
| private static Color GetThemedColor(string resourceKey) | ||
| { | ||
| var brush = SharedDictionaryManager.DynamoColorsAndBrushesDictionary[resourceKey] as SolidColorBrush; | ||
| return brush.Color; |
| _primaryCharcoal300.Freeze(); | ||
| _midGreyBrush.Freeze(); | ||
| _blue300Brush.Freeze(); | ||
| _nodeContextMenuAccent.Freeze(); |
| _nodeContextMenuBackgroundHighlight.Freeze(); | ||
| _nodeContextMenuBackground.Freeze(); | ||
| _nodeContextMenuForeground.Freeze(); | ||
| _nodeContextMenuForegroundHighlight.Freeze(); |
| midGrey.Freeze(); | ||
| darkerGreyBrush.Freeze(); | ||
| darkMidGreyBrush.Freeze(); | ||
| nodeBodyBackgroundBrush.Freeze(); |
| darkerGreyBrush.Freeze(); | ||
| darkMidGreyBrush.Freeze(); | ||
| nodeBodyBackgroundBrush.Freeze(); | ||
| nodeHeaderBackgroundBrush.Freeze(); |
| darkMidGreyBrush.Freeze(); | ||
| nodeBodyBackgroundBrush.Freeze(); | ||
| nodeHeaderBackgroundBrush.Freeze(); | ||
| nodeContextMenuForeground.Freeze(); |
| nodeBodyBackgroundBrush.Freeze(); | ||
| nodeHeaderBackgroundBrush.Freeze(); | ||
| nodeContextMenuForeground.Freeze(); | ||
| nodeContextMenuForegroundHighlight.Freeze(); |
| nodeHeaderBackgroundBrush.Freeze(); | ||
| nodeContextMenuForeground.Freeze(); | ||
| nodeContextMenuForegroundHighlight.Freeze(); | ||
| nodeContextMenuBackground.Freeze(); |
jasonstratton
left a comment
There was a problem hiding this comment.
Looks good. Approved!
@edwin-vasquez-ucaldas , Just one thing:
PreferencesViewModel.cs uses Res.ResourceManager.GetString("PreferencesViewThemeDark", CultureInfo.CurrentUICulture) in a few spots instead of the generated Res.PreferencesViewThemeDark property everywhere else in the same file
While there is nothing really wrong with this, I wonder about the inconsistency. No need to change anything though. Just bringing it to your attention.
Looks like Dynamo SelfServe failed and you may need an update to retrigger the PR checks. I think it may be a merge conflict.
|
Curious what the graph mapper (or is it called curve mapper) node looks like, |
johnpierson
left a comment
There was a problem hiding this comment.
currently working through a full audit, with changes requested to come.
… to CRLF with each file's original BOM
There was a problem hiding this comment.
See the ticket for this pull request: https://autodesk.atlassian.net/browse/DYN-6228
|
@johnpierson some updates regarding the Audit document. 4. I was not able to reproduce the same as audit reported, however include an improvement |
|













Purpose
Aaron Tang: the legacy 2.12 look is not the deliverable. "User confirmed that she need light theme, not necessarily the legacy theme." So this is scoped as a light theme, not a 2.12 revival.
JT Pierson's comment carries the agreed plan. Its core findings: there is no theming system to lean on — just 13 loose XAML dictionaries under UI\Themes\Modern, loaded once at startup, with ~1000 inline hex literals across src/ and ~200 hardcoded brushes in C#. It offers three options and recommends Option A: "Light theme (restart required)", colors only.
Declarations
Check these if you believe they are true
Release Notes
There was no theming system. What existed:
UI\Themes\Modern\, shipped as files (CopyToOutputDirectory=Always), loaded once at startup.SharedDictionaryManager.ThemesDirectory— a file-system path hardcoded toUI\Themes\Modern\. Every dictionary URI derived from it. This one property was the hook.App.xamland noApplication.Current.Resources. 66 XAML files merge the dictionaries individually viaSharedResourceDictionary, which caches by URI in apublic staticdictionary.PreferenceSettingshad no theme/appearance property.DynamoColorsAndBrushes.xamlwas one of at least four sources:DynamoModern.xaml(~6700 lines, hundreds of inline hex literals), converter properties with baked-in literals, ~200 hardcoded brushes across ~54 C# files, and an embedded.xshd.Theme selection
enum DynamoTheme { Dark, Light }src/DynamoCore/Configuration/DynamoTheme.cs(no WPF dependency, soDynamoCorestays cross-platform)PreferenceSettings.ThemeDark; serialises toDynamoSettings.xmllikeDefaultRunTypeSharedDictionaryManager.CurrentThemesrc/DynamoCoreWpf/UI/SharedResourceDictionary.csDynamoViewModel(StartConfiguration), immediately after the model is assignedTwo deliberate design points:
Darkmaps to the folder nameModern. Renaming the folder would break the ~66 XAML merge sites and any package referencing them.CurrentThememust be set before the first view is constructed.SharedResourceDictionarycaches every dictionary by URI, and the codebase resolves colours almost entirely throughStaticResource. Assigning it later leaves the UI with a mix of both themes. This constraint is documented on the property; treat it as startup-only configuration.Surfaces converted
Each row lists the role-named key(s) introduced and the consumer moved onto them. All base values
were kept identical, so the dark theme is unchanged unless noted.
WorkspaceBackgroundBrushDynamoView.xaml— was a hardcoded#232323NodeBodyBackgroundBrush,NodeHeaderBackgroundBrushNodeView.xaml.cs— wasDarkerGrey/DarkMidGreyConnector{None,Selection,Hover,ExecutionPreview,Transient}(Color and Brush)DynamoConverters.xaml— literals baked into converter propertiesPortLabelForegroundBrushInPorts.xaml.cs,OutPorts.xaml.cs— wasPrimaryCharcoal200BrushPortBackgroundBrush,PortBackgroundPreviewOffBrush,PortBorderBrushPortViewModel.cs— wasColor.FromRgb(...)PortValueMarker{Default,Blue,Red,Grey}Brush,PortKeepListStructureBorderBrushInPortViewModel.cs,OutPortViewModel.csNodeInput{Background,Border,Foreground,SecondaryForeground,LabelForeground,Caret,Highlight}BrushDynamoTextBox.cs,DynamoSlider.xaml,DateTimeInputControl.xamlNodeSliderThumbBrush,NodeSliderTrackBrushDynamoSlider.xamlCodeEditor{Background,Foreground,LineNumbers,Border,Number,Class,Method,Link}BrushCodeCompletionEditor.xaml,CodeBlockEditorUtils.csNodeContextMenu{Foreground,ForegroundHighlight,Background,BackgroundHighlight,SeparatorColor,AccentBrush}NodeView.xaml.cs,WorkspaceView.xaml,AnnotationView.xaml.cs,ContextMenuItemStyleInCanvasSearch{Background,Border,Foreground,Placeholder,Caret,Accent}BrushIncanvasSearchControl.xaml— was borrowing library keys plus two literalsEvidence
Reviewers
@jasonstratton @RobertGlobant20
@jnealb
FYIs
@johnpierson