Basic document handling

This commit is contained in:
2026-07-19 21:26:27 +02:00
parent c5ab3329ae
commit 76bd313f79
32 changed files with 4843 additions and 67 deletions

View File

@@ -94,19 +94,91 @@
</layout>
</widget>
</widget>
<widget class="QDockWidget" name="panel_document">
<property name="minimumSize">
<size><width>220</width><height>91</height></size>
</property>
<property name="windowTitle"><string>Document</string></property>
<attribute name="dockWidgetArea"><number>1</number></attribute>
<widget class="QWidget" name="documentDockContents">
<layout class="QVBoxLayout" name="documentPanelLayout">
<property name="spacing"><number>0</number></property>
<property name="leftMargin"><number>0</number></property>
<property name="topMargin"><number>0</number></property>
<property name="rightMargin"><number>0</number></property>
<property name="bottomMargin"><number>0</number></property>
<item>
<widget class="QTreeView" name="documentTreeView">
<property name="alternatingRowColors"><bool>true</bool></property>
<property name="uniformRowHeights"><bool>true</bool></property>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
<widget class="QWidget" name="workspace" native="true">
<widget class="QWidget" name="workspace">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">QWidget#workspace {
background-color: rgb(198, 198, 198);
}</string>
</property>
<layout class="QVBoxLayout" name="workspaceEditorLayout">
<property name="spacing"><number>0</number></property>
<property name="leftMargin"><number>0</number></property>
<property name="topMargin"><number>0</number></property>
<property name="rightMargin"><number>0</number></property>
<property name="bottomMargin"><number>0</number></property>
<item>
<widget class="QFrame" name="workspaceHeader">
<property name="minimumSize"><size><width>0</width><height>34</height></size></property>
<property name="maximumSize"><size><width>16777215</width><height>34</height></size></property>
<property name="frameShape"><enum>QFrame::Shape::StyledPanel</enum></property>
<layout class="QHBoxLayout" name="workspaceHeaderLayout">
<property name="leftMargin"><number>6</number></property>
<property name="topMargin"><number>2</number></property>
<property name="rightMargin"><number>6</number></property>
<property name="bottomMargin"><number>2</number></property>
<item><widget class="QToolButton" name="navigateUpButton"><property name="text"><string>Up</string></property><property name="toolTip"><string>Open the containing graph</string></property></widget></item>
<item><widget class="QLabel" name="graphBreadcrumbLabel"><property name="text"><string>Untitled</string></property></widget></item>
<item><widget class="QLabel" name="workspaceModeLabel"><property name="text"><string>Graph</string></property></widget></item>
<item><spacer name="workspaceHeaderSpacer"><property name="orientation"><enum>Qt::Orientation::Horizontal</enum></property><property name="sizeHint" stdset="0"><size><width>40</width><height>20</height></size></property></spacer></item>
<item><widget class="QPushButton" name="applyJsonButton"><property name="text"><string>Apply JSON</string></property><property name="visible"><bool>false</bool></property></widget></item>
<item><widget class="QToolButton" name="pointerToolButton"><property name="text"><string>Pointer</string></property><property name="checkable"><bool>true</bool></property><property name="checked"><bool>true</bool></property><property name="autoExclusive"><bool>true</bool></property></widget></item>
<item><widget class="QToolButton" name="inputToolButton"><property name="text"><string>Input</string></property><property name="toolTip"><string>Add an interface input</string></property><property name="checkable"><bool>true</bool></property><property name="autoExclusive"><bool>true</bool></property></widget></item>
<item><widget class="QToolButton" name="outputToolButton"><property name="text"><string>Output</string></property><property name="toolTip"><string>Add an interface output</string></property><property name="checkable"><bool>true</bool></property><property name="autoExclusive"><bool>true</bool></property></widget></item>
</layout>
</widget>
</item>
<item>
<widget class="QStackedWidget" name="workspaceStack">
<property name="currentIndex"><number>0</number></property>
<widget class="QWidget" name="graphPage">
<layout class="QVBoxLayout" name="graphPageLayout">
<property name="leftMargin"><number>0</number></property><property name="topMargin"><number>0</number></property><property name="rightMargin"><number>0</number></property><property name="bottomMargin"><number>0</number></property>
<item><widget class="GraphWorkspaceView" name="graphView"/></item>
</layout>
</widget>
<widget class="QWidget" name="jsonPage">
<layout class="QVBoxLayout" name="jsonPageLayout">
<property name="leftMargin"><number>0</number></property><property name="topMargin"><number>0</number></property><property name="rightMargin"><number>0</number></property><property name="bottomMargin"><number>0</number></property>
<item><widget class="QPlainTextEdit" name="jsonEditor"><property name="lineWrapMode"><enum>QPlainTextEdit::LineWrapMode::NoWrap</enum></property><property name="placeholderText"><string>Component JSON</string></property></widget></item>
</layout>
</widget>
<widget class="QWidget" name="emptyPage">
<layout class="QVBoxLayout" name="emptyPageLayout">
<item>
<widget class="QLabel" name="emptyWorkspaceLabel">
<property name="text"><string>No document open</string></property>
<property name="alignment"><set>Qt::AlignmentFlag::AlignCenter</set></property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
@@ -131,6 +203,7 @@
<addaction name="actionSave"/>
<addaction name="actionSaveAs"/>
<addaction name="separator"/>
<addaction name="actionClose"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menuEdit">
@@ -143,6 +216,8 @@
<addaction name="actionCopy"/>
<addaction name="actionCut"/>
<addaction name="actionPaste"/>
<addaction name="actionDelete"/>
<addaction name="actionSelectAll"/>
<addaction name="separator"/>
<addaction name="actionSettings"/>
</widget>
@@ -230,6 +305,12 @@
<addaction name="actionCut"/>
<addaction name="actionPaste"/>
</widget>
<widget class="QToolBar" name="transformToolbar">
<property name="windowTitle"><string>Transform</string></property>
<attribute name="toolBarArea"><enum>TopToolBarArea</enum></attribute>
<attribute name="toolBarBreak"><bool>false</bool></attribute>
<addaction name="actionRotateClockwise"/>
</widget>
<action name="actionNew">
<property name="icon">
<iconset resource="../resources/resources.qrc">
@@ -245,6 +326,15 @@
<string>Ctrl+N</string>
</property>
</action>
<action name="actionRotateClockwise">
<property name="icon">
<iconset resource="../resources/resources.qrc">
<normaloff>:/icons/icons/transform-rotate.png</normaloff>:/icons/icons/transform-rotate.png</iconset>
</property>
<property name="text"><string>Rotate Clockwise</string></property>
<property name="toolTip"><string>Rotate selected blocks clockwise by 90 degrees</string></property>
<property name="shortcut"><string>Ctrl+R</string></property>
</action>
<action name="actionOpen">
<property name="icon">
<iconset resource="../resources/resources.qrc">
@@ -295,6 +385,10 @@
<string>Ctrl+Q</string>
</property>
</action>
<action name="actionClose">
<property name="text"><string>&amp;Close Document</string></property>
<property name="shortcut"><string>Ctrl+W</string></property>
</action>
<action name="actionUndo">
<property name="icon">
<iconset resource="../resources/resources.qrc">
@@ -363,6 +457,10 @@
<string>Ctrl+A</string>
</property>
</action>
<action name="actionDelete">
<property name="text"><string>&amp;Delete</string></property>
<property name="shortcut"><string>Del</string></property>
</action>
<action name="actionAbout">
<property name="text">
<string>&amp;About BEdit</string>
@@ -382,6 +480,13 @@
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>GraphWorkspaceView</class>
<extends>QGraphicsView</extends>
<header>bedit.workspace.view</header>
</customwidget>
</customwidgets>
<resources>
<include location="../resources/resources.qrc"/>
</resources>