From: Martin Vermeer Date: Tue, 12 Feb 2008 09:11:06 +0000 (+0000) Subject: Tooltips for collapsables and branches X-Git-Tag: 1.6.10~6309 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6820d18e118d8166c72832aef8c2f2ee52721838;p=features.git Tooltips for collapsables and branches git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22956 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp index 0eed816e60..f0efce791a 100644 --- a/src/insets/InsetBranch.cpp +++ b/src/insets/InsetBranch.cpp @@ -76,6 +76,12 @@ void InsetBranch::read(Buffer const & buf, Lexer & lex) } +docstring InsetBranch::toolTip(BufferView const & bv, int x, int y) const +{ + return _("Branch: ") + params_.branch; +} + + void InsetBranch::setButtonLabel() { docstring s = _("Branch: ") + params_.branch; diff --git a/src/insets/InsetBranch.h b/src/insets/InsetBranch.h index 30305d8235..c62fbdd52b 100644 --- a/src/insets/InsetBranch.h +++ b/src/insets/InsetBranch.h @@ -84,6 +84,8 @@ public: virtual void updateLabels(Buffer const &, ParIterator const &); /// bool isMacroScope(Buffer const & buf) const; + /// + docstring toolTip(BufferView const & bv, int x, int y) const; protected: /// InsetBranch(InsetBranch const &); diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index c4d16de4ec..051c4ed769 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -103,7 +103,9 @@ InsetCollapsable::InsetCollapsable(InsetCollapsable const & rhs) docstring InsetCollapsable::toolTip(BufferView const & bv, int x, int y) const { Dimension dim = dimensionCollapsed(); - if (x > xo(bv) + dim.wid || y > yo(bv) + dim.des) + if (geometry() == NoButton) + return layout_->labelstring; + else if (x > xo(bv) + dim.wid || y > yo(bv) + dim.des) return docstring(); switch (status_) {