Further speedups for filebrowser

This commit is contained in:
Ingo Weyrich
2019-07-17 21:29:24 +02:00
parent d68b33effc
commit bbdd774afb
3 changed files with 25 additions and 24 deletions

View File

@@ -563,7 +563,7 @@ void ThumbBrowserBase::configScrollBars ()
}
}
void ThumbBrowserBase::arrangeFiles()
void ThumbBrowserBase::arrangeFiles(bool checkfilter)
{
MYREADERLOCK(l, entryRW);
@@ -572,17 +572,17 @@ void ThumbBrowserBase::arrangeFiles()
//GThreadLock lock;
int rowHeight = 0;
for (unsigned int i = 0; i < fd.size(); i++) {
// apply filter
fd[i]->filtered = !checkFilter (fd[i]);
for (const auto entry : fd) {
if (checkfilter) {
// apply filter
entry->filtered = !checkFilter(entry);
}
// compute size of the items
if (!fd[i]->filtered && fd[i]->getMinimalHeight() > rowHeight) {
rowHeight = fd[i]->getMinimalHeight ();
if (!entry->filtered) {
rowHeight = std::max(entry->getMinimalHeight(), rowHeight);
}
}
if (arrangement == TB_Horizontal) {
numOfCols = 1;
@@ -667,9 +667,9 @@ void ThumbBrowserBase::arrangeFiles()
}
if (ct < fd.size()) {
fd[ct]->setPosition(currx, curry, colWidths[i % numOfCols], rowHeight);
fd[ct]->setPosition(currx, curry, colWidths[i], rowHeight);
fd[ct]->drawable = true;
currx += colWidths[i % numOfCols];
currx += colWidths[i];
}
}
@@ -970,12 +970,12 @@ bool ThumbBrowserBase::Internal::on_scroll_event (GdkEventScroll* event)
}
void ThumbBrowserBase::redraw ()
void ThumbBrowserBase::redraw (bool checkfilter)
{
GThreadLock lock;
arrangeFiles ();
queue_draw ();
arrangeFiles(checkfilter);
queue_draw();
}
void ThumbBrowserBase::zoomChanged (bool zoomIn)