Commit 38dcbfe1 authored by Tong Zhang's avatar Tong Zhang
Browse files

UI: Update UI and resources.

parent 24a75b8d
<RCC>
<qresource prefix="icons">
<file>export.png</file>
<file>exit.png</file>
<file>load_lattice.png</file>
<file>info.png</file>
<file>default.png</file>
</qresource>
......
This diff is collapsed.
......@@ -17,6 +17,7 @@ class Ui_MainWindow(object):
icon.addPixmap(QtGui.QPixmap(":/icons/default.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
MainWindow.setWindowIcon(icon)
MainWindow.setIconSize(QtCore.QSize(36, 36))
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
......@@ -120,7 +121,7 @@ class Ui_MainWindow(object):
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setObjectName("scrollArea")
self.ellipse_area = QtWidgets.QWidget()
self.ellipse_area.setGeometry(QtCore.QRect(0, 0, 1684, 618))
self.ellipse_area.setGeometry(QtCore.QRect(0, 0, 1684, 538))
self.ellipse_area.setObjectName("ellipse_area")
self.gridLayout_2 = QtWidgets.QGridLayout(self.ellipse_area)
self.gridLayout_2.setObjectName("gridLayout_2")
......@@ -339,6 +340,7 @@ class Ui_MainWindow(object):
font.setItalic(False)
font.setWeight(50)
self.trajectory_plot.setFigureTitleFont(font)
self.trajectory_plot.setProperty("figureLegendToggle", True)
font = QtGui.QFont()
font.setFamily("sans-serif")
font.setPointSize(12)
......@@ -376,24 +378,47 @@ class Ui_MainWindow(object):
self.menu_Help = QtWidgets.QMenu(self.menubar)
self.menu_Help.setObjectName("menu_Help")
MainWindow.setMenuBar(self.menubar)
self.toolBar = QtWidgets.QToolBar(MainWindow)
self.toolBar.setStyleSheet("QToolBar {\n"
" padding: 4px;\n"
" spacing: 4px;\n"
"}")
self.toolBar.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon)
self.toolBar.setObjectName("toolBar")
MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
self.action_About = QtWidgets.QAction(MainWindow)
self.action_About.setObjectName("action_About")
self.actionAbout_Qt = QtWidgets.QAction(MainWindow)
self.actionAbout_Qt.setObjectName("actionAbout_Qt")
self.actionE_xit = QtWidgets.QAction(MainWindow)
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(":/icons/exit.png"), QtGui.QIcon.Normal,
QtGui.QIcon.Off)
self.actionE_xit.setIcon(icon2)
self.actionE_xit.setObjectName("actionE_xit")
self.actionContents = QtWidgets.QAction(MainWindow)
self.actionContents.setObjectName("actionContents")
self.actionLoad_Lattice = QtWidgets.QAction(MainWindow)
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(":/icons/load_lattice.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionLoad_Lattice.setIcon(icon3)
self.actionLoad_Lattice.setObjectName("actionLoad_Lattice")
self.menu_File.addAction(self.actionLoad_Lattice)
self.menu_File.addAction(self.actionE_xit)
self.actionExport_Lattice = QtWidgets.QAction(MainWindow)
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap(":/icons/export.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionExport_Lattice.setIcon(icon4)
self.actionExport_Lattice.setObjectName("actionExport_Lattice")
self.menu_Help.addAction(self.actionContents)
self.menu_Help.addSeparator()
self.menu_Help.addAction(self.action_About)
self.menu_Help.addAction(self.actionAbout_Qt)
self.menubar.addAction(self.menu_File.menuAction())
self.menubar.addAction(self.menu_Help.menuAction())
self.toolBar.addAction(self.actionLoad_Lattice)
self.toolBar.addAction(self.actionExport_Lattice)
self.toolBar.addAction(self.actionE_xit)
self.retranslateUi(MainWindow)
self.tabWidget.setCurrentIndex(0)
......@@ -421,6 +446,7 @@ class Ui_MainWindow(object):
self.trajectory_plot.xlimitMinChanged['double'].connect(
self.trajectory_layout_plot.setXLimitMin)
self.actionLoad_Lattice.triggered.connect(MainWindow.onLoadLattice)
self.actionExport_Lattice.triggered.connect(MainWindow.onExportLatfile)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
......@@ -481,15 +507,24 @@ class Ui_MainWindow(object):
_translate("MainWindow", "Schematic Layout"))
self.menu_File.setTitle(_translate("MainWindow", "&File"))
self.menu_Help.setTitle(_translate("MainWindow", "&Help"))
self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar"))
self.action_About.setText(_translate("MainWindow", "&About"))
self.action_About.setShortcut(_translate("MainWindow", "Ctrl+A"))
self.actionAbout_Qt.setText(_translate("MainWindow", "About Qt"))
self.actionE_xit.setText(_translate("MainWindow", "E&xit"))
self.actionE_xit.setToolTip(_translate("MainWindow", "Exit this app."))
self.actionE_xit.setShortcut(_translate("MainWindow", "Ctrl+W"))
self.actionContents.setText(_translate("MainWindow", "Contents"))
self.actionContents.setShortcut(_translate("MainWindow", "F1"))
self.actionLoad_Lattice.setText(
_translate("MainWindow", "Load Lattice"))
self.actionLoad_Lattice.setToolTip(
_translate("MainWindow", "Load machine and segment."))
self.actionExport_Lattice.setText(
_translate("MainWindow", "Export Lattice File"))
self.actionExport_Lattice.setToolTip(
_translate("MainWindow",
"Export physics model to a FLAME lattice file."))
from mpl4qt.widgets.mplbasewidget import MatplotlibBaseWidget
......
......@@ -17,6 +17,12 @@
<iconset resource="resources.qrc">
<normaloff>:/icons/default.png</normaloff>:/icons/default.png</iconset>
</property>
<property name="iconSize">
<size>
<width>36</width>
<height>36</height>
</size>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
......@@ -203,7 +209,7 @@
<x>0</x>
<y>0</y>
<width>1684</width>
<height>618</height>
<height>538</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
......@@ -584,6 +590,9 @@
<bold>false</bold>
</font>
</property>
<property name="figureLegendToggle" stdset="0">
<bool>true</bool>
</property>
<property name="figureXYticksFont">
<font>
<family>sans-serif</family>
......@@ -649,8 +658,6 @@
<property name="title">
<string>&amp;File</string>
</property>
<addaction name="actionLoad_Lattice"/>
<addaction name="actionE_xit"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
......@@ -664,6 +671,29 @@
<addaction name="menu_File"/>
<addaction name="menu_Help"/>
</widget>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<property name="styleSheet">
<string notr="true">QToolBar {
padding: 4px;
spacing: 4px;
}</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="actionLoad_Lattice"/>
<addaction name="actionExport_Lattice"/>
<addaction name="actionE_xit"/>
</widget>
<action name="action_About">
<property name="text">
<string>&amp;About</string>
......@@ -678,9 +708,16 @@
</property>
</action>
<action name="actionE_xit">
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icons/exit.png</normaloff>:/icons/exit.png</iconset>
</property>
<property name="text">
<string>E&amp;xit</string>
</property>
<property name="toolTip">
<string>Exit this app.</string>
</property>
<property name="shortcut">
<string>Ctrl+W</string>
</property>
......@@ -694,9 +731,28 @@
</property>
</action>
<action name="actionLoad_Lattice">
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icons/load_lattice.png</normaloff>:/icons/load_lattice.png</iconset>
</property>
<property name="text">
<string>Load Lattice</string>
</property>
<property name="toolTip">
<string>Load machine and segment.</string>
</property>
</action>
<action name="actionExport_Lattice">
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icons/export.png</normaloff>:/icons/export.png</iconset>
</property>
<property name="text">
<string>Export Lattice File</string>
</property>
<property name="toolTip">
<string>Export physics model to a FLAME lattice file.</string>
</property>
</action>
</widget>
<customwidgets>
......@@ -955,6 +1011,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>actionExport_Lattice</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>onExportLatfile()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>866</x>
<y>456</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>onAbout()</slot>
......@@ -963,5 +1035,6 @@
<slot>on_auto_ylim()</slot>
<slot>on_ellipse_size_changed()</slot>
<slot>onLoadLattice()</slot>
<slot>onExportLatfile()</slot>
</slots>
</ui>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment