Skip to content

Commit

Permalink
Merge pull request #832 from lukatolo/small-ui-fixes
Browse files Browse the repository at this point in the history
Small UI fixes
  • Loading branch information
rmatsuda authored Aug 28, 2024
2 parents d47d0f1 + 71c843d commit 17bbb1b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
12 changes: 6 additions & 6 deletions invesalius/gui/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,22 +504,22 @@ def __init__(self, parent, navigation, tracker, pedal_connector, neuronavigation

lbl = wx.StaticText(self, -1, _("Current Configuration:"))
lbl.SetFont(wx.Font(9, wx.DEFAULT, wx.NORMAL, wx.BOLD))
lbl_new = wx.StaticText(self, -1, _("Create new configuration: "))
lbl_load = wx.StaticText(self, -1, _("Load configuration from file: "))
lbl_save = wx.StaticText(self, -1, _("Save configuration to file: "))

# Empty cell for the grid sizer
empty_cell = (0, 0)

load_sizer = wx.StaticBoxSizer(wx.VERTICAL, self, _("TMS coil registration"))
inner_load_sizer = wx.FlexGridSizer(2, 4, 5)
inner_load_sizer.AddMany(
[
(lbl, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 5),
(config_txt, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 5),
(lbl_new, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 5),
(btn_new, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 5),
(lbl_load, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 5),
empty_cell,
(btn_load, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 5),
(lbl_save, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 5),
empty_cell,
(btn_save, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 5),
empty_cell,
]
)
load_sizer.Add(inner_load_sizer, 0, wx.ALL | wx.EXPAND, 10)
Expand Down
26 changes: 14 additions & 12 deletions invesalius/gui/task_navigator.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,19 +436,19 @@ def __init__(self, parent, nav_hub):

sizer = wx.GridBagSizer(5, 5)
sizer.Add(
self.btns_set_fiducial[0], # Left Ear
self.btns_set_fiducial[0], # Left Ear
wx.GBPosition(1, 0),
span=wx.GBSpan(1, 2),
flag=wx.ALIGN_CENTER_VERTICAL,
)
sizer.Add(
self.btns_set_fiducial[2], # Nasion
self.btns_set_fiducial[2], # Nasion
wx.GBPosition(0, 2),
span=wx.GBSpan(1, 2),
flag=wx.ALIGN_CENTER_HORIZONTAL,
)
sizer.Add(
self.btns_set_fiducial[1], # Right Ear
self.btns_set_fiducial[1], # Right Ear
wx.GBPosition(1, 3),
span=wx.GBSpan(1, 2),
flag=wx.ALIGN_CENTER_VERTICAL,
Expand Down Expand Up @@ -672,19 +672,19 @@ def __init__(self, parent, nav_hub):

sizer = wx.GridBagSizer(5, 5)
sizer.Add(
self.fiducial_buttons[0], # Left Ear
self.fiducial_buttons[0], # Left Ear
wx.GBPosition(1, 0),
span=wx.GBSpan(1, 2),
flag=wx.ALIGN_CENTER_VERTICAL,
)
sizer.Add(
self.fiducial_buttons[2], # Nasion
self.fiducial_buttons[2], # Nasion
wx.GBPosition(0, 2),
span=wx.GBSpan(1, 2),
flag=wx.ALIGN_CENTER_HORIZONTAL,
)
sizer.Add(
self.fiducial_buttons[1], # Right Ear
self.fiducial_buttons[1], # Right Ear
wx.GBPosition(1, 3),
span=wx.GBSpan(1, 2),
flag=wx.ALIGN_CENTER_VERTICAL,
Expand Down Expand Up @@ -730,7 +730,9 @@ def UpdateElements(self):
def StartRegistration(self):
if not self.tracker.IsTrackerInitialized():
self.start_button.SetValue(False)
dlg.ShowNavigationTrackerWarning(0, "choose")
# Open the tracker page in preferences
Publisher.sendMessage("Open preferences menu", page=2)
self.StartRegistration()
return

self.registration_on = True
Expand Down Expand Up @@ -1165,7 +1167,7 @@ def __init__(self, parent, nav_hub):

# Toggle button for neuronavigation
tooltip = _("Start navigation")
btn_nav = wx.ToggleButton(self, -1, _("Start neuronavigation"), size=wx.Size(80, -1))
btn_nav = wx.ToggleButton(self, -1, _("Start navigation"), size=wx.Size(80, -1))
btn_nav.SetFont(wx.Font(9, wx.DEFAULT, wx.NORMAL, wx.BOLD))
btn_nav.SetToolTip(tooltip)
self.btn_nav = btn_nav
Expand Down Expand Up @@ -1491,15 +1493,15 @@ def OnStartNavigationButton(self, evt, btn_nav):
nav_id = btn_nav.GetValue()
if not nav_id:
wx.CallAfter(Publisher.sendMessage, "Stop navigation")
tooltip = _("Start neuronavigation")
tooltip = _("Start navigation")
btn_nav.SetToolTip(tooltip)
btn_nav.SetLabelText(_("Start neuronavigation"))
btn_nav.SetLabelText(_("Start navigation"))
else:
Publisher.sendMessage("Start navigation")
if self.nav_status:
tooltip = _("Stop neuronavigation")
tooltip = _("Stop navigation")
btn_nav.SetToolTip(tooltip)
btn_nav.SetLabelText(_("Stop neuronavigation"))
btn_nav.SetLabelText(_("Stop navigation"))
else:
btn_nav.SetValue(False)

Expand Down

0 comments on commit 17bbb1b

Please sign in to comment.