Skip to content
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

Material form refactor #226

Merged
merged 13 commits into from
Oct 18, 2021
Merged

Conversation

VolatilePulse
Copy link

This is an active PR primarily for feedback while I'm making changes. The file has a lot of old code and is no longer needed or there are better methods to replace older methods. Any issues identified will be documented in each commit where they are identified.

A lot of code will be shuffled about in the process, but I'll try to keep the commits as clean as possible.

No code was modified during rearranging
Added conditional check for DrawerIsOpen causes an odd closing animation in the example application
I believe this is due to the MaterialDrawer ctor setting the default state to open, but MaterialForm defaults to closed
This likely will aid in highlighting other issues and any discovered will be documented
Greatly simplifies the overall code and removes some low level methods
@orapps44
Copy link
Collaborator

Hi,

That sounds good and ambitious.
I will try to review as much as I can.

Thank you.

…m code

Remove the UpdateRects method by turning the rect fields into properties that calculate their value in real time
Remove unused fields
Cleanup the UpdateButtons method to accept only the used params instead of requiring event args
Minor calculation reduction for the Drawer components in RecalculateFormBoundaries

Significant rework of WndProc
Provide two commonly used calculations as variables
Almost completely removed the code for dragging a window

OnMouseMove changes
Increased relative readability
Increased conditions check to prioritize bools over calculations

Remove public accessors from User32 functions
@VolatilePulse
Copy link
Author

This last commit was pretty significant in terms of changes and I apologize for that. I began making a few targeted changes and while attempting to fix my other PR, I continued to find more things that I wanted to change. I'll try to refrain in the future from providing such large changes in a single commit.

On the bright side, there was a significant reduction to the amount of code within the WndProc method as well as small performance increases.

To date, the only issue I've noticed from this change was the drawer begins opened due to the default value within the drawer's code itself. The change just made it apparent that the values didn't line up.

I know you're busy and I'm not trying to rush you, but before this PR gets too large, I would like some feedback and any improvements you'd like to see if I could target.

Thank you for maintaining this project and I'm glad I've been able to contribute what I have so far. I'm not fluent with the Material Design and I'll leave most of that up to you, but I will attempt to make these changes as flawless and beneficial as possible.

@orapps44
Copy link
Collaborator

Hi @VolatilePulse ,

That's significant changes indeed. I will try to review it as soon as possible.

Thank you for your contribution.

@orapps44 orapps44 merged commit 366644c into leocb:master Oct 18, 2021
@orapps44 orapps44 added this to the 2.3.0 milestone Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants