Skip to content

Commit

Permalink
updated iconagraphy
Browse files Browse the repository at this point in the history
  • Loading branch information
nharringtonwasatch committed Dec 10, 2015
1 parent 23470e0 commit bf02bc1
Show file tree
Hide file tree
Showing 8 changed files with 259 additions and 12 deletions.
4 changes: 3 additions & 1 deletion assets/bluegraph_resources.qrc
Expand Up @@ -2,9 +2,11 @@
<qresource prefix="ui">
<file>graph_export.png</file>
<file>fonts/GearsOfPeace.ttf</file>
<file>default_icon.png</file>
<file>toggle_button_activated.png</file>
<file>toggle_button_deactivated.png</file>
<file>small_number_designator_export.png</file>
<file>ir_temp_icon.svg</file>
<file>default_icon.svg</file>
<file>humidity_icon.svg</file>
</qresource>
</RCC>
8 changes: 4 additions & 4 deletions assets/bluegraph_resources_rc.py

Large diffs are not rendered by default.

Binary file removed assets/default_icon.png
Binary file not shown.
112 changes: 112 additions & 0 deletions assets/default_icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions assets/humidity_icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions assets/ir_temp_icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions bluegraph/multi_control.py
Expand Up @@ -27,13 +27,13 @@ def __init__(self, device_class="Simulation",
self.form = views.MultiGraphLayout()


self.amps_graph = views.PixmapBackedGraph("AMPS")
self.amps_graph = views.PixmapBackedGraph("AMPS", icon="default")
self.form.vbox.addWidget(self.amps_graph)

self.ir_temp = views.PixmapBackedGraph("IR TEMP")
self.ir_temp = views.PixmapBackedGraph("IR TEMP", icon="ir_temp")
self.form.vbox.addWidget(self.ir_temp)

self.humidity = views.PixmapBackedGraph("HUMIDITY")
self.humidity = views.PixmapBackedGraph("HUMIDITY", icon="humidity")
self.form.vbox.addWidget(self.humidity)

self.sensor_list = []
Expand Down Expand Up @@ -95,7 +95,6 @@ def update_fps(self):
"""
for sensor in self.sensor_list:
rnd_data = sensor.device.read()
self.data_fps.tick()
if rnd_data is not None:
sensor.curve.setData(rnd_data)
self.data_fps.tick()
Expand Down
10 changes: 7 additions & 3 deletions bluegraph/views.py
Expand Up @@ -71,7 +71,7 @@ def closeEvent(self, event):


class PixmapBackedGraph(QtGui.QWidget):
def __init__(self, title="Blue Graph"):
def __init__(self, title="Blue Graph", icon="default"):
super(PixmapBackedGraph, self).__init__()

self.main_layout = QtGui.QVBoxLayout()
Expand All @@ -81,7 +81,7 @@ def __init__(self, title="Blue Graph"):

filename = ":ui/graph_export.png"
self.graphback = SceneGraphBackground(self.scene, filename,
title=title)
title=title, icon=icon)
self.scene.addItem(self.graphback)

self.view = QtGui.QGraphicsView(self.scene)
Expand Down Expand Up @@ -150,7 +150,7 @@ def __init__(self, scene, filename, title="BLUE GRAPH",

self.add_main_title(title, self)

icon_filename = ":ui/default_icon.png"
icon_filename = ":ui/%s_icon.svg" % icon
self.add_main_icon(icon_filename, self)

self.minimum = SmallTextBox(prefix="MIN:")
Expand Down Expand Up @@ -178,6 +178,10 @@ def add_main_icon(self, filename, parent):
self.icon.setPos(33, 13)
self.icon.setParentItem(parent)

self.icon_shadow = QtGui.QGraphicsDropShadowEffect()
self.icon_shadow.setOffset(2, 2)
self.icon.setGraphicsEffect(self.icon_shadow)

def add_main_title(self, title, parent):
""" Add a text item with drop shadow.
"""
Expand Down

0 comments on commit bf02bc1

Please sign in to comment.