Feature Request: Add horizontal split view

A forum for research and development of the user interface of FreeCAD

Moderator: agryson

User avatar
Joel_graff
Posts: 1623
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Feature Request: Add horizontal split view

Postby Joel_graff » Fri Nov 24, 2017 1:15 pm

So I was considering implementation details for the transportation engineering module and given that roadway alignments tend to be long and horizontally aligned, it would be handy to provide two horizontal views: one for the horizontal alignment and one for the vertical alignment

h_v_align.png
h_v_align.png (56.1 KiB) Viewed 1378 times

At present, you can tile views in the Windows menu, which defaults to a side-by-side arrangement. Of course, I'd like it to be a top-bottom arrangement instead. I can do this manually, but the window dimension constraints are too large. On a 1080p display, it means they overlap. Of course, if I narrow or eliminate my Python console, I have all the space I need, but, of course, that doesn't help in development.

freecAD_SCREENSHOT.png
freecAD_SCREENSHOT.png (16.26 KiB) Viewed 1378 times

At a bare minimum, adding a top-bottom tile option to the Windows menu seems like it might be a good idea.

To achieve what I need for now, maybe I can manage it in Python?
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
microelly2
Posts: 4560
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Feature Request: Add horizontal split view

Postby microelly2 » Fri Nov 24, 2017 1:33 pm

This is realy a good idea, I often need this kind of view for landscapes too.
I think, we can do some special window layout setters whcxi can be added to the freecad file
My idea is to have a "Window layout object" which can be clicked to activate,
in this category the quad view/single view macro should occur too.
User avatar
yorik
Site Admin
Posts: 11645
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Feature Request: Add horizontal split view

Postby yorik » Fri Nov 24, 2017 5:56 pm

There is something I often wondered, is if Qt provides a way to arrange MDI views without their title bar, like these tiled window managers on linux... There are many apps out there that do that so it might be possible out of the box, but couldn't find anything...

In this request what would be cool would be that the Y position of the camera stays linked in the two views, so when you move the camera left/right in one of them, the other follows. That might be possible to do with pivy.
User avatar
Kunda1
Posts: 6392
Joined: Thu Jan 05, 2017 9:03 pm

Re: Feature Request: Add horizontal split view

Postby Kunda1 » Fri Nov 24, 2017 11:03 pm

Qt::Window | Qt::FramelessWindowHint
https://stackoverflow.com/questions/423 ... pplication
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
yorik
Site Admin
Posts: 11645
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Feature Request: Add horizontal split view

Postby yorik » Sat Nov 25, 2017 6:58 pm

That's not exactly the same thing, it will just leave a QWidget without its window frame. But it would be cool to really have a tiling system, where you can move the separator between two subwindows.
User avatar
Joel_graff
Posts: 1623
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Feature Request: Add horizontal split view

Postby Joel_graff » Sat Nov 25, 2017 10:11 pm

yorik wrote:
Sat Nov 25, 2017 6:58 pm
But it would be cool to really have a tiling system, where you can move the separator between two subwindows.
I had these same thoughts, but didn't want to push it too far - trying to keep the feature request in the realm of low-hanging fruit. :) A border-snapping feature, though, would be handy, as would having several common layouts pre-defined in the Windows menu - kind of like the way Eclipse and Blender have pre-defined layouts for specific types of work.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
yorik
Site Admin
Posts: 11645
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Feature Request: Add horizontal split view

Postby yorik » Mon Nov 27, 2017 1:26 pm

Apparently this doesn't exist out of the box in qt. But maybe there is something implemented by someone else... Didn't find anything yet, though
User avatar
microelly2
Posts: 4560
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Feature Request: Add horizontal split view

Postby microelly2 » Mon Nov 27, 2017 2:06 pm

yorik wrote:
Mon Nov 27, 2017 1:26 pm
Apparently this doesn't exist out of the box in qt. But maybe there is something implemented by someone else... Didn't find anything yet, though
Learn to play with the widget geometry will be usefull.
having an on the fly configurable widget manager will also be useful for dialog management.
User avatar
Kunda1
Posts: 6392
Joined: Thu Jan 05, 2017 9:03 pm

Re: Feature Request: Add horizontal split view

Postby Kunda1 » Mon Nov 27, 2017 3:25 pm

Perhaps other FOSS projects have implemented something? Like Krita or QGIS ?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
microelly2
Posts: 4560
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Feature Request: Add horizontal split view

Postby microelly2 » Mon Nov 27, 2017 4:07 pm

resizing and moving is not a big deal.
bp_638.png
bp_638.png (28.34 KiB) Viewed 1167 times
Edit: replaced code

Code: Select all



mw=FreeCADGui.getMainWindow()
mdiarea=mw.findChild(QtGui.QMdiArea)

sws=mdiarea.subWindowList()

print mdiarea.geometry()
a=mdiarea.geometry()
l=a.left()
r=a.right()
t=a.top()
b=a.bottom()
h=b-t
ls=len(sws)
hh=h//ls-ls

print "windows ..."
for i,w2 in enumerate(sws):
	print str(w2.windowTitle())
	print ("size",w2.size())
	w2.setGeometry(0,i*hh,r-l,hh)