Skip to content

Commit d607271

Browse files
committed
BF: Settings Online Resources box wasn't resizing
- the BoxSizer _szr needed to be told to expand horizontally - GridBagSizer needs to be told it's a GrowableRow - rather than hard-coding the buttons for +/- use wx.BU_EXACTFIT to get them to be not-enormous. (hard-coded in pixels was ugly on the mac)
1 parent 0b4ddcf commit d607271

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

psychopy/app/builder/dialogs/__init__.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -792,10 +792,10 @@ def addParam(self, fieldName, parent, sizer, currRow, advanced=False,
792792
pass
793793

794794
if fieldName in ['text']:
795-
sizer.AddGrowableRow(currRow) # doesn't seem to work though
796-
# self.Bind(EVT_ETC_LAYOUT_NEEDED, self.onNewTextSize,
797-
# ctrls.valueCtrl)
795+
sizer.AddGrowableRow(currRow)
798796
ctrls.valueCtrl.Bind(wx.EVT_KEY_UP, self.doValidate)
797+
elif param.valType == 'fileList':
798+
sizer.AddGrowableRow(currRow) # doesn't seem to work though
799799
elif fieldName in ('color', 'fillColor', 'lineColor'):
800800
ctrls.valueCtrl.Bind(wx.EVT_RIGHT_DOWN, self.launchColorPicker)
801801
elif valType == 'extendedCode':
@@ -1940,15 +1940,16 @@ def __init__(self, parent, choices=[], size=None, pathtype="rel"):
19401940
if type(choices) == str:
19411941
choices = data.utils.listFromString(choices)
19421942
self.Create(id=wx.ID_ANY, parent=parent, choices=choices, size=size, style=wx.LB_EXTENDED | wx.LB_HSCROLL)
1943-
self.addBtn = wx.Button(parent, -1, size=wx.Size(20,20), label="+")
1943+
self.addBtn = wx.Button(parent, -1, style=wx.BU_EXACTFIT, label="+")
19441944
self.addBtn.Bind(wx.EVT_BUTTON, self.addItem)
1945-
self.subBtn = wx.Button(parent, -1, size=wx.Size(20,20), label="-")
1945+
self.subBtn = wx.Button(parent, -1, style=wx.BU_EXACTFIT, label="-")
19461946
self.subBtn.Bind(wx.EVT_BUTTON, self.removeItem)
19471947

19481948
self._szr = wx.BoxSizer(wx.HORIZONTAL)
19491949
self.btns = wx.BoxSizer(wx.VERTICAL)
19501950
self.btns.AddMany((self.addBtn, self.subBtn))
1951-
self._szr.AddMany((self, self.btns))
1951+
self._szr.Add(self, proportion=1, flag=wx.EXPAND)
1952+
self._szr.Add(self.btns)
19521953

19531954
def addItem(self, event):
19541955
if event.GetEventObject() == self.addBtn:

0 commit comments

Comments
 (0)