-
Notifications
You must be signed in to change notification settings - Fork 673
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
Border color doesn't change when changing color scheme #2686
Comments
In this case the border is on the |
I am sorry I totally screwed up setting up the example project, the problem is actually with |
I also added the code i used for this example to the original post |
Here the workaround: void Clicked ()
{
win.ColorScheme = new ColorScheme {
Disabled = Attribute.Make (Color.White, Color.Black),
Normal = Attribute.Make (Color.Cyan, Color.Black),
HotNormal = Attribute.Make (Color.White, Color.Black),
Focus = Attribute.Make (Color.White, Color.Black),
HotFocus = Attribute.Make (Color.White, Color.Black),
};
win.Border.Background = Color.Black;
win.Border.BorderBrush = Color.White;
frame.Border.Background = Color.Black;
frame.Border.BorderBrush = Color.White;
} |
@BDisp I know about this workaround, I just think that I shouldn't need to us it. |
This is fixed in v2; the entire way borders works is different in v2. So for now, please you use the workaround. |
@tig ok thanks for the info, I didn't know about that |
@tig I've the fix for this and I'll submit a PR soon. So, I reopen this. Thanks. |
Nice this is the correct behaviour |
I will quickly clone the repo and test this locally |
Ok I get the same result as you, but I noticed that the |
Because it has the focus and was the attributes you chosen:
If you want the opposite, then you have to toggle these attributes. |
Try with this code: void Clicked ()
{
win.ColorScheme = new ColorScheme {
Disabled = Attribute.Make (Color.White, Color.Black),
Normal = Attribute.Make (Color.White, Color.Black),
HotNormal = Attribute.Make (Color.Cyan, Color.Black),
Focus = Attribute.Make (Color.White, Color.Black),
HotFocus = Attribute.Make (Color.Cyan, Color.Black)
};
} |
For clarification, the attribute |
okok, i don't need it, it was just thing I noticed and wasn't sure if its correct, otherwise, the fix is good imo |
Try this new code and you will understand that is very important how to set correctly the Application.Init ();
var win = new Window ("Test");
var frame = new FrameView () {
X = 5,
Y = 10,
Width = Dim.Fill () - 5,
Height = Dim.Fill () - 10,
Title = "Test Frame",
};
ColorScheme originalScheme = null;
var buttonFrame = new Button ("Restore theme") { X = Pos.Center () };
buttonFrame.Clicked += () => RestoreTheme ();
frame.Add (buttonFrame);
var buttonWindow = new Button ("Change theme") { X = Pos.Center () };
buttonWindow.Clicked += () => ChangeTheme ();
win.Add (buttonWindow, frame);
Application.Top.Add (win);
Application.Run ();
Application.Shutdown ();
void ChangeTheme ()
{
originalScheme = win.ColorScheme;
win.ColorScheme = new ColorScheme {
Disabled = Attribute.Make (Color.White, Color.Black),
Normal = Attribute.Make (Color.White, Color.Black),
HotNormal = Attribute.Make (Color.Cyan, Color.Black),
Focus = Attribute.Make (Color.Black, Color.White),
HotFocus = Attribute.Make (Color.Cyan, Color.White)
};
}
void RestoreTheme ()
{
win.ColorScheme = originalScheme;
} |
Describe the bug
The border color of some Views (for example FrameView or Window) doesn't change when changing color scheme while the application is running.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The border foreground and background changes according to the new ColorScheme
Screenshots
Before button click:
After button click:
Desktop (please complete the following information):
Aditional information
The code I use to set up this example:
The text was updated successfully, but these errors were encountered: