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

List:       kde-commits
Subject:    Re: kdegraphics/kolourpaint
From:       Clarence Dang <dang () kde ! org>
Date:       2005-02-03 11:13:58
Message-ID: 200502032213.58728.dang () kde ! org
[Download RAW message or body]


Hi,

I think you need to consider zooming e.g. try editing text at 800% or with 
focus set to the thumbnail.  kpSelection/kpDocument works fully in unzoomed 
coordinates unlike the view (which is zoomed and can change size).

For example:

- m_viewUnderCursor->updateMicroFocusHint(QRect (topLeft.x (), topLeft.y (), 
1, sel->textStyle ().fontMetrics ().height ())); 

+  
m_viewUnderCursor->updateMicroFocusHint(m_viewUnderCursor->transformDocToView 
(QRect (topLeft.x (), topLeft.y (), 1, sel->textStyle ().fontMetrics 
().height ()))); 

But I'm not sure because I haven't had time to test the InputMethod code and 
don't think I'll have any time before the release (going overseas and then 
training fulltime).

Thanks,
Clarence

On Mon, 31 Jan 2005 12:45 am, Kazuki Ohta wrote:
> CVS commit by kzk:
>
> The enhancement of InputMethod support of KolourPaint.
>
> When the text which is composed by InputMethod, update correctly the
> microFocusHint, which is to be used by CandidateWindow.
>
>
>   M +9 -0      kpview.cpp   1.40
>   M +1 -0      kpview.h   1.14
>   M +13 -1     kpviewmanager.cpp   1.18
>   M +1 -1      kpviewmanager.h   1.10
>   M +5 -1      tools/kptooltext.cpp   1.15
>
>
> --- kdegraphics/kolourpaint/kpview.cpp  #1.39:1.40
> @@ -457,4 +457,13 @@ void kpView::updateQueuedArea ()
>  }
>
> +// public
> +void kpView::updateMicroFocusHint (const QRect &microFocusHint)
> +{
> +    int x = microFocusHint.topLeft().x();
> +    int y = microFocusHint.topLeft().y();
> +    int width = microFocusHint.width();
> +    int height = microFocusHint.height();
> +    setMicroFocusHint (x, y, width, height);
> +}
>
>  // public
>
> --- kdegraphics/kolourpaint/kpview.h  #1.13:1.14
> @@ -101,4 +101,5 @@ public:
>      void invalidateQueuedArea ();
>      void updateQueuedArea ();
> +    void updateMicroFocusHint (const QRect &microFocusHint);
>
>  signals:
>
> --- kdegraphics/kolourpaint/kpviewmanager.cpp  #1.17:1.18
> @@ -321,5 +321,5 @@ int kpViewManager::textCursorCol () cons
>  }
>
> -void kpViewManager::setTextCursorPosition (int row, int col)
> +void kpViewManager::setTextCursorPosition (int row, int col, bool
> isUpdateMicroFocusHint) {
>      if (row == m_textCursorRow && col == m_textCursorCol)
> @@ -340,4 +340,16 @@ void kpViewManager::setTextCursorPositio
>      restoreQueueUpdates ();
>      restoreFastUpdates ();
> +
> +    if (isUpdateMicroFocusHint)
> +    {
> +        if (m_viewUnderCursor)
> +        {
> +            QPoint topLeft = sel->pointForTextRowCol (m_textCursorRow,
> m_textCursorCol); +            if (topLeft != KP_INVALID_POINT)
> +            {
> +                m_viewUnderCursor->updateMicroFocusHint(QRect (topLeft.x
> (), topLeft.y (), 1, sel->textStyle ().fontMetrics ().height ())); +       
>     }
> +        }
> +    }
>  }
>
>
> --- kdegraphics/kolourpaint/kpviewmanager.h  #1.9:1.10
> @@ -92,5 +92,5 @@ public:
>      int textCursorRow () const;
>      int textCursorCol () const;
> -    void setTextCursorPosition (int row, int col);
> +    void setTextCursorPosition (int row, int col, bool
> isUpdateMicroFocusHint = false);
>
>      bool textCursorBlinkState () const;
>
> --- kdegraphics/kolourpaint/tools/kptooltext.cpp  #1.14:1.15
> @@ -594,5 +594,9 @@ void kpToolText::imComposeEvent (QIMEven
>      // set cursor pos
>      if (m_IMStartCursorRow >= 0)
> -        viewManager ()->setTextCursorPosition (m_IMStartCursorRow,
> m_IMStartCursorCol + e->cursorPos () + e->selectionLength()); +    {
> +        int row = m_IMStartCursorRow;
> +        int col = m_IMStartCursorCol + e->cursorPos () /* +
> e->selectionLength()*/; +        viewManager ()->setTextCursorPosition
> (row, col, true /* update MicroFocusHint */); +    }
>  }

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

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