Skip to content

Unable to move around (drag-drop) 4 tabs: Database-Browse-Edit Pragma-Execute SQL #1675

Closed

Description

@SilvioGrosso

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:
drag_drop tabs png

Sorry for asking such trifles questions :-)

Activity

  1. justinclift commented on Dec 20, 2018

    @justinclift
    Member

    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. 😄

  2. SilvioGrosso commented on Dec 20, 2018

    @SilvioGrosso
    Author
  3. MKleusberg commented on Dec 20, 2018

    @MKleusberg
    Member

    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?

  4. SilvioGrosso commented on Dec 20, 2018

    @SilvioGrosso
    Author
  5. mgrojo commented on Dec 20, 2018

    @mgrojo
    Member

    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:

    Constant Value Description
    QDockWidget::DockWidgetClosable 0x01 The dock widget can be closed. On some systems the dock widget always has a close button when it's floating (for example on MacOS 10.5).

    We'd have to disable the floatable feature too, at least in MacOS.

  6. chrisjlocke commented on Dec 21, 2018

    @chrisjlocke
    Member

    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?

  7. mgrojo commented on Dec 21, 2018

    @mgrojo
    Member

    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.

  8. self-assigned this
    on Dec 23, 2018
  9. mgrojo commented on Dec 24, 2018

    @mgrojo
    Member

    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.

  10. SilvioGrosso commented on Dec 24, 2018

    @SilvioGrosso
    Author

    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:

    move_tabs png

  11. mgrojo commented on Dec 25, 2018

    @mgrojo
    Member

    @SilvioGrosso You can now close tabs and save the order/open tabs automaticcally.

    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?

    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:

    • Saving the open tabs / order in the project files (they currently save the current tab and that might now interfere with the new setting). I think if we save both, then it will make sense again (except for old project files, if user has previously changed the tabs too, unless we restore the default layout for old files - those lacking the new setting).
    • Deciding about the Alt+[1-4]. See discussion started in 73f7cc8
  12. SilvioGrosso commented on Dec 25, 2018

    @SilvioGrosso
    Author

    Hello @mgrojo

    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?

    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 :-)
    Usually, to avoid this problem, you need to write everything down in the documentation (wiki etc) but, again, it is a well proven fact that most casual users don't read the documentation either: they consider it "boring" :-)

    Just a hint: maybe it is worthwhile adding some "Restore default" setting, somewhere (Preferencese?) to visualize all closed tabs again.

  13. justinclift commented on Dec 25, 2018

    @justinclift
    Member

    Just a hint: maybe it is worthwhile adding some "Restore default" setting, somewhere (Preferencese?) to visualize all closed tabs again.

    It's in the bottom left corner of the Preferences dialog:

    db4s_preference_setting

  14. SilvioGrosso commented on Dec 25, 2018

    @SilvioGrosso
    Author

    Hello @justinclift,

    It's in the bottom left corner of the Preferences dialog

    Yep. I know :-)
    But currently, whenever you press this button it doesn't restore the tabs in the GUIs (e.g. their "natural" fiexed order for the 4 uppermost tabs).
    In essence, If I drag the "Execute SQL" tab in the first position and then I press the button "Restore defaults", this tab (Execute) is not moved to its fourth old position (which is its "classical" position).

  15. justinclift commented on Dec 25, 2018

    @justinclift
    Member

    Ahhh. Understood. 😄

  16. mgrojo commented on Dec 26, 2018

    @mgrojo
    Member

    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).

  17. chrisjlocke commented on Jan 14, 2019

    @chrisjlocke
    Member

    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... ;)
    Thanks for implementing this @mgrojo 💓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions