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

  • @[email protected]
    link
    fedilink
    1
    edit-2
    1 day ago
    from PySide6.QtWidgets import QDockWidget, QWidget, QToolButton, QStyle, QHBoxLayout, QStyleFactory, QSizePolicy, \
        QApplication, QVBoxLayout, QLabel, QSlider, QMainWindow, QSizeGrip
    

    No code should be more than 80 characters UNLESS it’s unavoidable like with a long regex. Hard limit is normally 88 characters.

    Should be

    from PySide6.QtWidgets import (
        QDockWidget,
        QWidget,
        QToolButton,
        QStyle,
        QHBoxLayout,
        QStyleFactory,
        QSizePolicy,
        QApplication,
        QVBoxLayout,
        QLabel,
        QSlider,
        QMainWindow,
        QSizeGrip,
    )
    

    Or add parenthesis and the last comma. black will reformat it. Then use isort to fix imports ordering.

    Get that you are sharing this as a gist. Normally code like this is broken up into multiple modules so it’s easier on the eyes and less going on.