ui: Show title bar at top and scroll bar at bottom in code view snippet list if necessary (issues #432, #479)
* Show title bar at top of snippet list if first file is cut off * Show scrollbar at bottom of snippet list if last snippet if cut off and horizontally scrollable * Extended scrollRequest API to different ScrollTarget modes * Fixed snippet extension broken if maximized first * Split off title bar functionality to separate class QtCodeFileTitleBar
This commit is contained in:
@@ -166,7 +166,8 @@ void QtCodeFileSingle::requestFileContent(const FilePath& filePath)
|
||||
).dispatch();
|
||||
}
|
||||
|
||||
bool QtCodeFileSingle::requestScroll(const FilePath& filePath, uint lineNumber, Id locationId, bool animated, bool onTop)
|
||||
bool QtCodeFileSingle::requestScroll(
|
||||
const FilePath& filePath, uint lineNumber, Id locationId, bool animated, ScrollTarget target)
|
||||
{
|
||||
FileData file = getFileData(filePath);
|
||||
if (file.area)
|
||||
@@ -207,7 +208,7 @@ bool QtCodeFileSingle::requestScroll(const FilePath& filePath, uint lineNumber,
|
||||
double percentA = double(lineNumber - 1) / m_area->getEndLineNumber();
|
||||
double percentB = endLineNumber ? double(endLineNumber - 1) / m_area->getEndLineNumber() : 0.0f;
|
||||
|
||||
ensurePercentVisibleAnimated(percentA, percentB, animated, onTop);
|
||||
ensurePercentVisibleAnimated(percentA, percentB, animated, target);
|
||||
|
||||
m_scrollRequested = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user