Skip to content

WidgetActionItem widgets not respecting size hints #82

@gselzer

Description

@gselzer

Ideally, if a widget declares a minimum size, the dock widget it is added to would not be able to shrink beyond that size. Confusingly, the dock widget has its minimum size set based on the widget it encloses (although we may want to change that to a maximum operation when multiple tabs have minimum sizes? Not sure), so I'm not sure if I'm misunderstanding what that method does...

Here's an MCVE, adapted from #71:

from PyQt6.QtWidgets import QWidget

from pymmcore_gui import create_mmgui
from pymmcore_gui.actions import WidgetActionInfo


def create_my_widget(parent: QWidget) -> QWidget:
    wdg = QWidget(parent)
    wdg.setMinimumWidth(600)
    wdg.setMinimumHeight(600)
    wdg.setStyleSheet("background-color: lightblue;")
    return wdg

WidgetActionInfo(
    key="mywidget",
    text="My Widget!!!!",
    icon="mdi-light:format-list-bulleted",
    create_widget=create_my_widget,
)
create_mmgui()
tiny_widget.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions