Skip to content

Commit

Permalink
fix: exception in Collect/Colocalize tab when using the sliders (close
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Oct 14, 2022
1 parent 00b0a28 commit 38deca5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.4.1
- fix: exception in Collect/Colocalize tab when using the sliders
in the visualization panel (#51)
0.4.0
- fix: bump bmlab from 0.2.3 to 0.6.1 (file format changes) (#53)
0.3.1
Expand Down
15 changes: 8 additions & 7 deletions impose/gui/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,23 +270,24 @@ def update_shape_list(self):
self.widget_structures.setUpdatesEnabled(True)

def update_table_paths(self):
"""Update the list of paths ("Datasets") in the GUI"""
paths = self.session_scheme.paths
self.tableWidget_paths.setRowCount(len(paths))
for row, pp in enumerate(paths):
for jj, label in enumerate([str(pp), str(row + 1)]):
# set pseudo-right elided text with dots on left
item = self.tableWidget_paths.item(row, jj)
if item is None:
widlab = self.tableWidget_paths.cellWidget(row, jj)
if widlab is None:
# create widget if it does not exist
item = QtWidgets.QLabel()
self.tableWidget_paths.setCellWidget(row, jj, item)
widlab = QtWidgets.QLabel(self)
self.tableWidget_paths.setCellWidget(row, jj, widlab)
QtWidgets.QApplication.processEvents(
QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 500)
f_metrics = item.fontMetrics()
s = item.size().width() - 5
f_metrics = widlab.fontMetrics()
s = widlab.size().width() - 5
ellabel = f_metrics.elidedText(
label, QtCore.Qt.TextElideMode.ElideLeft, s)
item.setText(ellabel)
widlab.setText(ellabel)

def update_ui_from_scheme(self):
# list of paths
Expand Down
15 changes: 8 additions & 7 deletions impose/gui/colocalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,23 +324,24 @@ def update_structure_table(self):
wlabel.setStyleSheet("background-color: " + chex + ";")

def update_table_paths(self):
"""Update the list of paths ("Datasets") in the GUI"""
paths = self.session_scheme.paths
self.tableWidget_paths.setRowCount(len(paths))
for row, pp in enumerate(paths):
for jj, label in enumerate([str(pp), str(row + 1)]):
# set pseudo-right elided text with dots on left
item = self.tableWidget_paths.item(row, jj)
if item is None:
widlab = self.tableWidget_paths.cellWidget(row, jj)
if widlab is None:
# create widget if it does not exist
item = QtWidgets.QLabel()
self.tableWidget_paths.setCellWidget(row, jj, item)
widlab = QtWidgets.QLabel()
self.tableWidget_paths.setCellWidget(row, jj, widlab)
QtWidgets.QApplication.processEvents(
QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 500)
f_metrics = item.fontMetrics()
s = item.size().width() - 5
f_metrics = widlab.fontMetrics()
s = widlab.size().width() - 5
ellabel = f_metrics.elidedText(
label, QtCore.Qt.TextElideMode.ElideLeft, s)
item.setText(ellabel)
widlab.setText(ellabel)

def update_ui_from_scheme(self):
"""Updates UI with information from self.session_scheme"""
Expand Down

0 comments on commit 38deca5

Please sign in to comment.