Description: text适配用户自定义鼠标样式

IssueNo: https://gitee.com/openharmony/arkui_ace_engine/issues/I8IJZY
Feature or Bugfix: Feature
Binary Source:No
Signed-off-by: chenjiafeng <chenjiafeng10@huawei.com>
This commit is contained in:
chenjiafeng 2023-11-26 14:32:11 +08:00
parent e34ebf1b35
commit 9d740cfa9c
3 changed files with 1 additions and 24 deletions

View File

@ -114,7 +114,7 @@ frameworks/core/components_ng/pattern/root/ @zhoutianer
frameworks/core/components_ng/pattern/scroll/ @rongShao-Z
frameworks/core/components_ng/pattern/scroll_bar/ @rongShao-Z
frameworks/core/components_ng/pattern/scrollable/ @yeyinglong_admin
frameworks/core/components_ng/pattern/search/ @luoying_ace_admin
frameworks/core/components_ng/pattern/search/ @jyj_0306
frameworks/core/components_ng/pattern/security_component/ @
frameworks/core/components_ng/pattern/select/ @luoying_ace_admin
frameworks/core/components_ng/pattern/select_overlay/ @lijuan124

View File

@ -176,7 +176,6 @@ void SearchPattern::OnModifyDone()
InitButtonAndImageClickEvent();
InitCancelButtonClickEvent();
InitTextFieldMouseEvent();
InitTextFieldValueChangeEvent();
InitButtonMouseEvent(searchButtonMouseEvent_, BUTTON_INDEX);
InitButtonMouseEvent(cancelButtonMouseEvent_, CANCEL_BUTTON_INDEX);
@ -603,27 +602,6 @@ void SearchPattern::InitButtonTouchEvent(RefPtr<TouchEventImpl>& touchEvent, int
gesture->AddTouchEvent(touchEvent);
}
void SearchPattern::InitTextFieldMouseEvent()
{
auto host = GetHost();
CHECK_NULL_VOID(host);
auto textFieldFrameNode = DynamicCast<FrameNode>(host->GetChildAtIndex(TEXTFIELD_INDEX));
CHECK_NULL_VOID(textFieldFrameNode);
auto eventHub = textFieldFrameNode->GetEventHub<TextFieldEventHub>();
CHECK_NULL_VOID(eventHub);
auto inputHub = eventHub->GetOrCreateInputEventHub();
CHECK_NULL_VOID(inputHub);
auto hoverTask = [weak = WeakClaim(this)](bool isHover) {
auto pattern = weak.Upgrade();
if (pattern) {
pattern->SetMouseStyle(isHover ? MouseFormat::TEXT_CURSOR : MouseFormat::DEFAULT);
}
};
textFieldHoverEvent_ = MakeRefPtr<InputEvent>(std::move(hoverTask));
inputHub->AddOnHoverEvent(textFieldHoverEvent_);
}
void SearchPattern::InitButtonMouseEvent(RefPtr<InputEvent>& inputEvent, int32_t childId)
{
if (inputEvent) {

View File

@ -155,7 +155,6 @@ private:
void GetInnerFocusPaintRect(RoundRect& paintRect);
void RequestKeyboard();
// Init touch and hover event
void InitTextFieldMouseEvent();
void InitTextFieldValueChangeEvent();
void InitButtonTouchEvent(RefPtr<TouchEventImpl>& touchEvent, int32_t childId);
void InitButtonMouseEvent(RefPtr<InputEvent>& inputEvent, int32_t childId);