missing feature to move tabs with opened files

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!
Post Reply
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

missing feature to move tabs with opened files

Post by uwestoehr »

- open several different files in FC 0.18
- for a better workflow in different designing stages you might for example move the file you opened the last (which is therefore the rightmost tab) to the leftmost tab position.
-> The problem is that you cannot move tabs in general. Qt however, allows this.

I stumbled over this several times now because I use this feature a lot in different programs (LibreOffice to move table tabs, Firefox to move website tabs etc.).

Thus I think it would be a nice and most probably easy to implement feature. Do you agree?
I searched for this feature but since I could not find it yet, I would open a feature request in the tracker.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: missing feature to move tabs with opened files

Post by vocx »

uwestoehr wrote: Sun May 12, 2019 4:11 pm - open several different files in FC 0.18
...
-> The problem is that you cannot move tabs in general. Qt however, allows this.
...
This was requested before. See issue #3648.

Essentially, you need to hack the code of src/Gui/MainWindow.cpp, and see how to fix this by playing with QMainWindow, or QTabWidget, or whatever. It doesn't seem to be particularly difficult to do, but somebody needs to sit down and do it, and make sure nothing major breaks. Since this isn't a critical problem, nobody has dedicated the time to change the way the Main Window works.

See this thread post for a quick example implementation.

Also, yes, you could organize the tabs however you want, but I would prefer to limit the re-organization to the tabs that belong only to one particular file. This would be a bit more complicated, I think.

Example

Code: Select all

                                             boundary                         boundary
                                                    |                                |
----------------------------------------------------v--------------------------------v--------------
|Tab1: File1 | Tab2: File1_view | Tab3: File1_view2 | Tab4: File2 | Tab5: File2_view | Tab6: File3 |
----------------------------------------------------------------------------------------------------
In this case, Tab2 and Tab3 are TechDraw pages, or Spreadsheets, or whatever other objects that belong to File1. I would like to reorganize these tabs only inside its own group, and not allow them to cross the boundary between File1 and File2, and File2 and File3, that'd be messy.

For example, moving Tab2 between Tab4 and Tab5 would make it seem that File1_view belongs to File2, when in reality it belongs to File1.

Another thing that would make sense would be to use nested tabbed windows; the first one would hold the main files, and a nested window would hold the tabs for objects, views, spreadsheets, etc.

Code: Select all

                               boundary           boundary
                                      |                  |
--------------------------------------v------------------v--------------
|Tab2: File1_view | Tab3: File1_view2 | Tab5: File2_view |
|Tab1: File1                          | Tab4: File2      | Tab6: File3 |
-------------------------------------------------------------------------
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: missing feature to move tabs with opened files

Post by uwestoehr »

vocx wrote: Sun May 12, 2019 5:02 pm This was requested before. See issue #3648.
Thanks vocx. I could bet that someone must have requested this too but did not find this.
I see the challenges of the implementation and cannot help right now. I planned to get more familiar with the FC code but due to lack of time I could not have a deeper look.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: missing feature to move tabs with opened files

Post by triplus »

It should be possible to move tabs now:

https://github.com/FreeCAD/FreeCAD/pull/2273
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: missing feature to move tabs with opened files

Post by uwestoehr »

Many thanks triplus. That was the simple solution I had in mind. But vocx's note is important as well.
I think the file name in the tabs should make clear to which file e.g. a spreadsheet tab belongs to.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: missing feature to move tabs with opened files

Post by triplus »

uwestoehr wrote: Wed Jun 19, 2019 10:56 pm Many thanks triplus. That was the simple solution I had in mind.
You're welcome.
But vocx's note is important as well.
I think the file name in the tabs should make clear to which file e.g. a spreadsheet tab belongs to.
The basic idea behind this thread and issue #3648 makes sense to me. People are confronted with all sort of (document) tabs during the FreeCAD session. In general, people being able to move tabs, that does make sense to me. And therefore possible now.

As for some more complex tab management done automatically by FreeCAD. I don't plan to work on that and don't have a strong opinion on it. That is if somebody else would like to implement something like that. Taking a quick look i guess the suggested PartName_Spreadsheet formatting suggestion is not all that human readable approach. In addition with more tab text the tab itself gets bigger. People that do want to use such formatting can do that manually. By for example renaming the spreadsheet item in the tree view. New name should be reflected in the tab text.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: missing feature to move tabs with opened files

Post by uwestoehr »

triplus wrote: Thu Jun 20, 2019 8:14 pm The basic idea behind this thread and issue #3648 makes sense to me. People are confronted with all sort of (document) tabs during the FreeCAD session. In general, people being able to move tabs, that does make sense to me. And therefore possible now.
I agree.

triplus wrote: Thu Jun 20, 2019 8:14 pm As for some more complex tab management done automatically by FreeCAD. I don't plan to work on that and don't have a strong opinion on it.
I think rather than using a special name a solution would be to bundle the spreadsheet tab to its model tab. So if you have e.g. 2 models open and you move the tab of model 1 to the rightmost position, its spreadsheet tab will keep its position right of the model tab and therefore it will also be moved to the rightmost position. So

Model 1 | Spreadsheet 1 | Model 2 | Spreadsheet 2
becomes after the movement
Model 2 | Spreadsheet 2 | Model 1 | Spreadsheet 1

This should work in every case. it only fixes the position of a spreadsheet tab right to its connected model tab.
chrisb
Veteran
Posts: 53924
Joined: Tue Mar 17, 2015 9:14 am

Re: missing feature to move tabs with opened files

Post by chrisb »

As the tabs can be rearranged by the user why not just leaving the order to them?
uwestoehr wrote: Fri Jun 21, 2019 12:57 am Model 2 | Spreadsheet 2 | Model 1 | Spreadsheet 1
This sure is most sensible in many cases, but it may not always be the best. I can well imagine situations where I want to have all documents in one block, pages in the next and spreadsheets in another. So I would like to see the tabs either left without any predefined order or at least to have a parameter to switch between different strategies, one of them being "freee order".
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: missing feature to move tabs with opened files

Post by uwestoehr »

chrisb wrote: Fri Jun 21, 2019 5:04 am This sure is most sensible in many cases, but it may not always be the best. I can well imagine situations where I want to have all documents in one block, pages in the next and spreadsheets in another.
Hmm, I cannot imagine a real-life use case where this would be helpful as long as the spreadsheet tabs have nothing in their name to be able to know to what model tab they belong to.
chrisb
Veteran
Posts: 53924
Joined: Tue Mar 17, 2015 9:14 am

Re: missing feature to move tabs with opened files

Post by chrisb »

A distinction would indeed be very helpful.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply