1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
#------------------------------------------------------------------------------
# Copyright (c) 2013-2025, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#------------------------------------------------------------------------------
from enaml.core.include import Include
from enaml.widgets.main_window import MainWindow
from enaml.widgets.menu_bar import MenuBar
from enaml.workbench.workbench import Workbench
from .window_model import WindowModel
def make_title(primary, workspace):
return ' - '.join(filter(None, (primary, workspace)))
enamldef WorkbenchWindow(MainWindow):
""" The custom MainWindow enamldef used by the Enaml studio.
"""
attr workbench: Workbench
attr window_model: WindowModel
title << make_title(
window_model.branding.title,
window_model.workspace.window_title,
)
icon << window_model.branding.icon
MenuBar:
Include:
objects << window_model.menus
Include:
objects << [w for w in [window_model.workspace.content] if w]
|