[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ktexteditor-devel
Subject:    Re: texthint interface (kde4)
From:       Dominik Haumann <dhdev () gmx ! de>
Date:       2005-09-21 11:28:23
Message-ID: 200509211328.23096.dhdev () gmx ! de
[Download RAW message or body]

On Thursday 28 July 2005 16:23, Hamish Rodda wrote:
> * when one text hint has been completed, should the timer really start
> again? if the user missed the spot, and they move the cursor again, they
> have to wait the elapsed time again.  QTooltips for widgets work on a
> delay-once, show as many until interrupted (mouse click, move/focus off
> widget, key press etc).

If the timeout was not aborted (i.e. the user moved the mouse out of the 
range) the texthint should not reappear as long as the mouse stays in the 
range.
If the mouse moves out of the range and then in again, the texthint should 
appear again.

> * probably the biggest problem is that the interface doesn't enable the
> client to specify what text range (ie. start and end cursors) the tooltip
> applies to, thus how far the mouse has to go before the tooltip is
> invalid. This is especially important if we decide the above behaviour
> should not mean re-starting the timer.  It's of course easy to add.

Usually a isLetterOrNumber() in both directions of the current cursor should 
work to get a range from a cursor position, but for latex/kile it's a 
problem, so yes, I suggest the view emits a
  signal needTextHint(View* view, const Cursor&)
and then the client app can (later) call 
void setTextHint(const Range&, const QString& text, int timeout=5000); (1)
void setTextHint(const Cursor&, const QString& text, int timeout=5000); (2)

(2) is an overload, that internally expands the given cursor to a range by
    going to the left and right with isLetterOrNumber() (or something like
    that). So a simple usage is possible, but also a more advanced for Kile.

If the mouse is still in the range you get by using isLetterOrNumber() show 
the texthint.

so the TextHintInterface provides:
  virtual void setEnableTextHints(bool enable);
  virtual bool textHintsEnabled();

  virtual void setTextHint(const Range&, const QString& text, int timeout); 
  virtual void setTextHint(const Cursor&, const QString& text, int timeout); 

signal:
  void needTextHint(const View&, const Cursor&);

What about that?
-- 
Dominik
_______________________________________________
Ktexteditor-devel mailing list
Ktexteditor-devel@kde.org
https://mail.kde.org/mailman/listinfo/ktexteditor-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic