mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
MouseBindings in UICodeEditor WIP.
This commit is contained in:
@@ -197,9 +197,7 @@ static const char* DEFAULT_CHAT_GLOBE = R"xml(
|
||||
)xml";
|
||||
|
||||
LLMChatUI::LLMChatUI( PluginManager* manager ) :
|
||||
UILinearLayout(),
|
||||
WidgetCommandExecuter( getUISceneNode()->getWindow()->getInput() ),
|
||||
mManager( manager ) {
|
||||
UILinearLayout(), WidgetCommandExecuter( getInput() ), mManager( manager ) {
|
||||
setClass( "llm_chatui" );
|
||||
setLayoutSizePolicy( SizePolicy::MatchParent, SizePolicy::MatchParent );
|
||||
|
||||
|
||||
@@ -2465,22 +2465,21 @@ bool DebuggerPlugin::onMouseMove( UICodeEditor* editor, const Vector2i& position
|
||||
const std::optional<EvaluateInfo>& info ) {
|
||||
if ( info && mManager->getSplitter()->editorExists( editor ) &&
|
||||
!info->result.empty() ) {
|
||||
editor->runOnMainThread( [this, editor, info = std::move( *info ),
|
||||
expression]() {
|
||||
auto mousePos =
|
||||
editor->getUISceneNode()->getWindow()->getInput()->getMousePos();
|
||||
if ( !editor->getScreenRect().contains( mousePos.asFloat() ) )
|
||||
return;
|
||||
editor->runOnMainThread(
|
||||
[this, editor, info = std::move( *info ), expression]() {
|
||||
auto mousePos = editor->getInput()->getMousePos();
|
||||
if ( !editor->getScreenRect().contains( mousePos.asFloat() ) )
|
||||
return;
|
||||
|
||||
auto docPos = editor->resolveScreenPosition( mousePos.asFloat() );
|
||||
auto range =
|
||||
editor->getDocument().getWordRangeInPosition( docPos, true );
|
||||
auto docPos = editor->resolveScreenPosition( mousePos.asFloat() );
|
||||
auto range =
|
||||
editor->getDocument().getWordRangeInPosition( docPos, true );
|
||||
|
||||
if ( mCurrentHover.contains( range ) ) {
|
||||
mCurrentHover = range;
|
||||
displayTooltip( editor, expression, info, mousePos.asFloat() );
|
||||
}
|
||||
} );
|
||||
if ( mCurrentHover.contains( range ) ) {
|
||||
mCurrentHover = range;
|
||||
displayTooltip( editor, expression, info, mousePos.asFloat() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
@@ -644,7 +644,7 @@ bool LSPClientPlugin::onMouseClick( UICodeEditor* editor, const Vector2i& pos,
|
||||
}
|
||||
}
|
||||
|
||||
Input* input = editor->getUISceneNode()->getWindow()->getInput();
|
||||
Input* input = editor->getInput();
|
||||
Uint32 mod = input->getSanitizedModState();
|
||||
if ( mod != ( KEYMOD_LALT | KeyMod::getDefaultModifier() ) || ( flags & EE_BUTTON_LMASK ) == 0 )
|
||||
return false;
|
||||
@@ -1642,8 +1642,7 @@ void LSPClientPlugin::hideTooltip( UICodeEditor* editor ) {
|
||||
}
|
||||
|
||||
static TextPosition currentMouseTextPosition( UICodeEditor* editor ) {
|
||||
return editor->resolveScreenPosition(
|
||||
editor->getUISceneNode()->getWindow()->getInput()->getMousePos().asFloat() );
|
||||
return editor->resolveScreenPosition( editor->getInput()->getMousePos().asFloat() );
|
||||
}
|
||||
|
||||
void LSPClientPlugin::tryHideTooltip( UICodeEditor* editor, const Vector2i& position ) {
|
||||
|
||||
Reference in New Issue
Block a user