mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-27 09:12:41 +00:00
!45023 修改输入框的border和padding之后标记textRect初始化
Merge pull request !45023 from 郝烁/autoui
This commit is contained in:
commit
1af55dbc6c
@ -738,6 +738,11 @@ void TextFieldModelNG::SetPadding(const NG::PaddingProperty& newPadding, Edge ol
|
||||
}
|
||||
NG::ViewAbstract::SetPadding(newPadding);
|
||||
ACE_UPDATE_PAINT_PROPERTY(TextFieldPaintProperty, PaddingByUser, newPadding);
|
||||
auto frameNode = ViewStackProcessor::GetInstance()->GetMainFrameNode();
|
||||
CHECK_NULL_VOID(frameNode);
|
||||
auto pattern = frameNode->GetPattern<TextFieldPattern>();
|
||||
CHECK_NULL_VOID(pattern);
|
||||
pattern->SetIsInitTextRect(false);
|
||||
}
|
||||
|
||||
void TextFieldModelNG::SetDefaultPadding()
|
||||
@ -756,6 +761,9 @@ void TextFieldModelNG::SetDefaultPadding()
|
||||
paddings.right = NG::CalcLength(themePadding.Right().ConvertToPx());
|
||||
ViewAbstract::SetPadding(paddings);
|
||||
ACE_UPDATE_PAINT_PROPERTY(TextFieldPaintProperty, PaddingByUser, paddings);
|
||||
auto pattern = frameNode->GetPattern<TextFieldPattern>();
|
||||
CHECK_NULL_VOID(pattern);
|
||||
pattern->SetIsInitTextRect(false);
|
||||
}
|
||||
|
||||
void TextFieldModelNG::SetHoverEffect(HoverEffectType hoverEffect)
|
||||
@ -1912,6 +1920,9 @@ void TextFieldModelNG::SetPadding(FrameNode* frameNode, NG::PaddingProperty& new
|
||||
CHECK_NULL_VOID(frameNode);
|
||||
NG::ViewAbstract::SetPadding(newPadding);
|
||||
ACE_UPDATE_NODE_PAINT_PROPERTY(TextFieldPaintProperty, PaddingByUser, newPadding, frameNode);
|
||||
auto pattern = frameNode->GetPattern<TextFieldPattern>();
|
||||
CHECK_NULL_VOID(pattern);
|
||||
pattern->SetIsInitTextRect(false);
|
||||
}
|
||||
|
||||
RefPtr<UINode> TextFieldModelNG::GetCustomKeyboard(FrameNode* frameNode)
|
||||
@ -1972,6 +1983,9 @@ void TextFieldModelNG::SetBorderWidth(FrameNode* frameNode, NG::BorderWidthPrope
|
||||
CHECK_NULL_VOID(frameNode);
|
||||
NG::ViewAbstract::SetBorderWidth(frameNode, borderWidth);
|
||||
ACE_UPDATE_NODE_PAINT_PROPERTY(TextFieldPaintProperty, BorderWidthFlagByUser, borderWidth, frameNode);
|
||||
auto pattern = frameNode->GetPattern<TextFieldPattern>();
|
||||
CHECK_NULL_VOID(pattern);
|
||||
pattern->SetIsInitTextRect(false);
|
||||
}
|
||||
|
||||
void TextFieldModelNG::SetBorderRadius(FrameNode* frameNode, NG::BorderRadiusProperty borderRadius)
|
||||
|
@ -2942,8 +2942,7 @@ void TextFieldPattern::OnModifyDone()
|
||||
SetShowError();
|
||||
}
|
||||
// The textRect position can't be changed by only redraw.
|
||||
if (CheckNeedMeasure(layoutProperty->GetPropertyChangeFlag()) && !HasInputOperation() &&
|
||||
(!HasFocus() || !initTextRect_) && isTextChangedAtCreation_) {
|
||||
if (!initTextRect_) {
|
||||
textRect_.SetLeft(GetPaddingLeft() + GetBorderLeft());
|
||||
textRect_.SetTop(GetPaddingTop() + GetBorderTop());
|
||||
initTextRect_ = true;
|
||||
|
@ -1528,6 +1528,10 @@ public:
|
||||
const RefPtr<CleanNodeResponseArea>& cleanNodeResponseArea);
|
||||
void StopContentScroll();
|
||||
void UpdateContentScroller(const Offset& localOffset);
|
||||
void SetIsInitTextRect(bool isInitTextRect)
|
||||
{
|
||||
initTextRect_ = isInitTextRect;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void InitDragEvent();
|
||||
|
Loading…
Reference in New Issue
Block a user