From 6820d18e118d8166c72832aef8c2f2ee52721838 Mon Sep 17 00:00:00 2001 From: Martin Vermeer Date: Tue, 12 Feb 2008 09:11:06 +0000 Subject: [PATCH] Tooltips for collapsables and branches git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22956 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetBranch.cpp | 6 ++++++ src/insets/InsetBranch.h | 2 ++ src/insets/InsetCollapsable.cpp | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) 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_) {