-
Notifications
You must be signed in to change notification settings - Fork 714
Fixes #4057 - MASSIVE! Fully implements ColorScheme
->Scheme
+ VisualRole
+ Colors.
->SchemeManager.
#4062
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
base: v2_develop
Are you sure you want to change the base?
Conversation
… v2_4057-Scheme-VisualRole
This is fun. Based on all this, I've been able to significantly improve how transparent shadows are drawn. Previously the shadow was a lame "highlight" of the Normal attribute of the underlying view. And the logic for what the underlying view as lame. Now, each cell of the shadow actually is a smarter highlight of the underlying cell. |
… v2_4057-Scheme-VisualRole
…h means restart the timer! This was causing mac/linux unit test failures. I think
Broke TextView/TextField selection
… v2_4057-Scheme-VisualRole
… v2_4057-Scheme-VisualRole
I ran an experiment to see how far we could go in having all VisualRole Attributes in a scheme derive from Normal. E.g. Instead of this: Scheme CreateBase ()
{
var highlight = new Color ("LightGray");
highlight = highlight.GetHighlightColor ();
return new ()
{
Normal = new ("LightGray", "RaisinBlack"),
Focus = new ("White", "DarkGray", "Bold"),
HotNormal = new ("Silver", "RaisinBlack", "Underline"),
Disabled = new ("DarkGray", "RaisinBlack", "Faint"),
HotFocus = new ("White", "DarkGray", "Underline,Bold"),
Active = new ("White", "Charcoal"),
HotActive = new ("White", "Charcoal", "Underline"),
Highlight = new (highlight, new Color ("RaisinBlack")),
Editable = new ("LightYellow", "OuterSpace")
};
} Do this: Scheme CreateBase ()
{
var highlight = new Color ("LightGray");
highlight = highlight.GetHighlightColor ();
return new ()
{
Normal = new ("LightGray", "RaisinBlack"),
};
} (The terseness would apply to Json representation too. Pretty darn good! Now, how will this hold up in other terminals vs WT? I dunno yet. But I'm going to run with it for now. |
Only the Toplevel Disabled attribute isn't much perceptible. |
Yeah. On this, I keep thinking "why do we have both Base and Toplevel schemes". In what world does anyone want both? |
I'm only thinking of one possibility. Maybe I'm wrong but when you define a schema for |
HUGE PR
This PR introduces a significant refactoring of Terminal.Gui's Configuration Management system, addressing issue #4057 and a bunch of other related issues. The changes include:
ConfigurationManager
SerializableConfigruationProperty
->ConfigProperty
).[ModuleInitalizer
] to ensure that CM caches the original values of all[ConfigProperty]
s and provides APIs for resetting those values back (ConfigurationManager.ResetToHardCodedValues
).Application.Init
. Instead CM is simply process-wide.ConfigurationManager.Enable
to enable it.ColorScheme
toScheme
. EnablesSchemeManager.GetCurrentSchemes()
as the API that replaces the oldColorSchemes
static class.VisualRole
to replace string-basedColorSchemes[???]
identifiers.View.Scheme
API signficantlyView.ColorScheme
->View.Scheme
View.HasScheme
to indicate whether a Scheme was explicitly set or not.Get/SetScheme
(used byScheme
get/set). Enable...GettingScheme
/OnGettingScheme
cancellable eventSettingScheme
/OnSettingScheme
cancellable eventScheme
is no longervirtual
(the above addressses).HighlightStyle.Hover
is DISABLED in this PR. to be fixed inHighlightStyle.Hover
etc... needs a different implementation #3753.Much of the vast churn in this PR was done to finally address a slew of non-deterministic unit test problems having to do with static state. There are still some non-CM related issues buried in there, but I've killed most of them here. Note: Any unit test that uses
Configuration.Enable
MUST NOT be inParallelizable
. However, if you don't callEnable
or useApplication
it's highly likely Parallelizable will work.IMPORTANT: If you rely on
View.Scheme
beingnull
... STOP. Instead useHasScheme
.Fixes
ColorScheme
toScheme
and MigrateColors
toConfigurationManager.Themes
#4057ConfigurationManager
-DeepMemberwiseClone
does not do what it says #4072ConfigurationManager
- It's stupid that it tries to be scoped byApplication.Init
#4073GetNormalColor
etc.... #4016TextStyle
Style
#4084Applied
andUpdated
events are clumsy #2871ConfigurationManager
- It's a bug for anySomeProperty = DefaultSomeProperty
ifSomeProperty
isn't nullable #4021View.GetSizeRequiredForSubViews()
#4089Proposed Changes/Todos
ColorScheme
toScheme
VisualRole
enumView.GetXXXColor ()
withView.GetAttributeForRole ()
Scheme
andAttribute
related APIs inView
are fully baked and thought through.CM.Enable
more rational - Have it takeConfigLocation
View.Enable
inView.Drawing
, built-in Views and Scenarios.Text Styles
scenario to show moreStyle
is misapplied/artifactsLoad()
"Schemes": []
doesn't accept partial dict. Just overwrites dest.ConfigurationManager
- It's a bug for anySomeProperty = DefaultSomeProperty
ifSomeProperty
isn't nullable #4021Now:
config.md
Deep DiveSchemes
Scenario that shows all views and lets you play with applying different schemesVisualRole
(Active
,HotActive
,Highlight
)drawing.md
Deep DiveHover
withHighlight
For Future PRs
Toplevel
anyway?). #4086HighlightStyle.Hover
etc... needs a different implementation #3753INotifyPropertyChanged
support toConfigProperty
Pull Request checklist:
CTRL-K-D
to automatically reformat your files before committing.dotnet test
before commit///
style comments)