-
Notifications
You must be signed in to change notification settings - Fork 818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
给 HBox 添加 cursortype="hand" 属性,没有效果 #49
Labels
question
Further information is requested
Comments
刚刚又试了下,给 HBox 加 cursor 属性是可以的,但是其内部的控件不能继承这个属性。 |
@caop3ng 属性不像事件,是没有冒泡或者捕获传播等特性,您还是需要给指定控件单独指定其特有的属性。或可以将不需要响应事件的控件 |
@nmgwddj 比如 HBox 里包含多个控件,想给整个 HBox 加上 hand cursor 属性应该只需要给 HBox 加一下就可以了,而不需要每一个子控件分别加上 hand cursor 属性吧? |
@caop3ng 这种情况当鼠标悬浮在子控件中,事件首先会被子控件捕获,子控件是需要单独处理 mouse hover 事件的。 |
@nmgwddj 有没有可能在 build 控件的时候,可以把某一些属性从父亲那里继承下来呢? |
可以重写自己关注的控件增加消息过滤器 AddMessageFilter 来实现类似功能。 |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题现象
因为想定义一个这样的控件:
<HBox><Control bkimage='icon.png'/><Label /></HBox>
并且想给Label和 icon 都加上 hand cursor,但是不能给 HBox 加。需要分别给每个控件加。
但是icon 和 Label 之间的空隙是 margin 产生的,没办法添加 hand cursor。
虽然空隙也可以定义一个控件,加上 hand cursor,但是这种方式感觉不好。
重现步骤
The text was updated successfully, but these errors were encountered: