[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdegraphics/kolourpaint
From: Kazuki Ohta <mover () hct ! zaq ! ne ! jp>
Date: 2005-01-30 13:45:49
Message-ID: 20050130134549.6EF5CEA21 () office ! kde ! org
[Download RAW message or body]
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 µFocusHint)
+{
+ 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 µFocusHint);
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