Tooltip will hide itself in no-titlebar mode

This commit is contained in:
pelya
2017-03-26 00:31:46 +02:00
committed by Sergii Pylypenko
parent 796c6b7b72
commit abce581863

View File

@@ -693,10 +693,12 @@ struct TooltipsWindow : public Window
if (pt.y + sm_height > scr_bot) pt.y = min(_cursor.pos.y + _cursor.total_offs.y - 5, scr_bot) - sm_height;
pt.x = sm_width >= _screen.width ? 0 : Clamp(_cursor.pos.x - (sm_width >> 1), 0, _screen.width - sm_width);
// Move it to the top of the screen, away from mouse cursor, so it won't steal screen taps on Android
pt.y = GetMainViewTop();
if (_cursor.pos.y < pt.y + GetMinSizing(NWST_STEP)) {
pt.x = _cursor.pos.x > _screen.width / 2 ? GetMinSizing(NWST_STEP) : _screen.width - sm_width - GetMinSizing(NWST_STEP);
if (_settings_client.gui.windows_titlebars) {
// Move it to the top of the screen, away from mouse cursor, so it won't steal screen taps on Android
pt.y = GetMainViewTop();
if (_cursor.pos.y < pt.y + GetMinSizing(NWST_STEP)) {
pt.x = _cursor.pos.x > _screen.width / 2 ? GetMinSizing(NWST_STEP) : _screen.width - sm_width - GetMinSizing(NWST_STEP);
}
}
return pt;