提交 ee4ffae0 编写于 作者: X xing-tai-zhang

Description: Fix the problem that the scroll wheel does not work on the screen

IssueNo: https://gitee.com/openharmony/graphic_ui/issues/I5FE50
Feature or Bugfix: Bugfix
Binary Source:No
Signed-off-by: Nxing-tai-zhang <zhangxingtai@huawei.com>
上级 193b8ab7
......@@ -253,6 +253,18 @@ bool UITimePicker::RefreshSelected(const char* value)
return true;
}
bool UITimePicker::OnPressEvent(const PressEvent& event)
{
if (event.GetCurrentPos().x < (GetX() + hourPicker_->GetX() + hourPicker_->GetWidth())) {
hourPicker_->RequestFocus();
} else if (event.GetCurrentPos().x < (GetX() + minutePicker_->GetX() + minutePicker_->GetWidth())) {
minutePicker_->RequestFocus();
} else if (event.GetCurrentPos().x < (GetX() + secondPicker_->GetX() + secondPicker_->GetWidth())) {
secondPicker_->RequestFocus();
}
return UIView::OnPressEvent(event);
}
void UITimePicker::SetItemHeight(int16_t height)
{
itemsHeight_ = height;
......
......@@ -295,6 +295,7 @@ public:
timePickerListener_ = timePickerListener;
}
bool OnPressEvent(const PressEvent& event) override;
private:
class UIPickerListener : public UIPicker::SelectedListener {
public:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册