[FIXED] Current FC Qt Stylesheets don't support resizing windows that have been tiled

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
Kunda1
Posts: 8417
Joined: Thu Jan 05, 2017 9:03 pm

[FIXED] Current FC Qt Stylesheets don't support resizing windows that have been tiled

Postby Kunda1 » Thu Oct 15, 2020 10:08 pm

In a recent video by Joko Engineering he is showing his preferred way of setting up his workspace to view both spreadsheet and 3Dview simultaneously. The problem is that he can't resize the tiled windows due to stylesheet conflicts. So he has to go in to the preferences and choose 'No stylesheet' in order to get around this issue. The video below is timestamped showing this issue.
phpBB [video]


I can confirm this behavior on 0.19

Code: Select all

OS: Manjaro Linux (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22670 (Git) AppImage
Build type: Release
Branch: master
Hash: 12155f4aab09047c5697db0c1b3cf93b02edda03
Python version: 3.8.6
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
Here is a screencast (notice how I can't resize dialog windows when stylesheet is activated.

Image
pablogil wrote: pinged by pinger macro
Chrismettal wrote:
Celica_Supra wrote: pinged by pinger macro
How to recreate:
1. Open the Spreadsheet WB
2. Start a new file Ctrl+n
3. Create Spreadsheet
4. Windows > Tile
5. Try to resize the spreadsheet or 3D view
6. Now change the stylesheet and try steps 1-5 again
Last edited by Kunda1 on Mon Oct 19, 2020 11:04 pm, edited 1 time in total.
Reason: Added [Fixed] to thread title
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
Chrismettal
Posts: 10
Joined: Fri Sep 18, 2020 11:44 am
Location: Germany
Contact:

Re: [Bug] Current FC Qt Stylesheets don't support resizing windows that have been tiled

Postby Chrismettal » Thu Oct 15, 2020 11:24 pm

Interesting find.

Just very quickly trying out some things I found that any of these lines make the border around hovering windows in tiled mode disappear, removing resizing handles. Commenting out the initial reset makes border reappear:
f0uTb6G9xa.png
f0uTb6G9xa.png (102.33 KiB) Viewed 585 times
Will look into a real fix later as we want to keep this initial reset. Will just need to add the correct border styling to the dialog but it's too late for me today.

Also the hovering dialog has an inconsistent border style to the main window on Windows (Win10 main window vs Win7 w/o Aero hovering window). Not tested yet on Linux.
User avatar
Kunda1
Posts: 8417
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Bug] Current FC Qt Stylesheets don't support resizing windows that have been tiled

Postby Kunda1 » Fri Oct 16, 2020 12:54 am

Chrismettal wrote:
Thu Oct 15, 2020 11:24 pm
Will look into a real fix later as we want to keep this initial reset. Will just need to add the correct border styling to the dialog but it's too late for me today.
+1
Thanks for looking in to this
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
Chrismettal
Posts: 10
Joined: Fri Sep 18, 2020 11:44 am
Location: Germany
Contact:

Re: [Bug] Current FC Qt Stylesheets don't support resizing windows that have been tiled

Postby Chrismettal » Sat Oct 17, 2020 9:56 am

Minor Update:
WinWorking.png
WinWorking.png (279.36 KiB) Viewed 329 times
Just reenabling the native styling on windows after resetting everything in the beginning seems pretty difficult as the native border will be drawn over the native titlebar looking pretty ugly and as we want to have the same style everywhere i chose not to invest time into the native windows style and rather just add a new border with resizing handles.
I will not have enough time this weekend to make a completely custom titlebar as it just explodes when i try right now:
BrokenAF.png
BrokenAF.png (33.51 KiB) Viewed 329 times
If you think the fix itself is worth for now i could roll that out with a fitting border color to all the stylesheets and open up a PR, so resizing is possible at all even if not perfectly pretty yet. In any case I will try to make a fully custom titlebar for the subwindows when i get the time.

Do we have a better plan for a border rather than just a solid line? For docked windows the little dots in the middle are perfect but because subwindows are floating i don't think there is a way around a full border. What do you think?

If someone wants to try on other systems i added the file here, just rename to .qss
Attachments
Behave-dark.txt
(68.3 KiB) Downloaded 6 times
User avatar
Kunda1
Posts: 8417
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Bug] Current FC Qt Stylesheets don't support resizing windows that have been tiled

Postby Kunda1 » Sat Oct 17, 2020 10:10 am

I think a temporary fix is worth rolling out to all stylesheets. At least it restores the ability to resize the windows.
As for the permanent fix, it would be awesome to have a solution that was least intrusive and allows for more screen real-estate (thinking about FC on laptops etc...).
Thanks for the response an the file, I will test soon. :D
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
Chrismettal
Posts: 10
Joined: Fri Sep 18, 2020 11:44 am
Location: Germany
Contact:

Re: [Bug] Current FC Qt Stylesheets don't support resizing windows that have been tiled

Postby Chrismettal » Sat Oct 17, 2020 10:57 am

Yes, I don't think hovering QT subwindows are the best solution for multiple documents side by side. Thinking of multiple view providers for the same document even. I had 3 views enabled all the time in Fusion, one bigger one that i was actively working in, another one just in a different camera angle, and one mostly showing a master sketch or a variable table like in the video. Tiling 3 QT subwindows in that way is a pain.
Chrismettal
Posts: 10
Joined: Fri Sep 18, 2020 11:44 am
Location: Germany
Contact:

Re: [Bug] Current FC Qt Stylesheets don't support resizing windows that have been tiled

Postby Chrismettal » Sat Oct 17, 2020 9:57 pm

I just opene up a PR rolling out the initial fix.
https://github.com/FreeCAD/FreeCAD/pull/3972
User avatar
Kunda1
Posts: 8417
Joined: Thu Jan 05, 2017 9:03 pm

Re: [FIXED] Current FC Qt Stylesheets don't support resizing windows that have been tiled

Postby Kunda1 » Mon Oct 19, 2020 11:05 pm

Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features