ui: usability fixes

* reduced mouse drag sensibility when clicking on graph nodes
* also edit search element when cursor in front and pressing DELETE
* scroll to up to minimized snippet after minimizing when scrolled down far
This commit is contained in:
Eberhard Graether
2019-06-28 12:43:31 +02:00
parent 841a87469b
commit 5cc39824e0
7 changed files with 35 additions and 43 deletions
@@ -295,7 +295,13 @@ void QtCodeFileList::setFileMinimized(const FilePath path)
}
else
{
getFile(path)->setMinimized();
QtCodeFile* file = getFile(path);
file->setMinimized();
if (m_firstSnippetTitleBar->isVisible())
{
ensureWidgetVisibleAnimated(m_filesArea, file->getTitleBar(), QRect(), false, SCROLL_TOP);
}
}
}
@@ -301,11 +301,11 @@ void QtSmartSearchBox::keyPressEvent(QKeyEvent* event)
}
else if (!hasSelectedText() && cursorPosition() == text().size() && m_cursorIndex < m_elements.size())
{
m_elements[m_cursorIndex]->setChecked(true);
deleteSelectedElements();
editElement(m_elements[m_cursorIndex]);
setCursorPosition(0);
return;
}
else
else if (event->matches(QKeySequence::DeleteStartOfWord))
{
std::string str = text().toStdString();
std::smatch match;
@@ -35,7 +35,7 @@ void QtGraphNodeComponentClickable::nodeMouseMoveEvent(QGraphicsSceneMouseEvent*
{
Vec2i mousePos = Vec2i(event->scenePos().x(), event->scenePos().y());
if ((mousePos - m_mousePos).getLength() > 1.0f)
if ((mousePos - m_mousePos).getLength() > 3.0f)
{
m_mouseMoved = true;
}