abs -> fabs, disable WidthBuffer, patch for confirmation in HandleInputMethodChanged
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9761 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
23e2aae480
commit
2d7662810e
@ -3615,7 +3615,7 @@ BTextView::StyledWidth(int32 fromOffset, int32 length, float *outAscent,
|
|||||||
maxDescent = max_c(descent, maxDescent);
|
maxDescent = max_c(descent, maxDescent);
|
||||||
|
|
||||||
// Use _BWidthBuffer_ if possible
|
// Use _BWidthBuffer_ if possible
|
||||||
if (sWidths != NULL) {
|
if (false && (sWidths != NULL)) {
|
||||||
LockWidthBuffer();
|
LockWidthBuffer();
|
||||||
result += sWidths->StringWidth(*fText, fromOffset, numChars, font);
|
result += sWidths->StringWidth(*fText, fromOffset, numChars, font);
|
||||||
UnlockWidthBuffer();
|
UnlockWidthBuffer();
|
||||||
@ -4391,6 +4391,16 @@ BTextView::HandleInputMethodChanged(BMessage *message)
|
|||||||
|
|
||||||
be_app->ObscureCursor();
|
be_app->ObscureCursor();
|
||||||
|
|
||||||
|
// If we find the "be:confirmed" boolean (and the boolean is true),
|
||||||
|
// it means it's over for now, so the current _BInlineInput_ object
|
||||||
|
// should become inactive
|
||||||
|
bool confirmed = false;
|
||||||
|
if (message->FindBool("be:confirmed", &confirmed) == B_OK && confirmed) {
|
||||||
|
fInline->SetActive(false);
|
||||||
|
Refresh(0, fInline->Offset(), true, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Delete the previously inserted text (if any)
|
// Delete the previously inserted text (if any)
|
||||||
if (fInline->IsActive()) {
|
if (fInline->IsActive()) {
|
||||||
int32 oldOffset = fInline->Offset();
|
int32 oldOffset = fInline->Offset();
|
||||||
@ -4425,21 +4435,12 @@ BTextView::HandleInputMethodChanged(BMessage *message)
|
|||||||
fInline->SetSelectionOffset(selectionStart);
|
fInline->SetSelectionOffset(selectionStart);
|
||||||
fInline->SetSelectionLength(selectionEnd - selectionStart);
|
fInline->SetSelectionLength(selectionEnd - selectionStart);
|
||||||
|
|
||||||
if (clauseCount > 0) {
|
|
||||||
// Insert the new text
|
// Insert the new text
|
||||||
InsertText(string, stringLen, fSelStart, NULL);
|
InsertText(string, stringLen, fSelStart, NULL);
|
||||||
fSelStart += stringLen;
|
fSelStart += stringLen;
|
||||||
fClickOffset = fSelEnd = fSelStart;
|
fClickOffset = fSelEnd = fSelStart;
|
||||||
}
|
|
||||||
|
|
||||||
// If we find the "be:confirmed" boolean (and the boolean is true),
|
|
||||||
// it means it's over for now, so the current _BInlineInput_ object
|
|
||||||
// should become inactive
|
|
||||||
bool confirmed = false;
|
|
||||||
if (message->FindBool("be:confirmed", &confirmed) < B_OK || !confirmed)
|
|
||||||
fInline->SetActive(true);
|
fInline->SetActive(true);
|
||||||
else
|
|
||||||
fInline->SetActive(false);
|
|
||||||
|
|
||||||
Refresh(0, fSelEnd, true, false);
|
Refresh(0, fSelEnd, true, false);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user