Skip to content

Commit da97589

Browse files
committed
Improve showing app menus on touch.
Still not totlaly right to show app-level menus from touch screen, but workable.
1 parent 5cca0bb commit da97589

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/PopupDiv.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,16 @@ void PopupDivMenu::setupDesktopMenuStuff()
10561056
implementStateless( &PopupDivMenu::parentMouseWentOver, &PopupDivMenu::undoParentHoveredOver );
10571057

10581058
m_menuParent->clicked().connect( this, &PopupDivMenu::parentClicked );
1059+
1060+
m_menuParent->touchStarted().connect( std::bind( [this](){
1061+
popup( WPoint( -10000, -10000 ) );
1062+
doJavaScript(
1063+
"Wt.WT.ParentMouseWentOver('" + id() + "','" + m_menuParent->id() + "'," WT_CLASS ");"
1064+
"Wt.WT.ParentClicked('" + id() + "','" + m_menuParent->id() + "'," WT_CLASS ");" );
1065+
}));
1066+
m_menuParent->touchStarted().preventPropagation();
1067+
m_menuParent->touchStarted().preventDefaultAction();
1068+
10591069
m_menuParent->mouseWentOver().connect( this, &PopupDivMenu::parentMouseWentOver );
10601070

10611071
// TODO: see if we can connect to the 'cancel' signal in JS, so we can just do this there

0 commit comments

Comments
 (0)