Skip to content

window_menu

window_menu

Classes

WindowMenu(main_window, title='&Window', parent=None)

Bases: BaseMenu

Window menu with the visibility toggles of the dock widgets.

Initialize WindowMenu.

Parameters:

Name Type Description Default
main_window NyxEditorMainWindow

editor main window.

required
title str

menu title.

'&Window'
parent QWidget | None

parent widget.

None
Source code in src/nyx/editor/widgets/menubar_menus/window_menu.py
13
14
15
16
17
18
19
20
21
22
23
def __init__(
    self, main_window: NyxEditorMainWindow, title: str = "&Window", parent=None
):
    """Initialize WindowMenu.

    Args:
        main_window (NyxEditorMainWindow): editor main window.
        title (str): menu title.
        parent (QtWidgets.QWidget | None): parent widget.
    """
    super().__init__(main_window, title, parent)
Functions
populate()

Add a toggle action per dock widget.

Source code in src/nyx/editor/widgets/menubar_menus/window_menu.py
25
26
27
28
29
def populate(self):
    """Add a toggle action per dock widget."""
    self.addSection("Visibility")
    for dock_widget in self.main_window.dock_widgets:
        self.addAction(dock_widget.toggleViewAction())