Skip to content
Snippets Groups Projects
Commit a2a2b711 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Number of lightbox rows and columns are now fixed (i.e. they don't

change when the image properties change).
parent b925c9c0
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,7 @@ class LightBoxCanvas(slicecanvas.SliceCanvas): ...@@ -35,7 +35,7 @@ class LightBoxCanvas(slicecanvas.SliceCanvas):
""" """
ncols = props.Int(clamped=True, minval=1, maxval=15, default=5) ncols = props.Int(clamped=True, minval=1, maxval=20, default=5)
"""This property controls the number of """This property controls the number of
slices to be displayed on a single row. slices to be displayed on a single row.
""" """
...@@ -250,9 +250,20 @@ class LightBoxCanvas(slicecanvas.SliceCanvas): ...@@ -250,9 +250,20 @@ class LightBoxCanvas(slicecanvas.SliceCanvas):
if self._nslices == 0 or self._totalRows == 0: if self._nslices == 0 or self._totalRows == 0:
return return
self.setConstraint('nrows', 'maxval', self._totalRows) # All slices are going to be displayed, so
self.setConstraint('topRow', 'maxval', self._totalRows - self.nrows) # we'll 'disable' the topRow property
if self._totalRows < self.nrows:
self.setConstraint('topRow', 'minval', 0)
self.setConstraint('topRow', 'maxval', 0)
# nrows slices are going to be displayed,
# and the topRow property can be used to
# scroll through all available rows.
else:
self.setConstraint('topRow',
'maxval',
self._totalRows - self.nrows)
def _zPosChanged(self, *a): def _zPosChanged(self, *a):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment