-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
MaterialTextBox2 issue on initialization #238
Comments
I took a brief look at this issue last night and couldn't reproduce it with the demo application. Is it possible for you to create a small application so we can reproduce this issue? I will try tonight to create multiple text boxes and utilize a modal window to see if I can reproduce the issue. |
I added a few extra MaterialTextBox2s to the sample application and used a MaterialDialog to replicate your use of a modal and I can not reproduce this issue. I would need you to create a small application so I could identify the specific issue. |
I made a small project. I found that focus bar problem does not happens in this project, but background did. You have the solution in attached zip file. |
The problem with focused textboxes is starting from design... I think it is an isolated case, so this issue can be solved in the future, if you can find the problem, if you can reproduce it. |
I spent some time this morning looking at the project and I couldn't reproduce any of the issues you mentioned. I noticed you had included the This is a system dependent bug and may be difficult to track down. Are you familiar with Windows Sandbox? If so, copy the binary directory into a fresh instance of sandbox (you may require additional dependencies) and attempt to run the program there and see if you encounter the same issue. A fresh virtual machine would also work. The goal here is to eliminate as many factors as possible that could be affecting the behavior like 3rd party software. Edit: As a side note, I noticed that you're using .NET 5. This library is not technically supported in .NET 5, yet. |
Yes, I know. But, as long as on your computer everything works ok, seems on my Windows it is happening something. |
I've made a PR for cursor mouse over issue. Regarding background, I've made some trial using framework 4.6.1 & 4.7.2 but I wasn't able to reproduce background issue. |
Hi @orapps44 . |
I have made a test now. Practically, I've made I think you must review |
I don't believe this is specifically an OS bug. I believe it may be related to other software on your system that may be causing you to see different results than we do. Have you been able to test your application in a fresh Win10 environment yet to rule out other possible issues? Once we can reproduce this issue, a fix can be worked on. As of now, I have not experienced any issues with the OnFocus event that you have pointed out. Since there could be a wide range of things causing this issue, like accessibility software, we would need to know what is causing it and look for a work around. It could also be a GPU issue, but I feel that is unlikely. |
@VolatilePulse , when you (we, in general) make an application, you don't install it on a clean system and use only that application in that system. A lot of applications could be installed on system, so, this MaterialSkin must work with other applications installed. The thing here is to make it work on all systems, all Windows versions, and to see what is happening on some of them and why, and what is happening on others and why. "I cannot reproduce it", definitely is not the solution. I test it on 3 Windows 10 x64 and all have the same issue. Different PCs... I have commercial Windows licenses on all of them, is not cracked/hacked. Did you test it on more of one PC? Best regards, |
I'm sorry, I believe I may not have expressed myself clearly and that is my fault. It's difficult to track down the specific issue if we cannot emulate the issue. I asked if it worked in a fresh Windows 10 installation not because I feel the software should only work under that scenario, but so we can begin to narrow down specifically what causes the issues that you're experiencing. I was hoping the issue that you were experiencing wouldn't be present on a VM because that would help us rule out a GPU and system files. Since you are encountering that issue in a VM, it is likely to be way above me and it won't be able to be fixed by myself. Also, your screenshot you sent recently isn't showing the OnFocus issue you initially mentioned, or at least what I understand this issue to be about (the text boxes having focus, or the highlighted bar, when they shouldn't). I can see the outlined shape that you're talking about, the baseTextBox effectively showing through the MaterialTextBox, but I don't know what's causing it. The reason it is important for developers to reproduce issues is so they can identify and fix the issue instead of just throwing code at an issue, possibly breaking something else. If you do know what the exact issue is and what needs to be fixed, I'm sure Orapps would gladly accept your PR or implement the specific change. But if you aren't sure what's causing it, it is important for us to reproduce the issue to attempt to fix it. And please don't think that "can't reproduce" is a solution or a cop out. I wouldn't be asking you to test more things if I didn't genuinely want to help fix this issue. I feel that everyone should be able to enjoy MaterialSkin equally, regardless of what software is on their computer or what operating system they're working with, or what .NET version they're using. My material-form-refactor is specifically aiming to remove custom code and passing as much of the heavy lifting for the application onto Windows as possible. This allows for generally more consistent and bug free experiences while also typically being faster. |
I realized that I didn't answer you question about the number of machines that I've tested on and since I'm currently at work, I ran a VM and couldn't reproduce it. I ran Windows Sandbox and couldn't reproduce it. I ran it on my work computer and couldn't reproduce it. But out of an abundance of determination, I was finally able to reproduce one of the issues. @orapps44 when running the sample application that @valimaties posted earlier in this thread, I was able to get the "bordered" text box to occur after I clicked on the button and closed the window twice. Due to the fact that I'm at work, I'm unable to do any additional testing, however, I believe this may be a relatively easy fix once the code is identified. I have not been able to experience the other issue of a text box showing it has focus when it really doesn't though. If you can produce a demo application for that, it would be greatly appreciated. |
I've narrowed down the issue to the MaterialSkinManager's UpdateBackgrounds() method. That's what is causing the BaseTextBox to effectively inherit the form's background color. I'm not 100% why it's doing it and I'm not sure what the right approach is, but figured I'd leave my findings thus far. Edit: MaterialTextBox2 OnPaint(PaintEventArgs pevent)
//...
baseTextBox.BackColor = !_enabled ? ColorHelper.RemoveAlpha(SkinManager.BackgroundDisabledColor, BackColor) : //Disabled
isFocused ? DrawHelper.BlendColor(BackColor, SkinManager.BackgroundFocusColor, SkinManager.BackgroundFocusColor.A) : //Focused
MouseState == MouseState.HOVER ? DrawHelper.BlendColor(BackColor, SkinManager.BackgroundHoverColor, SkinManager.BackgroundHoverColor.A) : // Hover
DrawHelper.BlendColor(BackColor, SkinManager.BackgroundAlternativeColor, SkinManager.BackgroundAlternativeColor.A); // Normal |
Yes, @VolatilePulse , exactly ... I said about it right here #238 (comment) |
Hi, I've found the root cause of focused control at startup (it occurs only if readonly property is set). |
See PR #242 |
Thanks @orapps44 . I've made a test on my forked master with Now it remains the background color for baseTextBox object. |
Any news about background color problem?! |
I'm not able to reproduce this backcolor issue. |
Look up in the comments. It is a Test.zip archive, which contains an entire solution. Look up in the comments, there is a comment of @VolatilePulse who said he encountered this behavior in some conditions. Regards |
This issue disapear if textbox and button are placed inside materialTabControl (this explain why it can't be seen on material example project) and if framework is 4.x ... |
If I translate well, ALWAYS I have to add controls in a materialTabControl? What happens with simple forms, without drawer, without TabControl, which want to use of MaterialSkin controls? Edit: First picture, in first comment, all those controls are in materialTabControl, and it happens. Maybe because it is .Net 5 (?!) |
There is known visual issues if controls are not inside a container like shadow missing or black color around controls (see #198 #86 #52 #30 #29).
Yes with .Net 5 even inside materialTabControl issue still here. |
Hi, I've finnaly found a fix for background issue. See : https://github.com/leocb/MaterialSkin/tree/orapps44-MaterialTextBox2-backcolor-fix |
Hi @orapps44 , |
( Copied from #227 )
Hi @VolatilePulse .
I downloaded your branch (aero-snapping) and tried in my project. Form size it will remains as it has been set before open it. That is very good.
But another problem it is happening with MaterialTextBox2 control in this branch. It doesn't loose focus (all textboxes has that colored focus bar in the bottom of control), only on initialization of form. Also, when I close a modal form, all textboxes will change its backcolor but only on text area. Pictures below:
This is a video showing the behavior:
TextBox2Behavior.mp4
The text was updated successfully, but these errors were encountered: