Skip to content

Commit 0d2f1ff

Browse files
committed
Fix up of: Fix gui alignment issues (nvaccess#6287)
1 parent e295dbd commit 0d2f1ff

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎source/gui/guiHelper.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,22 +248,23 @@ def addItem(self, item, **keywordArgs):
248248
if isinstance(item, ButtonHelper):
249249
toAdd = item.sizer
250250
buttonBorderAmount = 5
251-
keywordArgs.update({'border':buttonBorderAmount, 'flag':wx.ALL})
251+
keywordArgs["border"] = buttonBorderAmount
252+
keywordArgs["flag"] = keywordArgs.get("flag", 0) | wx.ALL
252253
shouldAddSpacer = False # no need to add a spacer, since the button border has been added.
253254
elif isinstance(item, BoxSizerHelper):
254255
toAdd = item.sizer
255256
elif isinstance(item, PathSelectionHelper):
256257
toAdd = item.sizer
257258
if self.sizer.GetOrientation() == wx.VERTICAL:
258-
keywordArgs['flag'] = wx.EXPAND
259+
keywordArgs["flag"] = keywordArgs.get("flag", 0) | wx.EXPAND
259260
else:
260261
raise NotImplementedError("Adding PathSelectionHelper to a horizontal BoxSizerHelper is not implemented")
261262
elif isinstance(item, LabeledControlHelper):
262263
raise NotImplementedError("Use addLabeledControl instead")
263264

264265
# a boxSizerHelper could contain a wx.StaticBoxSizer
265266
if isinstance(toAdd, (wx.StaticBoxSizer, scrolledpanel.ScrolledPanel)):
266-
keywordArgs['flag'] = wx.EXPAND
267+
keywordArgs["flag"] = keywordArgs.get("flag", 0) | wx.EXPAND
267268

268269
if shouldAddSpacer:
269270
self.sizer.AddSpacer(SPACE_BETWEEN_VERTICAL_DIALOG_ITEMS)

0 commit comments

Comments
 (0)