iNKORE-NET / UI.WPF.Modern

Modern (Fluent 2) styles and controls for your WPF applications
GNU Lesser General Public License v2.1
447 stars 39 forks source link

Maximize snap layout on second screen #60

Closed Bober95 closed 4 months ago

Bober95 commented 4 months ago

Describe the bug The button and snaplayout do not work when the window is on the second screen 150358641-d646bfa5-fa66-4264-bfb4-4259029bd6bb

NotYoojun commented 4 months ago

Hello

Thanks for ur feedback. However, I'm sorry that I don't have a second display to test with.

If you got a way to fix it, please don't hesitate to open a PR or contact me.

Bober95 commented 4 months ago

ok, I found the solution :)

https://stackoverflow.com/questions/49288552/how-do-i-read-the-win32-wm-move-lparam-x-y-coordinates-in-c

File: Helpers/Styles/SnapLayout Function: IsOverButton

Change: int positionX = lParam.ToInt32() & 0xffff; int positionY = lParam.ToInt32() >> 16;

To: uint lparam32 = (uint)lParam.ToInt64(); short positionX = (short)(lparam32 & 0xffff); short positionY = (short)((lparam32 >> 16) & 0xffff);

NotYoojun commented 4 months ago

Hi there, I'll dig into this when I get home. Thanks for ur ideas!

NotYoojun commented 4 months ago

Please try the latest commit, I applied your idea there. Could you please build the latest version and check if it still exists.

Bober95 commented 4 months ago

Thanks, it works!

NotYoojun commented 4 months ago

Hi there, could you guys please drop us a five star for the gallery app on Microsoft Store? Your feedback really helps us a lot! Pretty please? Thanks so much! @Bober95 @Valkirie @ghost1372 @JeremyAnsel

https://www.microsoft.com/store/productId/9N3JS11ZC38G

ghost1372 commented 4 months ago

Hi @NotYoojun Done.🌟🌟🌟🌟🌟 also if you have any time πŸ˜πŸ™ https://apps.microsoft.com/search/publisher?name=Mahdi+Hosseini&hl=en-us&gl=US

ghost1372 commented 4 months ago

also, did you try WPF .Net 9 Preview Gallery App? it is Worse🀣

NotYoojun commented 4 months ago

also, did you try WPF .Net 9 Preview Gallery App? it is Worse🀣

Yeah I've downloaded it and I have to say it just sucks. No details, no animations, there's nothing at all...

NotYoojun commented 4 months ago

Hi @NotYoojun Done.🌟🌟🌟🌟🌟 also if you have any time πŸ˜πŸ™ https://apps.microsoft.com/search/publisher?name=Mahdi+Hosseini&hl=en-us&gl=US

Love it, and five stars has been dropped! The only pity is that the package is too large. Did you packed the whole .NET runtime? It took me really a long time to download.

ghost1372 commented 4 months ago

Hi @NotYoojun Done.🌟🌟🌟🌟🌟 also if you have any time πŸ˜πŸ™ https://apps.microsoft.com/search/publisher?name=Mahdi+Hosseini&hl=en-us&gl=US

Love it, and five stars has been dropped! The only pity is that the package is too large. Did you packed the whole .NET runtime? It took me really a long time to download.

Yes, Self Contained for Net and WASDK, every architecture (x64, x86, arm) size is almost 80mb. I can reduce it by removing self contained but i think user may face with some issues

NotYoojun commented 4 months ago

That just takes away a lot of trouble, ain't it? Even though I'm again Self-contained, I have to admit that it's really convenient sometimes. πŸ˜‚πŸ˜‚