-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to move around (drag-drop) 4 tabs: Database-Browse-Edit Pragma-Execute SQL #1675
Comments
Pretty sure it's just a legacy thing, from the way the application was first created. No idea personally how hard or easy it would be to change. 😄 |
Hello Justin,
Pretty sure it's just a legacy thing, from the way the application was first created
Yep. It is my hunch too :-)
As regards the other tabs (plot, Sql log, sql schema) you can not only change their position, by dragging-dropping them, but also decide to temporarily remove them from the GUI (through the "Preference" option panel).
I am an old-fashioned guy and I pretty much only work with the Execute SQL tab.
Therefore, I was trying to move this tab in the first position to no avail :-)
|
I can confirm that it's for legacy reasons. In version 2.0 there were only three tabs (DB Structure, Browse Data, Execute SQL) and none of the movable docks. When new features were added, most of the time they were put into separate movable docks. However, that doesn't mean it's super easy to change the current approach. That's because much of the code depends on the four main tabs to be there all the time, i.e. especially making them closable would mean a good amount of work. On the other hand, this would probably improve the overall code quality because it separates the different bits in a stricter way than now. So we might actually want to do that 😄 The main thing I'm worrying about is beginner users who might accidentally close or hide one of the more important tabs then and don't know what option to look for to show it again. Any ideas here? |
Hello Martin,
The main thing I'm worrying about is beginner users who might accidentally close or hide one of the
more important tabs then and don't know what option to look for to show it again. Any ideas here?
Yep. You have a point here. However, we should first agree about what it is "important" as a tab.
For instance, I only work with the Execute SQL and I deem it the only "useful" panel :-)
Joking aside, IMHO, the only minor problem right now is the lack of consistency. In essence, not being able to simply change the position of the 4 uppermost tabs is not consistent with the rest of the GUIs. It is odd having the option to easily change the position, for instance of the Plot tab, while having instead the Execute SQL stuck in its 4° position.
|
We could convert all the tabs to Dock Widgets but disable the Closable feature. With that I think we avoid problems with both users and with our own logic. Users could then move docks, make them floatable. There's a problem, reading the documentation:
We'd have to disable the floatable feature too, at least in MacOS. |
Is it a forced close though? I know nothing about Qt - my background is VB. When you close a form in VB, the form has a 'hey, I'm closing!' event, which you can add code too, including a cancel, which cancels the close event. So, for Qt, maybe it has support for cancelling the close event? |
Yes, it can also be ignored in Qt. So we could theoretically implement the floatable dock feature also in MacOS by ignoring the close event when user presses the close button. |
The movable attribute for the main tabs is enabled and the code is adapted to use widget references instead of indices. This allows user to move tabs and set a preferred order, but the order is still not saved. See issue #1675
I've seen it's relatively easy to allow the user to move the tabs. It only requires an attribute in the tabbed widget and prepare the code for referencing the tab widgets and not their indexes. But saving the order is not automatic like the docks, but I guess won't require much more work. So I think we can go through this path, at least on the short term. They could be made closable if we also like it. Then they could be reactivated through the View menu. @SilvioGrosso The next nightly build will allow you to move the tabs around, but not to save their positions for the next session. I'll take a look to that later. |
Hello @mgrojo Just tested this new option on Windows 10 (64 bit), with the nightly build (DB.Browser.for.SQLite-win64) I can now drag-around any of the 4 uppermost tabs at will. Thanks a a lot! BTW, I also confirm the crashes for the Plot tool (issue 1679) with today's build. Here is a screenshot: |
Main tabs are made closable, so they can be closed by the user. New entries are added to the View menu for toggling their open/closed state. Spartan users can closed all tabs but their preferred, and then the tab bar is hidden saving some space. The set of open tabs and their order is automatically saved in the settings on application exit and restored on application start. Tab labels are stored in the statusTip attribute in order to restore them, since those labels are not stored anywhere else. See issues #1675 and #459
@SilvioGrosso You can now close tabs and save the order/open tabs automaticcally.
They can be restored through the View menu. I hope users will find the way, because I find this is very convenient for advanced users. Do you guys find that in this way users could be lost? There are still two possible improvements:
|
Hello @mgrojo
If I can crack a joke, no matter what you do, there will always be someone "who shoot himself in the foot", as the saying goes :-) Just a hint: maybe it is worthwhile adding some "Restore default" setting, somewhere (Preferencese?) to visualize all closed tabs again. |
Hello @justinclift,
Yep. I know :-) |
Ahhh. Understood. 😄 |
The ordered set of open tabs is saved in the project file using a new element main_tabs with attributes open (ordered list of open tabs like the "MainWindow/openTabs" setting) and current (the current index inside that set). When the project load code finds the old element (current_tab) it falls back to restoring all the main tabs and then setting that tab index as current. In this way, old project files are restored as they were saved, even when the user has closed or moved some tabs. See issue #1675.
- New action (Alt+0) in View menu for resetting window layout (main tabs, toolbars and docks). - Shortcuts for tabs use positional meaning: after moving the tabs, the number always refers to the position of the tab, and not the identity. - Avoid using statusTip for restoring the original tab label and use accesibleName, which is believed to be either neutral, when set, or beneficial. - Assure the tab is open when some function switches to it: browse table and SQLite checks. - Avoid flickering while clearing and adding tabs. See issue #1675
I've implemented the saving of tabs layout in project files, the Reset Window Layout action (bound to Alt+0) and now the shortcuts for tabs (Alt+[1-4]) always select tabs by position. I've noticed an issue in the Reset Window Layout action: the first time it is invoked does not restore the original tab order. I think is some weirdness in Qt. It could be worked around by calling two times to restore the original tab order, but didn't want to commited until knowing if this is something happening with other Qt versions (mine is 5.9.5). |
If there are no settings previously stored for the MainWindow/openTabs, the default empty string was converted to a list of one empty string and consequently all tabs were cleared and none added. This fixes all possible cases where the list of open tabs is empty. It means: do not make changes, as originally designed (since the setting for all tabs closed doesn't make sense). See issue #1692 (and #1675 for the enhancement).
I'll close this, as the main issue has now been resolved. The 'side issues' and improvements can be worked on when the issues count have dropped down to single figures... ;) |
Hello everyone,
Just only out of sheer curiosity...
I am wondering why I can easily change each position of some tabs (e.g. SQL log, plot, schema) as opposed to the 4 the tabs related to: Database Structure, Browse Filter, Edit Pragmas, Execute SQL which are stuck on their fixed position. More precisely, I have tried to change their fixed order (not simply moving some tabs a bit...).
Is it done on purpose or is it simply a feature not implemented for the 4 aforementioned tabs?
I have tested this behaviour both on Linux (kde desktop) - Windows 10 with different QT and Db Browser versions.
Here is a screenshot on Windows 10 (latest beta build) where I drag and drop the Plot tab:
Sorry for asking such trifles questions :-)
The text was updated successfully, but these errors were encountered: