Changeset 3933ee9 in sasview


Ignore:
Timestamp:
Aug 14, 2018 9:40:46 AM (6 years ago)
Author:
Torin Cooper-Bennun <torin.cooper-bennun@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
4bf58293, 04ac604
Parents:
328f2ef
Message:

standardise monospace font for code editors, QT console

Location:
src/sas/qtgui/Utilities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Utilities/GuiUtils.py

    r685e0e3 r3933ee9  
    312312        return clone 
    313313 
     314 
     315def getMonospaceFont(): 
     316    """Convenience function; returns a monospace font to be used in any shells, code editors, etc.""" 
     317 
     318    # Note: Consolas is only available on Windows; the style hint is used on other operating systems 
     319    font = QtGui.QFont("Consolas", 10) 
     320    font.setStyleHint(QtGui.QFont.Monospace, QtGui.QFont.PreferQuality) 
     321    return font 
    314322 
    315323def createModelItemWithPlot(update_data, name=""): 
  • src/sas/qtgui/Utilities/IPythonWidget.py

    rfbfc488 r3933ee9  
    44 
    55from PyQt5 import QtSvg 
     6 
     7from sas.qtgui.Utilities import GuiUtils 
    68 
    79def new_load_qt(api_options): 
     
    3537        app = guisupport.get_app_qt4() 
    3638 
     39        font = GuiUtils.getMonospaceFont() 
     40        self.font = font 
     41 
    3742        # Create an in-process kernel 
    3843        kernel_manager = QtInProcessKernelManager() 
  • src/sas/qtgui/Utilities/ModelEditor.py

    r26970b3 r3933ee9  
    33 
    44from sas.qtgui.Utilities.UI.ModelEditor import Ui_ModelEditor 
     5from sas.qtgui.Utilities import GuiUtils 
    56 
    67class ModelEditor(QtWidgets.QDialog, Ui_ModelEditor): 
     
    3031        self.highlight = PythonHighlighter(self.txtEditor.document()) 
    3132 
     33        self.txtEditor.setFont(GuiUtils.getMonospaceFont()) 
     34 
    3235    def addSignals(self): 
    3336        """ 
  • src/sas/qtgui/Utilities/PluginDefinition.py

    r060413c r3933ee9  
    44 
    55from sas.qtgui.Utilities.UI.PluginDefinitionUI import Ui_PluginDefinition 
     6from sas.qtgui.Utilities import GuiUtils 
    67 
    78# txtName 
     
    6465""" 
    6566        self.txtFunction.insertPlainText(text) 
     67        self.txtFunction.setFont(GuiUtils.getMonospaceFont()) 
    6668 
    6769        # Validators 
Note: See TracChangeset for help on using the changeset viewer.