I’m working on a project that needs lots of toolbars on screen at once, even though not all of them will be used at the same time. So, I’m modelling this ‘foldable’ dock widget after what I remember Photoshop panels used to be like.

It’s a work in progress, but would like to hear constructive suggestions.

https://blocks.programming.dev/0101100101/42c5d67f86c049baa3500aa38e439f8a

  • ulterno@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    15 hours ago

    Nice.

    Depending upon what you are aiming for, I’d go with a sidebar. Something like this:

    Illustrating the idea of widgets in a sidebar

    • (a) The sidebar’s horizontal width can be changed, causing all docked widgets in it to resize their width to fit.
    • (b) The docked widgets/sections may resize vertically, either automatically or manually
      • In case of manual resizing of widgets, you might want to add a scroll area in the widget
    • (c) A widget/section may leave empty area in the bottom or vertically expand to fill
    • (d) In case of empty area, the sidebar can either have empty space or be vertically shortened to expose part of the workspace underneath
    • (e) Instead of having just a single widget, you can have a section on the toolbar, with multiple widgets in it. In this case, when the user changes the tab, the section will either automatically resize (vertically) as per widget requirements, or will stay the size that the user set manually, adding a scrollbar in case of overflow or empty area in case of lack of widget content.

    This is in contrast to usual sidebars that tend to have a main tab bar, which only allows for a single docked widget to be shown at a time. This will allow the user to stack widgets both vertically and horizontally as per their requirements. A similar example can be seen in the right side panel in the Design Mode of Qt Creator itself.
    Folded widgets/sections, when docked, will yield vertical space to other widgets/sections, which will in turn, snap upwards (or you can do downwards if that’s your fancy)

    Maybe you can also make the floating widgets mergeable into tabs, which will reduce the number of point+click actions in cases where only 1 of 2 widgets is being used.


    CC BY-NC-SA 4.0

    • 0101100101@programming.devOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      15 hours ago

      Qt automatically handles the conversion of QDockWidgets into tabbed docked widgets when one is dragged over an existing one.

      I have a little demo video, but I have no idea where to upload it to!

      • ulterno@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        15 hours ago

        Oh! You actually used QDockWidget instead of making it from the start. I should have read the code before commenting, I guess.