瀏覽代碼

no old selection

Michael 2 年之前
父節點
當前提交
6013549ef8
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      client/lobby/SelectionTab.cpp

+ 6 - 0
client/lobby/SelectionTab.cpp

@@ -512,6 +512,12 @@ void SelectionTab::select(int position)
 		filter(-1);
 		slider->scrollTo(0);
 
+		int firstPos = boost::range::find_if(curItems, [](std::shared_ptr<ElementInfo> e) { return !e->isFolder; }) - curItems.begin();
+		if(firstPos < curItems.size())
+		{
+			selectAbs(firstPos);
+		}
+
 		return;
 	}