Commit cea1e479 authored by Karol Actun's avatar Karol Actun
Browse files

border color can be changed in the GUI (grid tab)

parent 84754fec
......@@ -447,14 +447,29 @@ def get_color_picker(vis):
locs_button.clicked.connect(locs)
brd_button = QPushButton("grid border")
def brd():
qcd = QColorDialog()
qcd.setOption(QColorDialog.ShowAlphaChannel)
qcd.setCurrentColor(QColor.fromRgbF(*vis.get_grid_border_color()))
qcd.exec()
if qcd.result() == 1:
vis.set_grid_border_color((qcd.selectedColor().getRgbF()))
brd_button.clicked.connect(brd)
vbox = QVBoxLayout()
desc = QLabel("change color of:")
vbox.addWidget(desc, alignment=Qt.AlignBaseline)
hbox = QHBoxLayout()
hbox.addWidget(lines_button, alignment=Qt.AlignBaseline)
hbox.addWidget(locs_button, alignment=Qt.AlignBaseline)
hbox.addWidget(bg_button, alignment=Qt.AlignBaseline)
vbox.addLayout(hbox)
hbox1 = QHBoxLayout()
hbox1.addWidget(lines_button, alignment=Qt.AlignBaseline)
hbox1.addWidget(locs_button, alignment=Qt.AlignBaseline)
hbox2 = QHBoxLayout()
hbox2.addWidget(bg_button, alignment=Qt.AlignBaseline)
hbox2.addWidget(brd_button, alignment=Qt.AlignBaseline)
vbox.addLayout(hbox1)
vbox.addLayout(hbox2)
return vbox
......
......@@ -450,5 +450,6 @@ class OGLWidget(QtOpenGL.QGLWidget):
eprint("Error: couldn't create the screenshot folder.")
def set_background_color(self, color):
self.background = color
GL.glClearColor(*color, 1.0)
self.glDraw()
......@@ -10,7 +10,6 @@ import random
import threading
import os
import datetime
import time
from lib import csv_generator, particle, tile, location, vis3d
from lib.swarm_sim_header import eprint
......
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