|
@@ -558,7 +558,10 @@ class PreferencesDialog(PreferencesBaseDialog):
|
|
panel.SetSizer(border)
|
|
panel.SetSizer(border)
|
|
|
|
|
|
# bindings
|
|
# bindings
|
|
- outfontButton.Bind(wx.EVT_BUTTON, self.OnSetOutputFont)
|
|
|
|
|
|
+ if sys.platform == 'darwin':
|
|
|
|
+ outfontButton.Bind(wx.EVT_BUTTON, self.OnSetOutputFontCustomDialog)
|
|
|
|
+ else:
|
|
|
|
+ outfontButton.Bind(wx.EVT_BUTTON, self.OnSetOutputFont)
|
|
|
|
|
|
return panel
|
|
return panel
|
|
|
|
|
|
@@ -1462,6 +1465,22 @@ class PreferencesDialog(PreferencesBaseDialog):
|
|
|
|
|
|
event.Skip()
|
|
event.Skip()
|
|
|
|
|
|
|
|
+ def OnSetOutputFontCustomDialog(self, event):
|
|
|
|
+ """Set font for command console using the custom dialog
|
|
|
|
+ (native is crashing on Mac)"""
|
|
|
|
+ dlg = DefaultFontDialog(parent=self,
|
|
|
|
+ title=_('Select default output font'),
|
|
|
|
+ style=wx.DEFAULT_DIALOG_STYLE,
|
|
|
|
+ type='outputfont')
|
|
|
|
+ if dlg.ShowModal() == wx.ID_OK:
|
|
|
|
+ # set output font and font size variables
|
|
|
|
+ if dlg.font:
|
|
|
|
+ self.settings.Set(group='appearance', value=dlg.font,
|
|
|
|
+ key='outputfont', subkey='type')
|
|
|
|
+ self.settings.Set(group='appearance', value=dlg.fontsize,
|
|
|
|
+ key='outputfont', subkey='size')
|
|
|
|
+ dlg.Destroy()
|
|
|
|
+
|
|
def OnSetOutputFont(self, event):
|
|
def OnSetOutputFont(self, event):
|
|
"""'Set output font' button pressed
|
|
"""'Set output font' button pressed
|
|
"""
|
|
"""
|
|
@@ -1545,15 +1564,18 @@ class DefaultFontDialog(wx.Dialog):
|
|
|
|
|
|
gridSizer = wx.GridBagSizer (hgap = 5, vgap = 5)
|
|
gridSizer = wx.GridBagSizer (hgap = 5, vgap = 5)
|
|
|
|
|
|
- label = wx.StaticText(parent = panel, id = wx.ID_ANY,
|
|
|
|
- label = _("Select font:"))
|
|
|
|
- gridSizer.Add(item = label,
|
|
|
|
- flag = wx.ALIGN_TOP,
|
|
|
|
- pos = (0,0))
|
|
|
|
-
|
|
|
|
- self.fontlb = wx.ListBox(parent = panel, id = wx.ID_ANY, pos = wx.DefaultPosition,
|
|
|
|
- choices = self.fontlist,
|
|
|
|
- style = wx.LB_SINGLE|wx.LB_SORT)
|
|
|
|
|
|
+ label = wx.StaticText(parent=panel, id=wx.ID_ANY,
|
|
|
|
+ label=_("Select font:"))
|
|
|
|
+ gridSizer.Add(item=label,
|
|
|
|
+ flag=wx.ALIGN_TOP,
|
|
|
|
+ pos=(0, 0))
|
|
|
|
+
|
|
|
|
+ self.fontlb = wx.ListBox(
|
|
|
|
+ parent=panel,
|
|
|
|
+ id=wx.ID_ANY,
|
|
|
|
+ pos=wx.DefaultPosition,
|
|
|
|
+ choices=self.fontlist,
|
|
|
|
+ style=wx.LB_SINGLE)
|
|
self.Bind(wx.EVT_LISTBOX, self.EvtListBox, self.fontlb)
|
|
self.Bind(wx.EVT_LISTBOX, self.EvtListBox, self.fontlb)
|
|
self.Bind(wx.EVT_LISTBOX_DCLICK, self.EvtListBoxDClick, self.fontlb)
|
|
self.Bind(wx.EVT_LISTBOX_DCLICK, self.EvtListBoxDClick, self.fontlb)
|
|
|
|
|