fix hover

This commit is contained in:
Vadim Lopatin 2014-04-14 10:15:50 +04:00
parent 506efefd14
commit 2a7b8b73e9
2 changed files with 10 additions and 7 deletions

View File

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:constantSize="true"
android:dither="false"
android:variablePadding="false" >
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:drawable="btn_default_small_normal_disable_focused"
color_transform_add1="100,0,0,0"

View File

@ -326,19 +326,25 @@ class Widget {
setState(State.Pressed);
return true;
}
if (event.action == MouseAction.Move && trackHover) {
}
if (trackHover) {
if (event.action == MouseAction.FocusOut || event.action == MouseAction.Cancel) {
resetState(State.Hovered);
return true;
}
if (event.action == MouseAction.Move) {
if (!(state & State.Hovered)) {
Log.d("Hover ", id);
setState(State.Hovered);
}
return true;
}
if (event.action == MouseAction.Leave && trackHover) {
if (event.action == MouseAction.Leave) {
Log.d("Leave ", id);
resetState(State.Hovered);
return true;
}
}
}
return false;
}