summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2013-06-16 21:26:29 +0200
committerJan Holesovsky <kendy@suse.cz>2013-06-16 21:31:38 +0200
commit1abcfd8a9e5e0b4829c04cfea055a21021ca2ab1 (patch)
tree84e61a16a2ae317932112a6ea24ee74653793bb2
parent8eb89bc4becd2abb47eefbe26ecfd029df043538 (diff)
widget layout: Honor explicitly set tooltip text for toolbox items.
Change-Id: I067abb53783655dddc2130aa126dd032c803d58d
-rw-r--r--vcl/source/window/builder.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 7d44293f3196..542c4c56ddcf 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -652,6 +652,20 @@ namespace
return Size(sWidthRequest.toInt32(), sHeightRequest.toInt32());
}
+ OString extractTooltipText(VclBuilder::stringmap &rMap)
+ {
+ OString sTooltipText;
+ VclBuilder::stringmap::iterator aFind = rMap.find(OString("tooltip-text"));
+ if (aFind == rMap.end())
+ aFind = rMap.find(OString("tooltip-markup"));
+ if (aFind != rMap.end())
+ {
+ sTooltipText = aFind->second;
+ rMap.erase(aFind);
+ }
+ return sTooltipText;
+ }
+
Window * extractStockAndBuildPushButton(Window *pParent, VclBuilder::stringmap &rMap)
{
WinBits nBits = WB_CENTER|WB_VCENTER|WB_3DLOOK;
@@ -1272,14 +1286,20 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
if (pToolBox)
{
OUString aCommand(OStringToOUString(extractActionName(rMap), RTL_TEXTENCODING_UTF8));
+ OUString aTooltip(OStringToOUString(extractTooltipText(rMap), RTL_TEXTENCODING_UTF8));
ToolBoxItemBits nBits = 0;
if (name == "GtkMenuToolButton")
nBits |= TIB_DROPDOWN;
if (!aCommand.isEmpty())
+ {
pToolBox->InsertItem(aCommand, m_xFrame, nBits, extractSizeRequest(rMap));
+ if (!aTooltip.isEmpty())
+ pToolBox->SetQuickHelpText(pToolBox->GetItemId(aCommand), aTooltip);
+ }
+
return NULL; // no widget to be created
}
}