Skip to content
Snippets Groups Projects
Commit d76f7418 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Tooltips added to OverlayDisplayToolBar

parent fff73ac2
No related branches found
No related tags found
No related merge requests found
...@@ -15,51 +15,115 @@ import wx ...@@ -15,51 +15,115 @@ import wx
import props import props
import fsl.fsleyes.toolbar as fsltoolbar import fsl.fsleyes.toolbar as fsltoolbar
import fsl.fsleyes.icons as icons import fsl.fsleyes.icons as icons
import fsl.fsleyes.actions as actions import fsl.fsleyes.tooltips as fsltooltips
import fsl.utils.typedict as td import fsl.fsleyes.actions as actions
import fsl.data.strings as strings import fsl.utils.typedict as td
import overlaydisplaypanel as overlaydisplay import fsl.data.strings as strings
import overlaydisplaypanel as overlaydisplay
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
_TOOLTIPS = td.TypeDict({
'Display.name' : fsltooltips.properties['Display.name'],
'Display.overlayType' : fsltooltips.properties['Display.overlayType'],
'Display.alpha' : fsltooltips.properties['Display.alpha'],
'Display.brightness' : fsltooltips.properties['Display.brightness'],
'Display.contrast' : fsltooltips.properties['Display.contrast'],
'VolumeOpts.displayRange' : fsltooltips.properties['VolumeOpts.'
'displayRange'],
'VolumeOpts.resetDisplayRange' : fsltooltips.actions[ 'VolumeOpts.reset'
'DisplayRange'],
'VolumeOpts.cmap' : fsltooltips.properties['VolumeOpts.cmap'],
'MaskOpts.threshold' : fsltooltips.properties['MaskOpts.threshold'],
'MaskOpts.colour' : fsltooltips.properties['MaskOpts.colour'],
'LabelOpts.lut' : fsltooltips.properties['LabelOpts.lut'],
'LabelOpts.outline' : fsltooltips.properties['LabelOpts.outline'],
'LabelOpts.outlineWidth' : fsltooltips.properties['LabelOpts.'
'outlineWidth'],
'RGBVectorOpts.modulate' : fsltooltips.properties['VectorOpts.'
'modulate'],
'RGBVectorOpts.modThreshold' : fsltooltips.properties['VectorOpts.'
'modThreshold'],
'LineVectorOpts.modulate' : fsltooltips.properties['VectorOpts.'
'modulate'],
'LineVectorOpts.modThreshold' : fsltooltips.properties['VectorOpts.'
'modThreshold'],
'LineVectorOpts.lineWidth' : fsltooltips.properties['LineVectorOpts.'
'lineWidth'],
'ModelOpts.colour' : fsltooltips.properties['ModelOpts.colour'],
'ModelOpts.outline' : fsltooltips.properties['ModelOpts.outline'],
'ModelOpts.outlineWidth' : fsltooltips.properties['ModelOpts.'
'outlineWidth'],
})
_TOOLBAR_PROPS = td.TypeDict({ _TOOLBAR_PROPS = td.TypeDict({
'Display' : { 'Display' : {
'name' : props.Widget('name'), 'name' : props.Widget(
'overlayType' : props.Widget('overlayType'), 'name',
'alpha' : props.Widget('alpha', tooltip=_TOOLTIPS['Display.name']),
spin=False, 'overlayType' : props.Widget(
showLimits=False), 'overlayType',
'brightness' : props.Widget('brightness', tooltip=_TOOLTIPS['Display.overlayType']),
spin=False, 'alpha' : props.Widget(
showLimits=False), 'alpha',
'contrast' : props.Widget('contrast', spin=False,
spin=False, showLimits=False,
showLimits=False)}, tooltip=_TOOLTIPS['Display.alpha']),
'brightness' : props.Widget(
'brightness',
spin=False,
showLimits=False,
tooltip=_TOOLTIPS['Display.brightness']),
'contrast' : props.Widget(
'contrast',
spin=False,
showLimits=False,
tooltip=_TOOLTIPS['Display.contrast'])},
'VolumeOpts' : { 'VolumeOpts' : {
'displayRange' : props.Widget('displayRange', 'displayRange' : props.Widget(
slider=False, 'displayRange',
showLimits=False), slider=False,
showLimits=False,
tooltip=_TOOLTIPS['VolumeOpts.displayRange']),
'resetDisplayRange' : actions.ActionButton( 'resetDisplayRange' : actions.ActionButton(
'resetDisplayRange', 'resetDisplayRange',
icon=icons.findImageFile('verticalReset24')), icon=icons.findImageFile('verticalReset24'),
'cmap' : props.Widget('cmap')}, tooltip=_TOOLTIPS['VolumeOpts.resetDisplayRange']),
'cmap' : props.Widget(
'cmap',
tooltip=_TOOLTIPS['VolumeOpts.cmap'])},
'MaskOpts' : { 'MaskOpts' : {
'threshold' : props.Widget('threshold', showLimits=False, spin=False), 'threshold' : props.Widget(
'colour' : props.Widget('colour', size=(24, 24))}, 'threshold',
showLimits=False,
spin=False,
tooltip=_TOOLTIPS['MaskOpts.threshold']),
'colour' : props.Widget(
'colour',
size=(24, 24),
tooltip=_TOOLTIPS['MaskOpts.colour'])},
'LabelOpts' : { 'LabelOpts' : {
'lut' : props.Widget('lut'), 'lut' : props.Widget(
'lut',
tooltip=_TOOLTIPS['LabelOpts.lut']),
'outline' : props.Widget( 'outline' : props.Widget(
'outline', 'outline',
tooltip=_TOOLTIPS['LabelOpts.outline'],
icon=[icons.findImageFile('outline24'), icon=[icons.findImageFile('outline24'),
icons.findImageFile('filled24')], icons.findImageFile('filled24')],
toggle=True, toggle=True,
...@@ -68,29 +132,46 @@ _TOOLBAR_PROPS = td.TypeDict({ ...@@ -68,29 +132,46 @@ _TOOLBAR_PROPS = td.TypeDict({
'outlineWidth' : props.Widget( 'outlineWidth' : props.Widget(
'outlineWidth', 'outlineWidth',
tooltip=_TOOLTIPS['LabelOpts.outlineWidth'],
enabledWhen=lambda i, sw: not sw, enabledWhen=lambda i, sw: not sw,
dependencies=[(lambda o: o.display, 'softwareMode')], dependencies=[(lambda o: o.display, 'softwareMode')],
showLimits=False, showLimits=False,
spin=False)}, spin=False)},
'RGBVectorOpts' : { 'RGBVectorOpts' : {
'modulate' : props.Widget('modulate'), 'modulate' : props.Widget(
'modThreshold' : props.Widget('modThreshold', 'modulate',
showLimits=False, tooltip=_TOOLTIPS['RGBVectorOpts.modulate']),
spin=False)}, 'modThreshold' : props.Widget(
'modThreshold',
showLimits=False,
spin=False,
tooltip=_TOOLTIPS['RGBVectorOpts.modThreshold'])},
'LineVectorOpts' : { 'LineVectorOpts' : {
'modulate' : props.Widget('modulate'), 'modulate' : props.Widget(
'modThreshold' : props.Widget('modThreshold', 'modulate',
showLimits=False, tooltip=_TOOLTIPS['LineVectorOpts.modulate']),
spin=False), 'modThreshold' : props.Widget(
'lineWidth' : props.Widget('lineWidth', showLimits=False, spin=False), 'modThreshold',
showLimits=False,
spin=False,
tooltip=_TOOLTIPS['LineVectorOpts.modThreshold']),
'lineWidth' : props.Widget(
'lineWidth',
showLimits=False,
spin=False,
tooltip=_TOOLTIPS['LineVectorOpts.lineWidth']),
}, },
'ModelOpts' : { 'ModelOpts' : {
'colour' : props.Widget('colour', size=(24, 24)), 'colour' : props.Widget(
'colour',
size=(24, 24),
tooltip=_TOOLTIPS['ModelOpts.colour']),
'outline' : props.Widget( 'outline' : props.Widget(
'outline', 'outline',
tooltip=_TOOLTIPS['ModelOpts.outline'],
icon=[icons.findImageFile('outline24'), icon=[icons.findImageFile('outline24'),
icons.findImageFile('filled24')], icons.findImageFile('filled24')],
toggle=True), toggle=True),
...@@ -98,6 +179,7 @@ _TOOLBAR_PROPS = td.TypeDict({ ...@@ -98,6 +179,7 @@ _TOOLBAR_PROPS = td.TypeDict({
'outlineWidth', 'outlineWidth',
showLimits=False, showLimits=False,
spin=False, spin=False,
tooltip=_TOOLTIPS['ModelOpts.outlineWidth'],
enabledWhen=lambda i: i.outline)} enabledWhen=lambda i: i.outline)}
}) })
...@@ -392,7 +474,9 @@ class OverlayDisplayToolBar(fsltoolbar.FSLEyesToolBar): ...@@ -392,7 +474,9 @@ class OverlayDisplayToolBar(fsltoolbar.FSLEyesToolBar):
self, self,
self, self,
view=actions.ActionButton( view=actions.ActionButton(
'more', icon=icons.findImageFile('gear24'))) 'more',
icon=icons.findImageFile('gear24'),
tooltip=fsltooltips.actions[self, 'more']))
tools.insert(0, more) tools.insert(0, more)
......
...@@ -360,6 +360,11 @@ actions = TypeDict({ ...@@ -360,6 +360,11 @@ actions = TypeDict({
'from the current selection', 'from the current selection',
'OrthoEditProfile.createROIFromSelection' : 'Create a new ROI overlay ' 'OrthoEditProfile.createROIFromSelection' : 'Create a new ROI overlay '
'from the current selection', 'from the current selection',
'VolumeOpts.resetDisplayRange' : 'Reset the display range '
'to the data range.',
'OverlayDisplayToolBar.more' : 'Show more overlay display settings.',
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment