Skip to content

Commit

Permalink
Make Design view non-closable and non-floatable (#2981)
Browse files Browse the repository at this point in the history
  • Loading branch information
soininen authored Oct 11, 2024
2 parents bdaac28 + cf275a7 commit 7daf5be
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 57 deletions.
83 changes: 42 additions & 41 deletions spinetoolbox/ui/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
################################################################################
## Form generated from reading UI file 'mainwindow.ui'
##
## Created by: Qt User Interface Compiler version 6.7.2
## Created by: Qt User Interface Compiler version 6.6.3
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
Expand Down Expand Up @@ -46,39 +46,39 @@ def setupUi(self, MainWindow):
self.actionQuit = QAction(MainWindow)
self.actionQuit.setObjectName(u"actionQuit")
icon = QIcon()
icon.addFile(u":/icons/menu_icons/window-close.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon.addFile(u":/icons/menu_icons/window-close.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionQuit.setIcon(icon)
self.actionDocumentation = QAction(MainWindow)
self.actionDocumentation.setObjectName(u"actionDocumentation")
self.actionAbout = QAction(MainWindow)
self.actionAbout.setObjectName(u"actionAbout")
icon1 = QIcon()
icon1.addFile(u":/icons/menu_icons/info-circle.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon1.addFile(u":/icons/menu_icons/info-circle.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionAbout.setIcon(icon1)
self.actionSave = QAction(MainWindow)
self.actionSave.setObjectName(u"actionSave")
icon2 = QIcon()
icon2.addFile(u":/icons/menu_icons/save_solid.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon2.addFile(u":/icons/menu_icons/save_solid.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionSave.setIcon(icon2)
self.actionSave_As = QAction(MainWindow)
self.actionSave_As.setObjectName(u"actionSave_As")
icon3 = QIcon()
icon3.addFile(u":/icons/menu_icons/save_regular.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon3.addFile(u":/icons/menu_icons/save_regular.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionSave_As.setIcon(icon3)
self.actionOpen = QAction(MainWindow)
self.actionOpen.setObjectName(u"actionOpen")
icon4 = QIcon()
icon4.addFile(u":/icons/menu_icons/folder-open-solid.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon4.addFile(u":/icons/menu_icons/folder-open-solid.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionOpen.setIcon(icon4)
self.actionNew = QAction(MainWindow)
self.actionNew.setObjectName(u"actionNew")
icon5 = QIcon()
icon5.addFile(u":/icons/menu_icons/file.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon5.addFile(u":/icons/menu_icons/file.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionNew.setIcon(icon5)
self.actionSettings = QAction(MainWindow)
self.actionSettings.setObjectName(u"actionSettings")
icon6 = QIcon()
icon6.addFile(u":/icons/menu_icons/cog.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon6.addFile(u":/icons/menu_icons/cog.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionSettings.setIcon(icon6)
self.actionItem_Toolbar = QAction(MainWindow)
self.actionItem_Toolbar.setObjectName(u"actionItem_Toolbar")
Expand All @@ -97,27 +97,27 @@ def setupUi(self, MainWindow):
self.actionUser_Guide = QAction(MainWindow)
self.actionUser_Guide.setObjectName(u"actionUser_Guide")
icon7 = QIcon()
icon7.addFile(u":/icons/menu_icons/question-circle.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon7.addFile(u":/icons/menu_icons/question-circle.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionUser_Guide.setIcon(icon7)
self.actionRestore_Dock_Widgets = QAction(MainWindow)
self.actionRestore_Dock_Widgets.setObjectName(u"actionRestore_Dock_Widgets")
self.actionAbout_Qt = QAction(MainWindow)
self.actionAbout_Qt.setObjectName(u"actionAbout_Qt")
icon8 = QIcon()
icon8.addFile(u":/icons/qt_extended_48x48.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon8.addFile(u":/icons/qt_extended_48x48.png", QSize(), QIcon.Normal, QIcon.Off)
self.actionAbout_Qt.setIcon(icon8)
self.actionRemove_all = QAction(MainWindow)
self.actionRemove_all.setObjectName(u"actionRemove_all")
icon9 = QIcon()
icon9.addFile(u":/icons/menu_icons/trash-alt.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon9.addFile(u":/icons/menu_icons/trash-alt.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionRemove_all.setIcon(icon9)
self.actionGetting_started = QAction(MainWindow)
self.actionGetting_started.setObjectName(u"actionGetting_started")
self.actionGetting_started.setIcon(icon7)
self.actionOpen_recent = QAction(MainWindow)
self.actionOpen_recent.setObjectName(u"actionOpen_recent")
icon10 = QIcon()
icon10.addFile(u":/icons/menu_icons/history.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon10.addFile(u":/icons/menu_icons/history.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionOpen_recent.setIcon(icon10)
self.actionCopy = QAction(MainWindow)
self.actionCopy.setObjectName(u"actionCopy")
Expand All @@ -139,7 +139,7 @@ def setupUi(self, MainWindow):
self.actionNew_DB_editor = QAction(MainWindow)
self.actionNew_DB_editor.setObjectName(u"actionNew_DB_editor")
icon11 = QIcon()
icon11.addFile(u":/icons/database-edit.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon11.addFile(u":/icons/database-edit.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionNew_DB_editor.setIcon(icon11)
self.actionPasteAndDuplicateFiles = QAction(MainWindow)
self.actionPasteAndDuplicateFiles.setObjectName(u"actionPasteAndDuplicateFiles")
Expand All @@ -156,27 +156,27 @@ def setupUi(self, MainWindow):
self.actionClose = QAction(MainWindow)
self.actionClose.setObjectName(u"actionClose")
icon12 = QIcon()
icon12.addFile(u":/icons/menu_icons/door-closed.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon12.addFile(u":/icons/menu_icons/door-closed.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionClose.setIcon(icon12)
self.actionSet_description = QAction(MainWindow)
self.actionSet_description.setObjectName(u"actionSet_description")
icon13 = QIcon()
icon13.addFile(u":/icons/menu_icons/exchange-alt.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon13.addFile(u":/icons/menu_icons/exchange-alt.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionSet_description.setIcon(icon13)
self.actionExecute_project = QAction(MainWindow)
self.actionExecute_project.setObjectName(u"actionExecute_project")
icon14 = QIcon()
icon14.addFile(u":/icons/menu_icons/play-circle-solid.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon14.addFile(u":/icons/menu_icons/play-circle-solid.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionExecute_project.setIcon(icon14)
self.actionExecute_selection = QAction(MainWindow)
self.actionExecute_selection.setObjectName(u"actionExecute_selection")
icon15 = QIcon()
icon15.addFile(u":/icons/menu_icons/play-circle-regular.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon15.addFile(u":/icons/menu_icons/play-circle-regular.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionExecute_selection.setIcon(icon15)
self.actionStop_execution = QAction(MainWindow)
self.actionStop_execution.setObjectName(u"actionStop_execution")
icon16 = QIcon()
icon16.addFile(u":/icons/menu_icons/stop-circle-regular.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon16.addFile(u":/icons/menu_icons/stop-circle-regular.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionStop_execution.setIcon(icon16)
self.actionTake_link = QAction(MainWindow)
self.actionTake_link.setObjectName(u"actionTake_link")
Expand All @@ -185,19 +185,19 @@ def setupUi(self, MainWindow):
self.actionStart_jupyter_console = QAction(MainWindow)
self.actionStart_jupyter_console.setObjectName(u"actionStart_jupyter_console")
icon17 = QIcon()
icon17.addFile(u":/icons/desktop.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon17.addFile(u":/icons/desktop.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionStart_jupyter_console.setIcon(icon17)
self.actionGitHub = QAction(MainWindow)
self.actionGitHub.setObjectName(u"actionGitHub")
icon18 = QIcon()
icon18.addFile(u":/icons/menu_icons/github-mark.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon18.addFile(u":/icons/menu_icons/github-mark.svg", QSize(), QIcon.Normal, QIcon.Off)
self.actionGitHub.setIcon(icon18)
self.centralwidget = QWidget(MainWindow)
self.centralwidget.setObjectName(u"centralwidget")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QMenuBar(MainWindow)
self.menubar.setObjectName(u"menubar")
self.menubar.setGeometry(QRect(0, 0, 1006, 33))
self.menubar.setGeometry(QRect(0, 0, 1006, 22))
self.menubar.setNativeMenuBar(False)
self.menuFile = QMenu(self.menubar)
self.menuFile.setObjectName(u"menuFile")
Expand Down Expand Up @@ -230,7 +230,7 @@ def setupUi(self, MainWindow):
sizePolicy.setHeightForWidth(self.dockWidget_eventlog.sizePolicy().hasHeightForWidth())
self.dockWidget_eventlog.setSizePolicy(sizePolicy)
self.dockWidget_eventlog.setMinimumSize(QSize(174, 184))
self.dockWidget_eventlog.setFeatures(QDockWidget.DockWidgetFeature.DockWidgetClosable|QDockWidget.DockWidgetFeature.DockWidgetFloatable|QDockWidget.DockWidgetFeature.DockWidgetMovable)
self.dockWidget_eventlog.setFeatures(QDockWidget.DockWidgetClosable|QDockWidget.DockWidgetFloatable|QDockWidget.DockWidgetMovable)
self.dockWidgetContents = QWidget()
self.dockWidgetContents.setObjectName(u"dockWidgetContents")
sizePolicy1 = QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
Expand All @@ -249,26 +249,26 @@ def setupUi(self, MainWindow):
self.textBrowser_eventlog.setObjectName(u"textBrowser_eventlog")
sizePolicy.setHeightForWidth(self.textBrowser_eventlog.sizePolicy().hasHeightForWidth())
self.textBrowser_eventlog.setSizePolicy(sizePolicy)
self.textBrowser_eventlog.setContextMenuPolicy(Qt.ContextMenuPolicy.DefaultContextMenu)
self.textBrowser_eventlog.setContextMenuPolicy(Qt.DefaultContextMenu)
self.textBrowser_eventlog.setOpenLinks(False)

self.verticalLayout_7.addWidget(self.textBrowser_eventlog)

self.toolButton_executions = QToolButton(self.dockWidgetContents)
self.toolButton_executions.setObjectName(u"toolButton_executions")
icon19 = QIcon()
icon19.addFile(u":/icons/check-circle.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
icon19.addFile(u":/icons/check-circle.svg", QSize(), QIcon.Normal, QIcon.Off)
self.toolButton_executions.setIcon(icon19)
self.toolButton_executions.setPopupMode(QToolButton.ToolButtonPopupMode.InstantPopup)
self.toolButton_executions.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextBesideIcon)
self.toolButton_executions.setPopupMode(QToolButton.InstantPopup)
self.toolButton_executions.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)

self.verticalLayout_7.addWidget(self.toolButton_executions)


self.verticalLayout_5.addLayout(self.verticalLayout_7)

self.dockWidget_eventlog.setWidget(self.dockWidgetContents)
MainWindow.addDockWidget(Qt.DockWidgetArea.BottomDockWidgetArea, self.dockWidget_eventlog)
MainWindow.addDockWidget(Qt.BottomDockWidgetArea, self.dockWidget_eventlog)
self.dockWidget_item = QDockWidget(MainWindow)
self.dockWidget_item.setObjectName(u"dockWidget_item")
self.dockWidget_item.setMinimumSize(QSize(356, 293))
Expand All @@ -288,7 +288,7 @@ def setupUi(self, MainWindow):
self.verticalLayout_14.setContentsMargins(6, 6, 6, 6)
self.label_no_selection = QLabel(self.tab_no_selection)
self.label_no_selection.setObjectName(u"label_no_selection")
self.label_no_selection.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.label_no_selection.setAlignment(Qt.AlignCenter)
self.label_no_selection.setWordWrap(True)

self.verticalLayout_14.addWidget(self.label_no_selection)
Expand All @@ -298,7 +298,7 @@ def setupUi(self, MainWindow):
self.verticalLayout.addWidget(self.tabWidget_item_properties)

self.dockWidget_item.setWidget(self.dockWidgetContents_3)
MainWindow.addDockWidget(Qt.DockWidgetArea.TopDockWidgetArea, self.dockWidget_item)
MainWindow.addDockWidget(Qt.TopDockWidgetArea, self.dockWidget_item)
self.dockWidget_console = QDockWidget(MainWindow)
self.dockWidget_console.setObjectName(u"dockWidget_console")
self.dockWidget_console.setFloating(False)
Expand All @@ -310,7 +310,7 @@ def setupUi(self, MainWindow):
self.verticalLayout_6.setContentsMargins(0, 0, 0, 0)
self.splitter_console = QSplitter(self.dockWidgetContents_console)
self.splitter_console.setObjectName(u"splitter_console")
self.splitter_console.setOrientation(Qt.Orientation.Vertical)
self.splitter_console.setOrientation(Qt.Vertical)
self.splitter_console.setChildrenCollapsible(False)
self.listView_console_executions = QTreeView(self.splitter_console)
self.listView_console_executions.setObjectName(u"listView_console_executions")
Expand All @@ -322,17 +322,18 @@ def setupUi(self, MainWindow):
self.splitter_console.addWidget(self.listView_console_executions)
self.label_no_console = QLabel(self.splitter_console)
self.label_no_console.setObjectName(u"label_no_console")
self.label_no_console.setContextMenuPolicy(Qt.ContextMenuPolicy.DefaultContextMenu)
self.label_no_console.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.label_no_console.setContextMenuPolicy(Qt.DefaultContextMenu)
self.label_no_console.setAlignment(Qt.AlignCenter)
self.label_no_console.setWordWrap(True)
self.splitter_console.addWidget(self.label_no_console)

self.verticalLayout_6.addWidget(self.splitter_console)

self.dockWidget_console.setWidget(self.dockWidgetContents_console)
MainWindow.addDockWidget(Qt.DockWidgetArea.BottomDockWidgetArea, self.dockWidget_console)
MainWindow.addDockWidget(Qt.BottomDockWidgetArea, self.dockWidget_console)
self.dockWidget_design_view = QDockWidget(MainWindow)
self.dockWidget_design_view.setObjectName(u"dockWidget_design_view")
self.dockWidget_design_view.setFeatures(QDockWidget.DockWidgetMovable)
self.dockWidgetContents_5 = QWidget()
self.dockWidgetContents_5.setObjectName(u"dockWidgetContents_5")
self.verticalLayout_2 = QVBoxLayout(self.dockWidgetContents_5)
Expand All @@ -341,18 +342,18 @@ def setupUi(self, MainWindow):
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
self.graphicsView = DesignQGraphicsView(self.dockWidgetContents_5)
self.graphicsView.setObjectName(u"graphicsView")
self.graphicsView.setFrameShape(QFrame.Shape.NoFrame)
self.graphicsView.setFrameShadow(QFrame.Shadow.Raised)
self.graphicsView.setRenderHints(QPainter.RenderHint.Antialiasing|QPainter.RenderHint.TextAntialiasing)
self.graphicsView.setDragMode(QGraphicsView.DragMode.RubberBandDrag)
self.graphicsView.setResizeAnchor(QGraphicsView.ViewportAnchor.AnchorUnderMouse)
self.graphicsView.setViewportUpdateMode(QGraphicsView.ViewportUpdateMode.FullViewportUpdate)
self.graphicsView.setRubberBandSelectionMode(Qt.ItemSelectionMode.ContainsItemBoundingRect)
self.graphicsView.setFrameShape(QFrame.NoFrame)
self.graphicsView.setFrameShadow(QFrame.Raised)
self.graphicsView.setRenderHints(QPainter.Antialiasing|QPainter.TextAntialiasing)
self.graphicsView.setDragMode(QGraphicsView.RubberBandDrag)
self.graphicsView.setResizeAnchor(QGraphicsView.AnchorUnderMouse)
self.graphicsView.setViewportUpdateMode(QGraphicsView.FullViewportUpdate)
self.graphicsView.setRubberBandSelectionMode(Qt.ContainsItemBoundingRect)

self.verticalLayout_2.addWidget(self.graphicsView)

self.dockWidget_design_view.setWidget(self.dockWidgetContents_5)
MainWindow.addDockWidget(Qt.DockWidgetArea.TopDockWidgetArea, self.dockWidget_design_view)
MainWindow.addDockWidget(Qt.TopDockWidgetArea, self.dockWidget_design_view)
QWidget.setTabOrder(self.graphicsView, self.textBrowser_eventlog)
QWidget.setTabOrder(self.textBrowser_eventlog, self.listView_console_executions)
QWidget.setTabOrder(self.listView_console_executions, self.toolButton_executions)
Expand Down
Loading

0 comments on commit 7daf5be

Please sign in to comment.