Commit 70e8f1a9 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Merge branch 'rf/gtk3' into 'master'

Rf/gtk3

See merge request fsl/fsleyes/props!36
parents 7126ccb4 195f8b72
...@@ -2,6 +2,17 @@ This document contains the ``fsleyes-props`` release history in reverse ...@@ -2,6 +2,17 @@ This document contains the ``fsleyes-props`` release history in reverse
chronological order. chronological order.
1.6.7 (Friday October 4th 2019)
-------------------------------
Changed
^^^^^^^
* Minor GTK3 compatibility fixes.
1.6.6 (Wednesday September 18th 2019) 1.6.6 (Wednesday September 18th 2019)
------------------------------------- -------------------------------------
......
...@@ -33,7 +33,7 @@ added as attributes of a :class:`.HasProperties` class definition. ...@@ -33,7 +33,7 @@ added as attributes of a :class:`.HasProperties` class definition.
import os.path as op import os.path as op
import collections from collections import abc
import six import six
...@@ -798,7 +798,7 @@ class Colour(props.PropertyBase): ...@@ -798,7 +798,7 @@ class Colour(props.PropertyBase):
""" """
props.PropertyBase.validate(self, instance, attributes, value) props.PropertyBase.validate(self, instance, attributes, value)
if (not isinstance(value, collections.Sequence)) or \ if (not isinstance(value, abc.Sequence)) or \
(len(value) not in (3, 4)): (len(value) not in (3, 4)):
raise ValueError('Colour must be a sequence of three/four values') raise ValueError('Colour must be a sequence of three/four values')
......
...@@ -1178,7 +1178,7 @@ class PropertyValueList(PropertyValue): ...@@ -1178,7 +1178,7 @@ class PropertyValueList(PropertyValue):
def move(self, from_, to): def move(self, from_, to):
"""Move the item from 'from\_' to 'to'.""" """Move the item from ``from_`` to ``to``."""
propVals = self.getPropertyValueList() propVals = self.getPropertyValueList()
propVals.insert(to, propVals.pop(from_)) propVals.insert(to, propVals.pop(from_))
......
...@@ -98,7 +98,7 @@ import sys ...@@ -98,7 +98,7 @@ import sys
import os import os
import os.path as op import os.path as op
from collections import Iterable from collections.abc import Iterable
import six import six
......
...@@ -85,7 +85,7 @@ def _booleanCheckBox(parent): ...@@ -85,7 +85,7 @@ def _booleanCheckBox(parent):
"""Create a ``wx.CheckBox`` to link to the :class:`.Boolean` property. """ """Create a ``wx.CheckBox`` to link to the :class:`.Boolean` property. """
widget = wx.CheckBox(parent) widget = wx.CheckBox(parent)
event = wx.EVT_CHECKBOX event = wx.EVT_CHECKBOX
widget.SetMinSize(widget.GetBestSize())
return widget, event, None, None return widget, event, None, None
...@@ -106,6 +106,7 @@ def _booleanToggle(parent, icons): ...@@ -106,6 +106,7 @@ def _booleanToggle(parent, icons):
falseBmp=falseBmp, falseBmp=falseBmp,
style=style) style=style)
event = bmptoggle.EVT_BITMAP_TOGGLE event = bmptoggle.EVT_BITMAP_TOGGLE
widget.SetMinSize(widget.GetBestSize())
return widget, event, None, None return widget, event, None, None
...@@ -117,6 +118,7 @@ def _booleanRadio(parent, icons, style): ...@@ -117,6 +118,7 @@ def _booleanRadio(parent, icons, style):
widget = bmpradio.BitmapRadioBox(parent, style) widget = bmpradio.BitmapRadioBox(parent, style)
event = bmpradio.EVT_BITMAP_RADIO_EVENT event = bmpradio.EVT_BITMAP_RADIO_EVENT
widget.SetMinSize(widget.GetBestSize())
if len(icons) == 2: if len(icons) == 2:
icons = [icons[0], None, icons[1], None] icons = [icons[0], None, icons[1], None]
......
...@@ -222,6 +222,7 @@ def _Choice(parent, ...@@ -222,6 +222,7 @@ def _Choice(parent,
# Initialise the widget # Initialise the widget
choicesChanged(None, 'choices') choicesChanged(None, 'choices')
widgetSet(propVal.get()) widgetSet(propVal.get())
widget.SetMinSize(widget.GetBestSize())
def onDestroy(ev): def onDestroy(ev):
log.debug('Removing attribute listener {}'.format(listenerName)) log.debug('Removing attribute listener {}'.format(listenerName))
......
...@@ -102,7 +102,7 @@ def simclick(sim, target, btn=wx.MOUSE_BTN_LEFT, pos=None, stype=0): ...@@ -102,7 +102,7 @@ def simclick(sim, target, btn=wx.MOUSE_BTN_LEFT, pos=None, stype=0):
x += w * pos[0] x += w * pos[0]
y += h * pos[1] y += h * pos[1]
sim.MouseMove(x, y) sim.MouseMove(int(x), int(y))
wx.Yield() wx.Yield()
if stype == 0: sim.MouseClick(btn) if stype == 0: sim.MouseClick(btn)
elif stype == 1: sim.MouseDblClick(btn) elif stype == 1: sim.MouseDblClick(btn)
......
Supports Markdown
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