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!
User avatar
uwestoehr
Posts: 690
Joined: Sun Jan 27, 2019 3:21 am

missing feature to move tabs with opened files

Postby uwestoehr » Sun May 12, 2019 4:11 pm

- 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
Posts: 1386
Joined: Thu Oct 18, 2018 9:18 pm

Re: missing feature to move tabs with opened files

Postby vocx » Sun May 12, 2019 5:02 pm

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 |
-------------------------------------------------------------------------
User avatar
uwestoehr
Posts: 690
Joined: Sun Jan 27, 2019 3:21 am

Re: missing feature to move tabs with opened files

Postby uwestoehr » Sun May 12, 2019 9:20 pm

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
Posts: 8667
Joined: Mon Dec 12, 2011 4:45 pm

Re: missing feature to move tabs with opened files

Postby triplus » Wed Jun 19, 2019 9:12 pm

It should be possible to move tabs now:

https://github.com/FreeCAD/FreeCAD/pull/2273
User avatar
uwestoehr
Posts: 690
Joined: Sun Jan 27, 2019 3:21 am

Re: missing feature to move tabs with opened files

Postby uwestoehr » Wed Jun 19, 2019 10:56 pm

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
Posts: 8667
Joined: Mon Dec 12, 2011 4:45 pm

Re: missing feature to move tabs with opened files

Postby triplus » Thu Jun 20, 2019 8:14 pm

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
Posts: 690
Joined: Sun Jan 27, 2019 3:21 am

Re: missing feature to move tabs with opened files

Postby uwestoehr » Fri Jun 21, 2019 12:57 am

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
Posts: 17993
Joined: Tue Mar 17, 2015 9:14 am

Re: missing feature to move tabs with opened files

Postby chrisb » Fri Jun 21, 2019 5:04 am

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".
User avatar
uwestoehr
Posts: 690
Joined: Sun Jan 27, 2019 3:21 am

Re: missing feature to move tabs with opened files

Postby uwestoehr » Fri Jun 21, 2019 12:48 pm

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
Posts: 17993
Joined: Tue Mar 17, 2015 9:14 am

Re: missing feature to move tabs with opened files

Postby chrisb » Sat Jun 22, 2019 1:01 am

A distinction would indeed be very helpful.