summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlhan Yesil <ilhanyesil@gmx.de>2020-12-14 17:39:55 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-05-18 15:28:37 +0200
commita939574a8d229a45ef92262bf0f02f1ec1903125 (patch)
tree38bd67e69c810e1931d9f63d988a2d33261cba9a
parentb099da78a6f0b3e120f706714003b05d84d11e70 (diff)
tdf#138901 Refresh button tooltip in sidebar created by extensiondistro/lhm/libreoffice-6-4+backports
The button's tooltip is refreshed after setting the button's text. Change-Id: I08f272c43c3312d462981d46ab961ef925eeccbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107718 Tested-by: Jenkins Reviewed-by: Ilhan Yesil <ilhanyesil@gmx.de> (cherry picked from commit f1d9648b5196eacac080a2a4db42c06829554107) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114292 Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rw-r--r--vcl/source/control/button.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index a4ae36cffe15..5607a62d833a 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -77,6 +77,7 @@ public:
long mnSeparatorX;
DrawButtonFlags mnButtonState;
bool mbSmallSymbol;
+ bool mbGeneratedTooltip;
Image maImage;
ImageAlign meImageAlign;
@@ -87,7 +88,7 @@ public:
};
ImplCommonButtonData::ImplCommonButtonData() : maFocusRect(), mnSeparatorX(0), mnButtonState(DrawButtonFlags::NONE),
-mbSmallSymbol(false), maImage(), meImageAlign(ImageAlign::Top), meSymbolAlign(SymbolAlign::LEFT)
+mbSmallSymbol(false), mbGeneratedTooltip(false), maImage(), meImageAlign(ImageAlign::Top), meSymbolAlign(SymbolAlign::LEFT)
{
}
@@ -219,8 +220,13 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos,
tools::Rectangle textRect = GetTextRect(
tools::Rectangle(Point(), Size(0x7fffffff, 0x7fffffff)), aText, nTextStyle);
// If the button text doesn't fit into it, put it into a tooltip (might happen in sidebar)
+ if (GetQuickHelpText()!= aText && mpButtonData->mbGeneratedTooltip)
+ SetQuickHelpText("");
if (GetQuickHelpText().isEmpty() && textRect.getWidth() > rSize.getWidth())
+ {
SetQuickHelpText(aText);
+ mpButtonData->mbGeneratedTooltip = true;
+ }
ImplSetFocusRect(aOutRect);
rSize = aOutRect.GetSize();