mirror of https://github.com/buggins/dlangui.git
implement #245 - TOUCH_MODE flag; true for Android
This commit is contained in:
parent
01f82d6725
commit
155607f188
|
@ -7,6 +7,7 @@ import core.stdc.string : memset;
|
|||
import dlangui.core.logger;
|
||||
|
||||
import dlangui.widgets.styles;
|
||||
import dlangui.widgets.widget;
|
||||
import dlangui.graphics.drawbuf;
|
||||
import dlangui.graphics.gldrawbuf;
|
||||
import dlangui.graphics.glsupport;
|
||||
|
@ -650,6 +651,7 @@ extern (C) void android_main(android_app* state) {
|
|||
}
|
||||
initResourceManagers();
|
||||
SCREEN_DPI = getDensityDpi(state);
|
||||
TOUCH_MODE = true;
|
||||
Log.i("SCREEN_DPI=", SCREEN_DPI);
|
||||
|
||||
//currentTheme = createDefaultTheme();
|
||||
|
|
|
@ -177,7 +177,7 @@ protected:
|
|||
|
||||
public:
|
||||
/// mouse movement processing flag (when true, widget will change Hover state while mouse is moving)
|
||||
@property bool trackHover() const { return _trackHover; }
|
||||
@property bool trackHover() const { return _trackHover && !TOUCH_MODE; }
|
||||
/// set new trackHover flag value (when true, widget will change Hover state while mouse is moving)
|
||||
@property Widget trackHover(bool v) { _trackHover = v; return this; }
|
||||
|
||||
|
@ -1212,7 +1212,8 @@ public:
|
|||
if (event.action == MouseAction.Move) {
|
||||
if (!(state & State.Hovered)) {
|
||||
debug(mouse) Log.d("Hover ", id);
|
||||
setState(State.Hovered);
|
||||
if (!TOUCH_MODE)
|
||||
setState(State.Hovered);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1820,3 +1821,4 @@ string generatePropertySettersMethodOverride(string methodName, string typeName,
|
|||
}
|
||||
|
||||
|
||||
__gshared bool TOUCH_MODE = false;
|
||||
|
|
Loading…
Reference in New Issue