Skip to content

Use tooltip metadata optionally instead of desc.#473

Merged
corranwebster merged 2 commits into
masterfrom
tooltip-trait
Jul 25, 2018
Merged

Use tooltip metadata optionally instead of desc.#473
corranwebster merged 2 commits into
masterfrom
tooltip-trait

Conversation

@prabhuramachandran
Copy link
Copy Markdown
Member

This implements the suggestion in #472. If a tooltip metadata
attribute exists for a trait, it is used as is for the tooltip,
otherwise the original behavior of using the 'Specifies' + item.desc
is used.

This implements the suggestion in #472.  If a `tooltip` metadata
attribute exists for a trait, it is used as is for the tooltip,
otherwise the original behavior of using the `'Specifies' + item.desc`
is used.
Copy link
Copy Markdown
Member

@rkern rkern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor docstring rewording requested, but otherwise LGTM!

Comment thread traitsui/qt4/ui_panel.py Outdated
of the item.desc string).
We also set the help on the QLabel control (from item.help) and the
tooltip (it item.desc exists; we add "Specifies " at the start of the
item.desc string, if item.tooltip exists we just use it as is).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would talk about tooltip first rather than second, in order to mirror the code's logic. There are also a couple of errors in the original text that should be fixed. This is how I would write the parenthetical:

(if the ``tooltip`` metadata on the edited trait exists, then it will be used as-is;
otherwise, if the ``desc`` metadata exists, the string "Specifies " will be
prepended to the start of ``desc``)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Done.

prabhuramachandran added a commit that referenced this pull request Jul 25, 2018
@corranwebster
Copy link
Copy Markdown
Contributor

LGTM

@corranwebster corranwebster merged commit fcd25ae into master Jul 25, 2018
@corranwebster corranwebster deleted the tooltip-trait branch July 25, 2018 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants