TurboPack / SynEdit

SynEdit is a syntax highlighting edit control, not based on the Windows common controls.
221 stars 73 forks source link

TSynBaseCompletionProposalForm styling. #224

Closed vincentparrett closed 1 year ago

vincentparrett commented 2 years ago

TSynBaseCompletionProposalForm doesn't support vcl styles very well - and it looks pretty ugly (noting the comments in CreateParams about borders etc).

My thoughts are to try and make it look something like the visual studio one, with a gripper in the bottom right corner to solve the resizing issue (noting that the VS one can only be resized by the gripper).

image

I would probably need to create some small custom controls to make up the form rather than trying to do it all in the form class.

Thoughts?

vincentparrett commented 2 years ago

Ok found a way to do it without creating separate components. I have it painting ok now (on w11 - stilll need to test on W10).

Question - anyone know why there are separate bitmaps for painting the title and the rows? They are both painted to the canvas each time anyway.. the titlebitmap seems to provide no benefit that I can see.

pyscripter commented 2 years ago

image image

They look pretty good in PyScripter. But any improvements are welcome. The box can be made resizable, but no gripper is shown.

The code in TSynBaseCompletionProposalForm is very old and I has not changed substantially. So in relation to your question I am not sure.

vincentparrett commented 2 years ago

The thick border looks ugly to me. I managed to get a nice thin border that is resizable.

Also investigating a bug where I eventually end up with a range check error.

I'll submit a PR in the next day or so once I'm done.

vincentparrett commented 2 years ago

I have it painting nicely now, I was seeing flicker when scrolling the list before. The range check error I was seeing was my fault so not an issue.

I'm now looking at high dpi support.. the code is kindof a mess in this area I found that the proposal form is not scaling correctly - this may be a VCL bug as there are issues with dynamically created forms and the use of CreateNew. Also the way font scaling works is kinda funky. What isn't scaling at all is the ItemHeight - I will look at that today.

96dpi image

140 dpi

image

Anyway, taken way longer than I expected to get this far but hope to have a PR ready for review soon.

vincentparrett commented 2 years ago

Hmmm.. the 140 dpi image above looks blurry - but it's github doing that - it's not blurry in the screenshot I took or in the application!

vincentparrett commented 1 year ago

I have moved this PR to https://github.com/pyscripter/SynEdit - where I'll be contributing from now on