Skip to content

(GUI): add tooltips on views

Flavien BRIDAULT requested to merge 286-gui-add-tooltips-on-views into dev

What does this MR do?

A tooltip can now be set on any view of a cardinal or a line layout manager, optionally of course :

            <service uid="multiView" type="::gui::view::SDefaultView">
                <gui>
                    <layout type="::fwGui::LineLayoutManager">
                        <orientation value="horizontal" />
                        <view proportion="0" minWidth="30" toolTip="Amazing view" />
                        <view proportion="0" minWidth="50" />
                        <view proportion="1" toolTip="Please click me"/>
                    </layout>
                </gui>
                <registry>
                    <view sid="subview" start="yes" />
                    <view sid="button" start="yes" />
                    <view sid="button2" start="yes" />
                </registry>
            </service>

If the editor inside the view already has a tooltip, it will be not be overridden by this configuration, thus we do not break the existing tooltips.

Discussion

There might be a point of discussion about the homogeneity of the configuration. For the tool box layout manager, the xml attribute to set the tooltip is name and not toolTip.

How to test it?

TutoGui was modified to add two new buttons with tooltips, and also tooltips on some views.

Some results

image

Additional tests to run

  • Check that existing tooltips still display properly ?
Edited by Flavien BRIDAULT

Merge request reports