summaryrefslogtreecommitdiff
path: root/src/ui.py
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2019-05-02 19:54:26 +0200
committerPaweł Redman <pawel.redman@gmail.com>2019-05-02 19:59:49 +0200
commit6fcef36d90a66afd7c974748af7de2017f4f5792 (patch)
tree8859f434423fc7355f7c8c1e5b246ee2a6a516b6 /src/ui.py
parentb35ade41339ea95ec3c59eb45b813273304682e7 (diff)
Input intensity
Diffstat (limited to 'src/ui.py')
-rw-r--r--src/ui.py28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/ui.py b/src/ui.py
index 33da1ea..ccdff63 100644
--- a/src/ui.py
+++ b/src/ui.py
@@ -236,6 +236,8 @@ class TableRow:
def populate_table():
+ GUI.input_intensity.setText("%g" % system.input_intensity)
+
GUI.table = QGridLayout()
GUI.table.setColumnStretch(1, 1)
GUI.table.setColumnStretch(2, 2)
@@ -444,17 +446,37 @@ def optimize(which):
GUI.table_rows[op_idx].optbox.angle.edit.setText("%g" % round(opt.x * 180 / np.pi, 3))
+
+def change_input_intensity():
+ try:
+ system.input_intensity = float(GUI.input_intensity.text())
+ update()
+ except ValueError:
+ pass
+
def setup(win, system_):
global system
system = system_
# Needless to say, I'm getting real tired of this whole Layout/Widget
# clusterfuck in Qt
- root = QHBoxLayout()
+ root = QVBoxLayout()
root_fucking_random_container = QWidget()
root_fucking_random_container.setLayout(root)
win.setCentralWidget(root_fucking_random_container)
+ # Top bar (input intensity)
+ box = QHBoxLayout()
+ root.addLayout(box)
+
+ box.addWidget(QLabel("Input intensity"))
+ GUI.input_intensity = QLineEdit("1")
+ GUI.input_intensity.textChanged.connect(change_input_intensity)
+ box.addWidget(GUI.input_intensity)
+
+ hbox = QHBoxLayout()
+ root.addLayout(hbox)
+
rhs = QVBoxLayout()
Widocques.image = QImage("jones.jpg")
@@ -479,8 +501,8 @@ def setup(win, system_):
GUI.table_frame.setLayout(GUI.table)
GUI.scroll.setWidget(GUI.table_frame)
- root.addWidget(GUI.scroll)
- root.addLayout(rhs)
+ hbox.addWidget(GUI.scroll)
+ hbox.addLayout(rhs)
setup_menubar(win)