modern-forms / Modern.Forms

Cross-platform spiritual successor to Winforms for .NET 6+
MIT License
842 stars 54 forks source link

System.Drawing.Common will be only supported on Windows #50

Closed dax-leo closed 1 year ago

dax-leo commented 1 year ago

Hi,

Do you plan to update WindowKit, considering System.Drawing.Common will drop non-Windows support in >7.0 releases (at least that is what I understood) ? https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only Considering you are already using Skia, replacement should be possible (?).

By the way, not relevant to my comment, I would like to congratulate you for building this cool library. SkiaSharp enables us to have unlimited creativity with custom controls, without any ancient GDI+ Windows nonsense. I forked your code in attempt to create my own custom controls and add some theme improvements. Looks great! Integration with other Skia controls (I made example for Microcharts) is simple and straightforward. image

I am huge fan of dark themes so I made some changes in your Theme manager to support Light and Dark themes. Considering datagrids are so important I was thinking to migrate ReoGrid (which can serve as gridview and excel clone) to Modern.Forms. If/when I do it, I will share the code.

One more time, truly impressive work so far. image

jpobst commented 1 year ago

Thanks for the kind words!

Do you plan to update WindowKit, considering System.Drawing.Common will drop non-Windows support in >7.0 releases (at least that is what I understood) ?

I think we are already using it properly, and only using the Windows-specific pieces on Windows. The parts we use on all platforms are simply structs like Point and Rectangle. However if we find a place where we are using one of the listed affected APIs on non-Windows we should definitely look at converting it.

I am huge fan of dark themes so I made some changes in your Theme manager to support Light and Dark themes.

Looks great! I strongly dislike dark themes, so I haven't put any work into creating one. 😁

But there should definitely be one built-in and I would love for someone with more dark theme passion to tackle it.

Considering datagrids are so important I was thinking to migrate ReoGrid (which can serve as gridview and excel clone) to Modern.Forms

Yeah, a DataGrid is pretty essential to the types of applications Modern.Forms is targeting, but it's also a tremendous amount of work, so it hasn't been tackled yet. Another option would be to port DataGridView from Microsoft's actual Winforms source. It's probably not as feature-rich, but it's one that would be very familiar for Winforms developers. (It is actually implemented in C#, it's not a wrapper around a Win32 control.)

I think at this point I don't want to commit to a specific DataGrid implementation, so I had thought it would initially go into a separate library/NuGet until I felt it was mature enough and seemed like the right way to go.

dax-leo commented 1 year ago

Hi,

thank you for reply. UI programming was never my thing considering I work mostly in telecom domain, but now when I have more spare time I really enjoy learning new things.

Here is some good news; I converted my old treeview (it supports hierarchy nodes) implementation which is very light grid viewer. It's now fully SkiaSharp supported. I am currently adapting treeview filters, editors, scaling etc. (10 years ago scaling was not in my mind :) image

Next to it I also adapted very simple implementation of Html Control. This is stripped down implementation of existing Html Renderer, but I decided not to go with that one due to extreme complexity. I still need to resolve few text measuring bugs, but I am almost there. Clipboard01 (1)

Simple button with context menu as extension to Modern.Forms.Button control. Somehow I use these all the time. image

Stack Panel (work in progress) - movable tiles with custom controls or html view (for simple dashboard with real time updates- think of weather info etc. ).

Next on my list: GMap.NET - code base looks very organized, I will investigate it. ReoGrid - will drop this one for time being. Unfortunately it's large portion of spaghetti code. Windows Charting from .NET - maybe (?), need to check if Microcharts.Skia is suitable replacement. Month Calendar - need this for my gridview editor considering we can't reuse Win32 wrapper (CPOL license) - https://www.codeproject.com/articles/10840/another-month-calendar

If someone has more ideas just drop link to GitHub project (just please pay attention to license) and let's see what can be done (keep in mind I have normal day job so I will do my best). I will organize all these projects under Modern.Forms.Extensions GitHub project (coming in few weeks). This framework will serve as good replacement for some my Linux C++/QT projects, so for sure I will keep my eye on it for long time.

I can drop any updates here, if you don't mind to keep this discussion open.

Regards, Darko