mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-14 12:50:39 +08:00
ENH: Let Qt handle most of the window sizing.
This commit is contained in:
@@ -28,16 +28,17 @@ class Plugin(QtGui.QDialog):
|
||||
name = 'Plugin'
|
||||
draws_on_image = False
|
||||
|
||||
def __init__(self, image_filter=None, height=100, width=400, useblit=None):
|
||||
QtGui.QDialog.__init__(self)
|
||||
def __init__(self, image_filter=None, height=0, width=400, useblit=None):
|
||||
super(Plugin, self).__init__()
|
||||
|
||||
self.image_viewer = None
|
||||
if image_filter is not None:
|
||||
self.image_filter = image_filter
|
||||
|
||||
self.setWindowTitle(self.name)
|
||||
self.layout = QtGui.QGridLayout(self)
|
||||
self.resize(width, height)
|
||||
self.row = 0
|
||||
if image_filter is not None:
|
||||
self.image_filter = image_filter
|
||||
|
||||
self.arguments = []
|
||||
self.keyword_arguments= {}
|
||||
|
||||
@@ -9,8 +9,6 @@ class CannyPlugin(OverlayPlugin):
|
||||
name = 'Canny Filter'
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
kwargs.setdefault('height', 100)
|
||||
kwargs.setdefault('width', 400)
|
||||
super(CannyPlugin, self).__init__(**kwargs)
|
||||
|
||||
self.add_widget(Slider('sigma', 0, 5, update_on='release'))
|
||||
|
||||
@@ -34,8 +34,7 @@ class LineProfile(PlotPlugin):
|
||||
draws_on_image = True
|
||||
|
||||
def __init__(self, useblit=None, linewidth=1, epsilon=5, limits='image'):
|
||||
super(LineProfile, self).__init__(height=200, width=600,
|
||||
useblit=useblit)
|
||||
super(LineProfile, self).__init__(useblit=useblit)
|
||||
self.linewidth = linewidth
|
||||
self.epsilon = epsilon
|
||||
self._active_pt = None
|
||||
|
||||
@@ -23,6 +23,7 @@ class PlotCanvas(FigureCanvasQTAgg):
|
||||
FigureCanvasQTAgg.updateGeometry(self)
|
||||
# Note: `setParent` must be called after `FigureCanvasQTAgg.__init__`.
|
||||
self.setParent(parent)
|
||||
self.setMinimumHeight(150)
|
||||
|
||||
|
||||
class PlotPlugin(Plugin):
|
||||
|
||||
Reference in New Issue
Block a user