mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Fix initial scrolling problem
The initial selection change signal seems to potentially be sent before the listview is even visible when we do the first "scrollTo()" to the currently selected dive. That, in turn, seems to result in that when the listview is actually shown, it will be scroll the trip description off the visible area, and force the current dive to be shown at the very top of the divelist. Which is not very nice: we do want to scroll to the current dive, but we don't want to hide the current trip in the process. Ignoring the selection change if the listview isn't even visible seems to fix things for me. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									9523132b6d
								
							
						
					
					
						commit
						3edec7c97d
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -514,6 +514,8 @@ void DiveListView::toggleColumnVisibilityByIndex() | |||
| 
 | ||||
| void DiveListView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) | ||||
| { | ||||
| 	if (!isVisible()) | ||||
| 		return; | ||||
| 	if (!current.isValid()) | ||||
| 		return; | ||||
| 	scrollTo(current); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue