On Mon, Feb 11, 2008 at 03:15:35PM +0200, Martin Vermeer wrote:
> On Mon, 11 Feb 2008 10:29:16 +0100
> Abdelrazak Younes <[EMAIL PROTECTED]> wrote:
> 
> > Martin Vermeer wrote:
> > 
> > > BTW can we not have a tooltip when floating over the inset? Wouldn't
> > > take valuable real estate.
> > 
> > Sure you can, you just have to implement Inset::toolTip().
> > 
> > Abdel.
> 
> That would be like the attached then. Tested and works.
> 
> - Martin


Shall I put this in?

- Martin
  

> Index: InsetCollapsable.cpp
> ===================================================================
> --- InsetCollapsable.cpp      (revision 22750)
> +++ InsetCollapsable.cpp      (working copy)
> @@ -101,7 +101,9 @@
>  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_) {
> Index: InsetBranch.h
> ===================================================================
> --- InsetBranch.h     (revision 22750)
> +++ InsetBranch.h     (working copy)
> @@ -84,6 +84,8 @@
>       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 &);
> Index: InsetBranch.cpp
> ===================================================================
> --- InsetBranch.cpp   (revision 22750)
> +++ InsetBranch.cpp   (working copy)
> @@ -76,6 +76,12 @@
>  }
>  
>  
> +docstring InsetBranch::toolTip(BufferView const & bv, int x, int y) const
> +{
> +     return _("Branch: ") + params_.branch;
> +}
> +
> +
>  void InsetBranch::setButtonLabel()
>  {
>       docstring s = _("Branch: ") + params_.branch;

Reply via email to