mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Fix crash while InsetInfo hovering by replacing the hover message with a tooltip.
Note to all: NEVER send a message inside a draw() method! This triggers a recursive painting of the status bar with Qt4.4 ! git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25112 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9d469100d0
commit
4f2a7a953b
@ -62,16 +62,18 @@ Inset * InsetInfo::editXY(Cursor &, int, int)
|
||||
void InsetInfo::draw(PainterInfo & pi, int x, int y) const
|
||||
{
|
||||
InsetText::draw(pi, x, y);
|
||||
if (mouse_hover_) {
|
||||
odocstringstream os;
|
||||
os << _("Information regarding ")
|
||||
<<_(nameTranslator().find(type_))
|
||||
<< " " << from_utf8(name_);
|
||||
pi.base.bv->message(os.str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
docstring InsetInfo::toolTip(BufferView const & bv, int x, int y) const
|
||||
{
|
||||
odocstringstream os;
|
||||
os << _("Information regarding ")
|
||||
<< _(nameTranslator().find(type_))
|
||||
<< " " << from_utf8(name_);
|
||||
return os.str();
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
Translator<InsetInfo::info_type, string> const initTranslator()
|
||||
|
@ -106,6 +106,8 @@ public:
|
||||
void updateInfo();
|
||||
///
|
||||
bool setMouseHover(bool mouse_hover);
|
||||
///
|
||||
docstring toolTip(BufferView const & bv, int x, int y) const;
|
||||
|
||||
private:
|
||||
/// The translator between the information type enum and corresponding string.
|
||||
|
Loading…
Reference in New Issue
Block a user