Skip to content

Instantly share code, notes, and snippets.

@irisdyoung
Last active April 29, 2018 07:47
Show Gist options
  • Save irisdyoung/4569d013a449d87d0de3a23edd82e475 to your computer and use it in GitHub Desktop.
Save irisdyoung/4569d013a449d87d0de3a23edd82e475 to your computer and use it in GitHub Desktop.
XFEL UI resize for MFX displays
diff --git a/xfel/ui/components/xfel_gui_controls.py b/xfel/ui/components/xfel_gui_controls.py
index 2961dc5..02dca03 100644
--- a/xfel/ui/components/xfel_gui_controls.py
+++ b/xfel/ui/components/xfel_gui_controls.py
@@ -642,13 +642,13 @@ class RunBlock(CtrlBase):
class PHILBox(CtrlBase):
def __init__(self, parent,
btn_import=True,
- btn_import_size=(120, -1),
+ btn_import_size=(150, -1),
btn_import_label='Import PHIL',
btn_export=False,
- btn_export_size=(120, -1),
+ btn_export_size=(150, -1),
btn_export_label='Export PHIL',
btn_default=True,
- btn_default_size=(120, -1),
+ btn_default_size=(150, -1),
btn_default_label='Default PHIL',
ctr_size=(-1, 125),
ctr_value='',
diff --git a/xfel/ui/components/xfel_gui_dialogs.py b/xfel/ui/components/xfel_gui_dialogs.py
index b8b446d..850bf26 100644
--- a/xfel/ui/components/xfel_gui_dialogs.py
+++ b/xfel/ui/components/xfel_gui_dialogs.py
@@ -94,7 +94,7 @@ class SettingsDialog(BaseDialog):
BaseDialog.__init__(self, parent,
label_style=label_style,
content_style=content_style,
- size=(600, 230),
+ size=(600, 300),
*args, **kwargs)
self.params = params
@@ -109,7 +109,7 @@ class SettingsDialog(BaseDialog):
label_size=(150, -1),
big_button=True,
big_button_label='DB Credentials...',
- big_button_size=(130, -1),
+ big_button_size=(200, -1),
value=self.params.experiment_tag if self.params.experiment_tag is not None else "")
self.main_sizer.Add(self.db_cred,
flag=wx.EXPAND | wx.ALL,
@@ -322,6 +322,7 @@ class AdvancedSettingsDialog(BaseDialog):
label='Multiprocessing:',
label_size=(180, -1),
label_style='bold',
+ ctrl_size=(170, -1),
choices=choices)
self.mp_sizer.Add(self.mp_option, flag=wx.EXPAND | wx.ALL, border=10)
try:
@@ -336,6 +337,7 @@ class AdvancedSettingsDialog(BaseDialog):
label='Queue:',
label_size=(180, -1),
label_style='bold',
+ ctrl_size=(170, -1),
choices=queues)
self.Bind(wx.EVT_CHOICE, self.onQueueChoice, self.queue.ctr)
self.mp_sizer.Add(self.queue, flag=wx.EXPAND | wx.ALL, border=10)
@@ -380,7 +382,7 @@ class AdvancedSettingsDialog(BaseDialog):
label='Processing back end:',
label_size=(180, -1),
label_style='bold',
- ctrl_size=(200, -1),
+ ctrl_size=(230, -1),
choices=self.back_ends)
self.Bind(wx.EVT_CHOICE, self.onBackendChoice)
self.dispatchers_sizer.Add(self.back_end, flag=wx.ALIGN_LEFT)
@@ -404,7 +406,7 @@ class AdvancedSettingsDialog(BaseDialog):
label='Avg. Image Type:',
label_size=(180, -1),
label_style='bold',
- ctrl_size=(200, -1),
+ ctrl_size=(230, -1),
choices=img_types)
if params.average_raw_data:
i = img_types.index('raw')
@@ -864,7 +866,7 @@ class MultiRunTagDialog(BaseDialog):
self.button_sizer = wx.BoxSizer(wx.HORIZONTAL)
self.btn_add_tags = wx.Button(self.button_panel, size=(115, -1),
label='Add tags')
- self.btn_remove_tags = wx.Button(self.button_panel, size=(115, -1),
+ self.btn_remove_tags = wx.Button(self.button_panel, size=(130, -1),
label='Remove tags')
self.button_sizer.Add(self.btn_add_tags,
flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP,
@@ -985,11 +987,11 @@ class TagDialog(BaseDialog):
self.button_panel = wx.Panel(self)
self.button_sizer = wx.BoxSizer(wx.VERTICAL)
- self.btn_add = wx.Button(self.button_panel, size=(120, -1),
+ self.btn_add = wx.Button(self.button_panel, size=(130, -1),
label='Add Tag')
- self.btn_rmv = wx.Button(self.button_panel, size=(120, -1),
+ self.btn_rmv = wx.Button(self.button_panel, size=(130, -1),
label='Remove Tags')
- self.btn_clr = wx.Button(self.button_panel, size=(120, -1),
+ self.btn_clr = wx.Button(self.button_panel, size=(130, -1),
label='Clear All')
self.button_sizer.Add(self.btn_add)
self.button_sizer.Add(self.btn_rmv)
@@ -1187,7 +1189,7 @@ class RunBlockDialog(BaseDialog):
runblock_box = wx.StaticBox(self, label='Options')
self.runblock_box_sizer = wx.StaticBoxSizer(runblock_box, wx.VERTICAL)
- self.runblock_panel = ScrolledPanel(self, size=(550, 225))
+ self.runblock_panel = ScrolledPanel(self, size=(620, 225))
self.runblock_sizer = wx.BoxSizer(wx.VERTICAL)
self.runblock_panel.SetSizer(self.runblock_sizer)
@@ -1198,7 +1200,7 @@ class RunBlockDialog(BaseDialog):
btn_export=False,
btn_default=True,
btn_default_label='Default Config',
- ctr_size=(-1, 100),
+ ctr_size=(-1, 140),
ctr_value=str(block.config_str))
self.config_sizer.Add(self.config, 1, flag=wx.EXPAND | wx.ALL, border=10)
@@ -1209,7 +1211,7 @@ class RunBlockDialog(BaseDialog):
btn_export=False,
btn_default=True,
btn_default_label='Default PHIL',
- ctr_size=(-1, 100),
+ ctr_size=(-1, 140),
ctr_value=str(block.extra_phil_str))
self.phil_sizer.Add(self.phil, 1, flag=wx.EXPAND | wx.ALL, border=10)
@@ -1665,7 +1667,7 @@ class SelectRunBlocksDialog(BaseDialog):
self.runblocks_list = gctr.CheckListCtrl(self.runblocks_panel,
label='Select runblocks',
- label_size=(40, -1),
+ label_size=(150, -1),
label_style='normal',
ctrl_size=(450, 350),
choices=choices)
diff --git a/xfel/ui/components/xfel_gui_init.py b/xfel/ui/components/xfel_gui_init.py
index 8b65224..3f53bdf 100644
--- a/xfel/ui/components/xfel_gui_init.py
+++ b/xfel/ui/components/xfel_gui_init.py
@@ -1289,9 +1289,9 @@ class RunTab(BaseTab):
self.colname_sizer.AddGrowableCol(1, 1)
self.main_sizer.Add(self.colname_sizer, flag=wx.ALL | wx.EXPAND, border=10)
- self.btn_multirun_tags = wx.Button(self, label='Change Tags on Multiple Runs', size=(240, -1))
+ self.btn_multirun_tags = wx.Button(self, label='Change Tags on Multiple Runs', size=(310, -1))
self.btn_persistent_tags = wx.Button(self, label='Manage Persistent Tags', size=(240, -1))
- self.btn_manage_tags = wx.Button(self, label='Manage Tags', size=(120, -1))
+ self.btn_manage_tags = wx.Button(self, label='Manage Tags', size=(150, -1))
self.main_sizer.Add(self.run_panel, 1, flag=wx.EXPAND | wx.ALL, border=10)
self.main_sizer.Add(wx.StaticLine(self), flag=wx.EXPAND | wx.ALL, border=10)
@@ -1403,7 +1403,7 @@ class TrialsTab(BaseTab):
self.btn_add_trial = wx.Button(self, label='New Trial', size=(120, -1))
self.btn_active_only = wx.ToggleButton(self,
label='Show Only Active Trials',
- size=(180, self.btn_add_trial.GetSize()[1]))
+ size=(250, self.btn_add_trial.GetSize()[1]))
self.btn_sizer.Add(self.btn_active_only, flag=wx.ALIGN_RIGHT)
self.btn_sizer.Add(self.btn_add_trial)
@@ -1477,9 +1477,9 @@ class JobsTab(BaseTab):
self.trial_choice = gctr.ChoiceCtrl(self,
label='Filter by:',
- label_size=(60, -1),
+ label_size=(50, -1),
label_style='normal',
- ctrl_size=(100, -1),
+ ctrl_size=(120, -1),
choices=[])
self.btn_stop_job = wx.Button(self, label='Stop job', size=(120, -1))
self.btn_delete_job = wx.Button(self, label='Delete job', size=(120, -1))
@@ -1712,20 +1712,20 @@ class SpotfinderTab(BaseTab):
self.trial_number = gctr.ChoiceCtrl(self,
label='Trial:',
- label_size=(90, -1),
+ label_size=(130, -1),
label_style='normal',
- ctrl_size=(100, -1),
+ ctrl_size=(110, -1),
choices=[])
self.last_five_runs = wx.Button(self,
label='Auto plot last five runs',
- size=(200, -1))
+ size=(250, -1))
self.plot_entire_expt = wx.Button(self,
- label='Auto plot entire experiment',
- size=(200,-1))
+ label='Auto plot entire expt',
+ size=(250,-1))
self.n_min_selector = gctr.OptionCtrl(self,
label='minimum # spots:',
- label_size=(160, -1),
- ctrl_size=(30, -1),
+ label_size=(180, -1),
+ ctrl_size=(60, -1),
items=[('n_min', 4)])
self.run_numbers = gctr.CheckListCtrl(self,
label='Selected runs:',
@@ -1932,45 +1932,45 @@ class RunStatsTab(SpotfinderTab):
self.trial_number = gctr.ChoiceCtrl(self,
label='Trial:',
- label_size=(90, -1),
+ label_size=(130, -1),
label_style='normal',
- ctrl_size=(100, -1),
+ ctrl_size=(110, -1),
choices=[])
self.last_five_runs = wx.Button(self,
label='Auto plot last five runs',
- size=(200, -1))
+ size=(250, -1))
self.plot_entire_expt = wx.Button(self,
- label='Auto plot entire experiment',
- size=(200,-1))
+ label='Auto plot entire expt',
+ size=(250,-1))
self.d_min_select = gctr.OptionCtrl(self,
label='high resolution limit:',
- label_size=(160, -1),
- ctrl_size=(30, -1),
+ label_size=(180, -1),
+ ctrl_size=(60, -1),
items=[('d_min', 2.5)])
self.n_multiples_selector = gctr.OptionCtrl(self,
label='# multiples threshold:',
- label_size=(160, -1),
- ctrl_size=(30, -1),
+ label_size=(180, -1),
+ ctrl_size=(60, -1),
items=[('multiples', 2)])
self.ratio_cutoff = gctr.OptionCtrl(self,
label='two theta ratio cutoff:',
- label_size=(160, -1),
- ctrl_size=(30, -1),
+ label_size=(180, -1),
+ ctrl_size=(60, -1),
items=[('ratio', 1)])
self.n_strong_cutoff = gctr.OptionCtrl(self,
label='# strong spots cutoff:',
- label_size=(160, -1),
- ctrl_size=(30, -1),
+ label_size=(180, -1),
+ ctrl_size=(60, -1),
items=[('n_strong', 40)])
self.i_sigi_cutoff = gctr.OptionCtrl(self,
label='I/sig(I) cutoff:',
- label_size=(160, -1),
- ctrl_size=(30, -1),
+ label_size=(180, -1),
+ ctrl_size=(60, -1),
items=[('isigi', 1)])
self.n_dump_cutoff = gctr.OptionCtrl(self,
label='# images to dump:',
- label_size=(160, -1),
- ctrl_size=(30, -1),
+ label_size=(180, -1),
+ ctrl_size=(60, -1),
items=[('n_dump', 10)])
self.run_numbers = gctr.CheckListCtrl(self,
label='Selected runs:',
@@ -2027,7 +2027,7 @@ class RunStatsTab(SpotfinderTab):
self.strong_indexed_results_sizer = wx.GridBagSizer(1, 1)
self.strong_indexed_results_sizer.Add(self.strong_indexed_list, pos=(0, 0),
- span=(5, 45),
+ span=(5, 65),
flag=wx.LEFT | wx.RIGHT | wx.EXPAND,
border=10)
self.strong_indexed_box_sizer.Add(self.strong_indexed_results_sizer)
@@ -2041,7 +2041,7 @@ class RunStatsTab(SpotfinderTab):
self.should_have_indexed_results_sizer = wx.GridBagSizer(1, 1)
self.should_have_indexed_results_sizer.Add(self.should_have_indexed_list, pos=(0, 0),
- span=(5, 45),
+ span=(5, 65),
flag=wx.LEFT | wx.RIGHT | wx.EXPAND,
border=10)
self.should_have_indexed_box_sizer.Add(self.should_have_indexed_results_sizer)
@@ -2287,7 +2287,7 @@ class UnitCellTab(BaseTab):
self.tab_sizer = wx.BoxSizer(wx.HORIZONTAL)
# self.tab_panel.SetSizer(self.tab_sizer)
- self.selection_columns_panel = wx.Panel(self, size=(230, 120))
+ self.selection_columns_panel = wx.Panel(self, size=(250, 120))
self.selection_columns_box = wx.StaticBox(self.selection_columns_panel, label='Select tag sets')
self.selection_columns_sizer = wx.StaticBoxSizer(self.selection_columns_box, wx.VERTICAL)
self.selection_columns_panel.SetSizer(self.selection_columns_sizer)
@@ -2298,7 +2298,7 @@ class UnitCellTab(BaseTab):
self.trial_number = gctr.ChoiceCtrl(self,
label='Trial:',
- label_size=(90, -1),
+ label_size=(120, -1),
label_style='normal',
ctrl_size=(100, -1),
choices=[])
@@ -2307,7 +2307,7 @@ class UnitCellTab(BaseTab):
label='Tags:',
label_size=(200, -1),
label_style='normal',
- ctrl_size=(150, 100),
+ ctrl_size=(230, 100),
direction='vertical',
choices=[])
@@ -2321,23 +2321,23 @@ class UnitCellTab(BaseTab):
self.add_sele_button = wx.Button(self.selection_columns_panel,
label='Add selection',
- size=(200, -1))
+ size=(210, -1))
self.tag_set_checklist = gctr.CheckListCtrl(self,
label='Tag sets:',
label_size=(200, -1),
label_style='normal',
- ctrl_size=(150, 100),
+ ctrl_size=(230, 100),
direction='vertical',
choices=[])
self.remove_sele_button = wx.Button(self.selection_columns_panel,
label='Remove selection',
- size=(200, -1))
+ size=(210, -1))
self.reset_sele_button = wx.Button(self.selection_columns_panel,
label='Reset selections',
- size=(200, -1))
+ size=(210, -1))
self.chk_reject_outliers = wx.CheckBox(self.selection_columns_panel, label='Reject outliers')
self.chk_reject_outliers.SetValue(True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment