| 1863 | } |
| 1864 | |
| 1865 | Uint32 UICodeEditor::onMouseClick( const Vector2i& position, const Uint32& flags ) { |
| 1866 | mLastActivity.restart(); |
| 1867 | for ( auto& plugin : mPlugins ) |
| 1868 | if ( plugin->onMouseClick( this, position, flags ) ) |
| 1869 | return UIWidget::onMouseClick( position, flags ); |
| 1870 | |
| 1871 | if ( mMinimapEnabled ) { |
| 1872 | Rectf rect( getMinimapRect( getScreenStart() ) ); |
| 1873 | if ( ( flags & EE_BUTTON_LMASK ) && rect.contains( position.asFloat() ) ) |
| 1874 | return 1; |
| 1875 | } |
| 1876 | |
| 1877 | MouseBindings::Shortcut shortcut{ MouseAction::Click, flags, |
| 1878 | getInput()->getSanitizedModState() }; |
| 1879 | |
| 1880 | if ( tryExecuteMouseBinding( shortcut ) ) |
| 1881 | return 1; |
| 1882 | |
| 1883 | if ( ( flags & EE_BUTTON_LMASK ) && getInput()->isKeyModPressed() ) { |
| 1884 | String link( checkMouseOverLink( position ) ); |
| 1885 | if ( !link.empty() ) { |
| 1886 | Engine::instance()->openURI( link.toUtf8() ); |
| 1887 | resetLinkOver( position ); |
| 1888 | } |
| 1889 | } else if ( ( flags & EE_BUTTON_MMASK ) && isMouseOverMeOrChildren() ) { |
| 1890 | auto txt( getUISceneNode()->getWindow()->getClipboard()->getText() ); |
| 1891 | if ( !isLocked() && !txt.empty() ) { |
| 1892 | if ( mDoc->hasSelection() ) { |
| 1893 | auto selTxt = mDoc->getSelectedText(); |
| 1894 | if ( !selTxt.empty() ) |
| 1895 | txt = selTxt; |
| 1896 | } |
| 1897 | mDoc->setSelection( resolveScreenPosition( position.asFloat() ) ); |
| 1898 | mDoc->textInput( txt ); |
| 1899 | } |
| 1900 | } |
| 1901 | return 1; |
| 1902 | } |
| 1903 | |
| 1904 | Uint32 UICodeEditor::onMouseDoubleClick( const Vector2i& position, const Uint32& flags ) { |
| 1905 | mLastActivity.restart(); |
nothing calls this directly
no test coverage detected