From c6a0b3ed9b76dcac0f588907d99596ff3354cd76 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 8 Jun 2017 22:37:19 +0300 Subject: [PATCH] Added: Show image tooltips even if not inside link --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 92b5dee3f..083e8df2d 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -1686,18 +1686,28 @@ namespace NLGUI if (present[MY_HTML_IMG_STYLE] && value[MY_HTML_IMG_STYLE]) getStyleParams(value[MY_HTML_IMG_STYLE], style); + // Tooltip + const char *tooltip = NULL; + // keep "alt" attribute for backward compatibility + if (present[MY_HTML_IMG_ALT] && value[MY_HTML_IMG_ALT]) + tooltip = value[MY_HTML_IMG_ALT]; + // tooltip + if (present[MY_HTML_IMG_TITLE] && value[MY_HTML_IMG_TITLE]) + tooltip = value[MY_HTML_IMG_TITLE]; + if (getA() && getParent () && getParent ()->getParent()) { - // Tooltip - const char *tooltip = NULL; - if (present[MY_HTML_IMG_ALT] && value[MY_HTML_IMG_ALT]) - tooltip = value[MY_HTML_IMG_ALT]; - string params = "name=" + getId() + "|url=" + getLink (); addButton(CCtrlButton::PushButton, value[MY_HTML_IMG_SRC], value[MY_HTML_IMG_SRC], value[MY_HTML_IMG_SRC], "", "browse", params.c_str(), tooltip, style); } else + if (tooltip) + { + addButton(CCtrlButton::PushButton, value[MY_HTML_IMG_SRC], value[MY_HTML_IMG_SRC], value[MY_HTML_IMG_SRC], + "", "", "", tooltip, style); + } + else { // Get the option to reload (class==reload) bool reloadImg = false;