ui: Display scope name at bottom of snippet if available

* Show scope name at bottom looking like top one
* Refactored CodeSnippetParams out of CodeView and use them everywhere
* Fixed border radius clipping problem at bottom of file by defining a small padding
* Scroll to line number when inserting a scope
This commit is contained in:
Eberhard Graether
2016-02-03 13:54:46 +01:00
parent e7224e0c46
commit b40e49b633
17 changed files with 296 additions and 294 deletions
+7 -4
View File
@@ -255,18 +255,21 @@ void QtCodeArea::setIsActiveFile(bool isActiveFile)
m_isActiveFile = isActiveFile;
}
QRectF QtCodeArea::getFirstActiveLineRect() const
uint QtCodeArea::getFirstActiveLineNumber() const
{
int lineNumber = 0;
for (const Annotation& annotation : m_annotations)
{
if (annotation.isActive)
{
lineNumber = annotation.startLine;
break;
return annotation.startLine;
}
}
return 0;
}
QRectF QtCodeArea::getLineRectForLineNumber(uint lineNumber) const
{
QTextBlock block = document()->findBlockByLineNumber(lineNumber - m_startLineNumber);
return blockBoundingGeometry(block);
}