@@ -862,6 +862,8 @@ def __init__(self, parent, options=None):
862862 self .setWindowTitle ('Preferences' )
863863 self .resize (700 , 200 )
864864 self .setGeometry (QtCore .QRect (300 ,300 , 600 , 200 ))
865+ self .setMaximumWidth (600 )
866+ self .setMaximumHeight (300 )
865867 self .createWidgets ()
866868 self .show ()
867869 return
@@ -872,16 +874,15 @@ def createWidgets(self):
872874 import pylab as plt
873875 colormaps = sorted (m for m in plt .cm .datad if not m .endswith ("_r" ))
874876 self .opts = {'rowheight' :{'type' :'spinbox' ,'default' :18 ,'range' :(5 ,50 ),'label' :'row height' },
875- 'cellwidth' :{'type' :'spinbox' ,'default' :80 ,'range' :(10 ,300 ),'label' :'cell width' },
876- 'linewidth' :{'type' :'spinbox' ,'default' :1 ,'range' :(1 ,10 ),'label' :'grid line width' },
877- 'align' :{'type' :'combobox' ,'default' :'w' ,'items' :['w' ,'e' ,'center' ],'label' :'text align' },
877+ #'cellwidth':{'type':'spinbox','default':80,'range':(10,300),'label':'cell width'},
878+ 'alignment' :{'type' :'combobox' ,'default' :'w' ,'items' :['left' ,'right' ,'center' ],'label' :'text align' },
878879 'font' :{'type' :'font' ,'default' :'Arial' ,'default' :core .font },
879- 'fontstyle' :{'type' :'combobox' ,'default' :'' ,'items' :['' ,'bold' ,'italic' ]},
880+ # 'fontstyle':{'type':'combobox','default':'','items':['','bold','italic']},
880881 'fontsize' :{'type' :'slider' ,'default' :core .fontsize ,'range' :(5 ,40 ),'interval' :1 ,'label' :'font size' },
881882 'floatprecision' :{'type' :'spinbox' ,'default' :2 , 'label' :'precision' },
882883 }
883- sections = {'table' :['align ' ,'rowheight' , 'cellwidth' , 'linewidth ' ],
884- 'formats' :['font' ,'fontstyle' , ' fontsize' ,'floatprecision' ]}
884+ sections = {'table' :['alignment ' ,'rowheight' ],
885+ 'formats' :['font' ,'fontsize' ,'floatprecision' ]}
885886
886887 dialog , self .widgets = dialogFromOptions (self , self .opts , sections )
887888
@@ -896,9 +897,6 @@ def createButtons(self, parent):
896897
897898 bw = self .button_widget = QWidget (parent )
898899 vbox = QHBoxLayout (bw )
899- #button = QPushButton("Save")
900- #button.clicked.connect(self.save)
901- #vbox.addWidget(button)
902900 button = QPushButton ("Apply" )
903901 button .clicked .connect (self .apply )
904902 vbox .addWidget (button )
@@ -914,6 +912,8 @@ def apply(self):
914912 from . import core
915913 core .font = kwds ['font' ]
916914 core .fontsize = kwds ['fontsize' ]
915+ core .textalignment = kwds ['alignment' ]
916+ #core.fontstyle = kwds['fontstyle']
917917 self .parent .refresh ()
918918 return
919919
0 commit comments