forked from M-Labs/artiq
1
0
Fork 0

gui: add logo to MDI area

This commit is contained in:
Sebastien Bourdeauducq 2016-02-21 08:06:52 +08:00
parent fc47d8c0ea
commit 95dbafd662
3 changed files with 118 additions and 2 deletions

View File

@ -37,7 +37,7 @@ def get_argparser():
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, server):
QtWidgets.QMainWindow.__init__(self)
icon = QtGui.QIcon(os.path.join(artiq_dir, "gui", "icon.png"))
icon = QtGui.QIcon(os.path.join(artiq_dir, "gui", "logo.svg"))
self.setWindowIcon(icon)
self.setWindowTitle("ARTIQ - {}".format(server))
self.exit_request = asyncio.Event()
@ -56,6 +56,19 @@ class MainWindow(QtWidgets.QMainWindow):
self.restoreState(QtCore.QByteArray(state["state"]))
class MdiArea(QtWidgets.QMdiArea):
def __init__(self):
QtWidgets.QMdiArea.__init__(self)
self.pixmap = QtGui.QPixmap(os.path.join(artiq_dir, "gui", "logo.svg"))
def paintEvent(self, event):
QtWidgets.QMdiArea.paintEvent(self, event)
painter = QtGui.QPainter(self.viewport())
x = (self.width() - self.pixmap.width())//2
y = (self.height() - self.pixmap.height())//2
painter.drawPixmap(x, y, self.pixmap)
def main():
# initialize application
args = get_argparser().parse_args()
@ -93,7 +106,7 @@ def main():
status_bar = QtWidgets.QStatusBar()
status_bar.showMessage("Connected to {}".format(args.server))
main_window.setStatusBar(status_bar)
mdi_area = QtWidgets.QMdiArea()
mdi_area = MdiArea()
mdi_area.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
mdi_area.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
main_window.setCentralWidget(mdi_area)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

103
artiq/gui/logo.svg Normal file
View File

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="340.157px" height="393.725px" viewBox="0 0 340.157 393.725" enable-background="new 0 0 340.157 393.725"
xml:space="preserve">
<g>
<path fill="#888888" stroke="#888888" stroke-miterlimit="10" d="M122.782,162.276c0,0-5.365-6.568-1.423-12.261c0,0,3.941-6.241,11.167-4.599
c0,0,7.445,1.532,8.54,13.028c0,0,1.424,6.786-1.97,7.772c0,0-5.365,1.86-8.65,0.767c0,0,22.991,7.337,46.312,36.022
c0,0,0.438,0.657,1.313,1.313c0,0,6.314,3.433,8.649,9.126l0.657,1.897c0,0,0.146,2.409-2.481,1.898c0,0-7.226-1.022-10.22-6.06
l-0.364-0.655l-1.319-2.18c0,0-12.695-15.342-34.153-25.124c0,0-10.217,7.736-15.327,22.048c0,0-2.773,6.277,0.875,15.912
l0.876,1.754l9.926,18.099c0,0,3.942,7.736,3.504,17.227c0,0,0.146,20.591,8.612,30.227c0,0,2.19,2.92,6.861,5.985
c0,0,3.942,2.336,3.357,3.797c0,0-0.583,2.188-5.839,0.436c0,0-15.035-5.838-19.852-22.189c0,0-3.941-11.685-3.941-19.861
c0,0-1.826-5.693-12.117-16.86c0,0-10.292-10.73-14.016-15.986c0,0-24.523,20.73-58.391,27.883c0,0-8.612,1.897-14.597,10.51
c0,0-3.212,4.529-5.839,4.821c0,0-3.066-0.146,0.291-6.281l3.358-5.839c0,0,4.963-7.591,12.262-10.656
c0,0,17.079-6.278,28.757-15.473c0,0,27.735-22.334,34.304-47.594c0,0,4.088-12.116,0.146-22.334c0,0-9.05-20.435-0.438-31.529
c0,0,10.073-11.827,29.635-14.6c0,0,2.336-3.796,9.197-5.692c0,0,2.773-0.585,3.796-1.167c0,0,2.189-1.023,2.627-0.584
c0,0,1.313,0.729-1.752,3.796c0,0-3.649,5.254-14.014,9.779l-2.919,1.022c0,0-14.306,3.649-19.271,13.722
C108.913,133.594,101.03,147.606,122.782,162.276z"/>
<path fill="#888888" stroke="#888888" stroke-miterlimit="10" d="M247.881,164.831c0,0-4.672-2.482-5.694-10.218c0,0-1.897-10.363,9.051-12.7
c0,0,9.489-2.48,11.97,9.198c0,0,1.752,5.984-2.188,10.8c0,0,22.369-3.466,49.848-25.252c0,0,1.534-3.834,5.805-5.365l2.628-0.876
c0,0,3.174-0.986,4.927-2.738l1.642-1.752c0,0,1.314-1.532,1.972-1.203c0,0,1.203,0.438-0.11,2.628c0,0-1.204,4.051-7.993,9.415
l-3.284,2.299c0,0-1.094,0.877-2.737,2.629c0,0-14.779,15.436-31.859,23.427l-2.737,1.314c0,0-6.022,2.299-7.226,9.196
c0,0-1.096,9.782-3.431,15.182l-4.377,12.412c0,0-4.089,8.904-0.879,15.035c0,0,19.636,31.823,22.264,59.204
c0,0,0,5.695,5.911,11.171l5.693,4.706c0,0,3.722,2.736,2.846,4.599c0,0-0.984,1.971-3.941,0.658c0,0-15.655-5.695-19.596-20.149
c-3.941-14.457-16.826-39.458-30.4-48.654l-1.605-1.021c0,0-14.015,13.576-25.111,23.065c0,0-7.882,7.151-16.642-1.024
c0,0-10.509-8.758-22.625-10.071c0,0-6.57-0.291-12.408,5.109l-2.334,2.044c0,0-2.043,2.409-3.503,1.534
c0,0-1.971-0.657,0.875-4.599c0,0,6.861-9.343,14.014-10.949c0,0,10.658-4.379,33.137,7.59c0,0,19.269-20.143,24.524-45.841
c0,0,2.628-10.804,1.024-13.868c0,0-1.46-3.066-6.278-3.357c0,0-37.954-1.607-54.45-11.534c0,0-1.239-0.437-0.948-2.042
c0,0,0.146-0.949,2.044-1.095c0,0,7.737-1.313,11.824,0.875l1.605,0.878c0,0,2.262,1.678,4.161,1.896
c0,0,21.165,4.453,53.573-2.264L247.881,164.831z"/>
<path fill="#888888" stroke="#888888" stroke-width="3" stroke-miterlimit="10" d="M168.508,147.441c0,2.743-2.223,4.967-4.966,4.967
s-4.965-2.224-4.965-4.967c0-2.739,2.223-4.963,4.965-4.963S168.508,144.702,168.508,147.441z"/>
<path fill="none" stroke="#888888" stroke-width="3" stroke-miterlimit="10" d="M334.029,105.591
c6.721,24.452-61.235,64.441-151.784,89.322C91.7,219.808,12.848,220.166,6.127,195.707c-6.72-24.451,61.235-64.446,151.78-89.323
C248.455,81.496,327.309,81.139,334.029,105.591z"/>
<path fill="none" stroke="#888888" stroke-width="3" stroke-miterlimit="10" d="M197.276,163.136
C159.992,240,114.062,294.699,94.691,285.295c-19.379-9.404-4.863-79.344,32.405-156.199C164.382,52.235,210.317-2.45,229.7,6.952
C249.081,16.354,234.562,86.283,197.276,163.136z"/>
<path fill="none" stroke="#888888" stroke-width="3" stroke-miterlimit="10" d="M299.444,247.995
c-13.873,18.415-83.152-10.393-154.742-64.337C73.111,129.728,26.322,71.08,40.194,52.672
c13.871-18.411,83.149,10.392,154.739,64.33C266.526,170.93,313.315,229.585,299.444,247.995z"/>
<g>
<path fill="none" stroke="#888888" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
M300.731,305.236c-4.896-0.075-9.85-1.232-14.515-3.588c-4.651-2.35-8.518-5.639-11.482-9.521"/>
<line fill="none" stroke="#888888" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="278.504" y1="295.616" x2="283.89" y2="290.43"/>
<line fill="none" stroke="#888888" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="295.616" y1="304.256" x2="296.59" y2="296.843"/>
</g>
<g>
<path fill="none" stroke="#888888" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
M153.685,248.87c1.599-4.627,4.244-8.974,7.938-12.671c3.682-3.687,8.014-6.335,12.626-7.938"/>
<line fill="none" stroke="#888888" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="169.758" y1="230.753" x2="173.006" y2="237.486"/>
<line fill="none" stroke="#888888" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="156.212" y1="244.312" x2="162.951" y2="247.552"/>
</g>
<g>
<path fill="none" stroke="#888888" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
M158.285,305.8c-4.895-0.076-9.851-1.233-14.514-3.588c-4.651-2.349-8.518-5.639-11.482-9.522"/>
<line fill="none" stroke="#888888" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="136.057" y1="296.179" x2="141.443" y2="290.994"/>
<line fill="none" stroke="#888888" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="153.167" y1="304.818" x2="154.143" y2="297.405"/>
</g>
<g>
<path fill="none" stroke="#888888" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
M15.252,267.214c0.331-4.888,1.746-9.776,4.342-14.311c2.588-4.521,6.076-8.21,10.107-10.97"/>
<line fill="none" stroke="#888888" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="26.022" y1="245.519" x2="30.918" y2="251.165"/>
<line fill="none" stroke="#888888" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="16.5" y1="262.151" x2="23.85" y2="263.513"/>
</g>
</g>
<g>
<rect fill="#888888" x="233.467" y="343.364" width="1.528" height="47.041"/>
</g>
<g>
<rect fill="#888888" x="180.259" y="343.364" width="1.526" height="47.041"/>
<rect fill="#888888" x="160.216" y="343.364" width="41.612" height="1.527"/>
</g>
<g>
<polygon fill="#888888" points="24.112,390.407 22.426,390.407 43.206,343.368 44.956,343.358 "/>
<polygon fill="#888888" points="63.928,390.407 65.72,390.407 45.009,343.361 43.192,343.361 "/>
<polygon fill="#888888" points="58.498,375.898 59.842,377.422 29.376,377.422 30.372,375.898 "/>
</g>
<path fill="#888888" d="M137.099,356.405"/>
<g>
<path fill="#888888" d="M291.489,343.364c-12.989,0-23.519,10.534-23.519,23.522s10.53,23.519,23.519,23.519c12.993,0,23.521-10.53,23.521-23.519
S304.482,343.364,291.489,343.364z M291.489,388.882c-12.147,0-21.996-9.848-21.996-21.995c0-12.15,9.849-21.999,21.996-21.999
c12.149,0,22,9.849,22,21.999C313.489,379.034,303.639,388.882,291.489,388.882z"/>
<polygon fill="#888888" points="318.414,389.097 317.631,390.405 297.335,378.334 298.11,377.022 "/>
</g>
<g>
<rect fill="#888888" x="94.9" y="343.286" width="1.526" height="47.041"/>
<polyline fill="#888888" points="118.165,370.763 95.97,370.763 95.97,372.289 118.165,372.289 "/>
<rect fill="#888888" x="95.864" y="343.286" width="22.215" height="1.527"/>
<polygon fill="#888888" points="130.357,390.407 132.317,390.407 118.994,372.273 117.04,372.273 "/>
<path fill="#888888" d="M118.042,343.286v1.544c8.302,0,12.964,7.229,12.964,12.935c0,7.491-5.97,12.996-12.964,12.996v1.528
c7.995,0,14.47-6.533,14.47-14.524C132.512,349.768,126.036,343.286,118.042,343.286z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.2 KiB